diff --git a/modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java b/modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java index 777889df90..6721c251e4 100644 --- a/modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java +++ b/modules/examples/src/main/java/com/ibm/cloud/is/vpc/v1/VPCExamples.java @@ -351,7 +351,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerAction; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPatch; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerPoliciesPager; @@ -3714,7 +3714,7 @@ public static void main(String[] args) throws Exception { InstanceGroupManagerScheduledActionGroupPrototype instanceGroupManagerScheduledActionGroupPrototypeModel = new InstanceGroupManagerScheduledActionGroupPrototype.Builder() .membershipCount(Long.valueOf("10")) .build(); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.Builder() + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.Builder() .group(instanceGroupManagerScheduledActionGroupPrototypeModel).cronSpec("*/5 1,2,3 * * *") .build(); CreateInstanceGroupManagerActionOptions createInstanceGroupManagerActionOptions = new CreateInstanceGroupManagerActionOptions.Builder() diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java index bb30d795f5..3e497e599b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/Vpc.java @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.105.1-067d600b-20250616-154447 + * IBM OpenAPI SDK Code Generator Version: 3.108.0-56772134-20251111-102802 */ package com.ibm.cloud.is.vpc.v1; @@ -25,6 +25,7 @@ import com.ibm.cloud.is.vpc.v1.model.AddInstanceNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddVirtualNetworkInterfaceIpOptions; +import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddressPrefix; @@ -47,6 +48,7 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfaceCollection; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfile; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.ClusterNetwork; @@ -73,6 +75,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.CreateDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.CreateEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.CreateEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.CreateFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.CreateFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.CreateIkePolicyOptions; @@ -151,6 +154,7 @@ import com.ibm.cloud.is.vpc.v1.model.DeleteDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.DeleteEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteIkePolicyOptions; @@ -217,6 +221,8 @@ import com.ibm.cloud.is.vpc.v1.model.DisconnectVpnClientOptions; import com.ibm.cloud.is.vpc.v1.model.EndpointGateway; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayCollection; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBinding; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingCollection; import com.ibm.cloud.is.vpc.v1.model.FailoverShareOptions; import com.ibm.cloud.is.vpc.v1.model.FloatingIP; import com.ibm.cloud.is.vpc.v1.model.FloatingIPCollection; @@ -247,6 +253,7 @@ import com.ibm.cloud.is.vpc.v1.model.GetDedicatedHostProfileOptions; import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.GetFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.GetIkePolicyOptions; @@ -323,6 +330,7 @@ import com.ibm.cloud.is.vpc.v1.model.GetVpcRoutingTableRouteOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayConnectionOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayServiceConnectionOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerClientConfigurationOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerClientOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerOptions; @@ -334,9 +342,11 @@ import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyCollection; import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyConnectionCollection; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageBareMetalServerProfileCollection; import com.ibm.cloud.is.vpc.v1.model.ImageCollection; import com.ibm.cloud.is.vpc.v1.model.ImageExportJob; import com.ibm.cloud.is.vpc.v1.model.ImageExportJobUnpaginatedCollection; +import com.ibm.cloud.is.vpc.v1.model.ImageInstanceProfileCollection; import com.ibm.cloud.is.vpc.v1.model.Instance; import com.ibm.cloud.is.vpc.v1.model.InstanceAction; import com.ibm.cloud.is.vpc.v1.model.InstanceClusterNetworkAttachment; @@ -384,12 +394,15 @@ import com.ibm.cloud.is.vpc.v1.model.ListDedicatedHostProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListDedicatedHostsOptions; import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewayIpsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewayResourceBindingsOptions; import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewaysOptions; import com.ibm.cloud.is.vpc.v1.model.ListFloatingIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListFlowLogCollectorsOptions; import com.ibm.cloud.is.vpc.v1.model.ListIkePoliciesOptions; import com.ibm.cloud.is.vpc.v1.model.ListIkePolicyConnectionsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListImageBareMetalServerProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListImageExportJobsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListImageInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListImagesOptions; import com.ibm.cloud.is.vpc.v1.model.ListInstanceClusterNetworkAttachmentsOptions; import com.ibm.cloud.is.vpc.v1.model.ListInstanceDisksOptions; @@ -439,11 +452,13 @@ import com.ibm.cloud.is.vpc.v1.model.ListSharesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotClonesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotConsistencyGroupsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListSnapshotInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotsOptions; import com.ibm.cloud.is.vpc.v1.model.ListSubnetReservedIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListSubnetsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVirtualNetworkInterfaceIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVirtualNetworkInterfacesOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVolumeInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVolumeProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVolumesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcAddressPrefixesOptions; @@ -452,9 +467,11 @@ import com.ibm.cloud.is.vpc.v1.model.ListVpcRoutingTableRoutesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcRoutingTablesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayAdvertisedCidrsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsLocalCidrsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsPeerCidrsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayServiceConnectionsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewaysOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnServerClientsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnServerRoutesOptions; @@ -504,6 +521,7 @@ import com.ibm.cloud.is.vpc.v1.model.RemoveInstanceNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVirtualNetworkInterfaceIpOptions; +import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.ReplaceBareMetalServerInitializationOptions; @@ -550,6 +568,7 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotCollection; import com.ibm.cloud.is.vpc.v1.model.SnapshotConsistencyGroup; import com.ibm.cloud.is.vpc.v1.model.SnapshotConsistencyGroupCollection; +import com.ibm.cloud.is.vpc.v1.model.SnapshotInstanceProfileCollection; import com.ibm.cloud.is.vpc.v1.model.StartBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.StopBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.Subnet; @@ -570,6 +589,7 @@ import com.ibm.cloud.is.vpc.v1.model.UpdateDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.UpdateEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFirmwareForBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFlowLogCollectorOptions; @@ -630,10 +650,13 @@ import com.ibm.cloud.is.vpc.v1.model.VPCDNSResolutionBinding; import com.ibm.cloud.is.vpc.v1.model.VPCDNSResolutionBindingCollection; import com.ibm.cloud.is.vpc.v1.model.VPNGateway; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayAdvertisedCIDRCollection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayCollection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionCIDRs; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionCollection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCollection; import com.ibm.cloud.is.vpc.v1.model.VPNServer; import com.ibm.cloud.is.vpc.v1.model.VPNServerClient; import com.ibm.cloud.is.vpc.v1.model.VPNServerClientCollection; @@ -646,6 +669,7 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeAttachment; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentCollection; import com.ibm.cloud.is.vpc.v1.model.VolumeCollection; +import com.ibm.cloud.is.vpc.v1.model.VolumeInstanceProfileCollection; import com.ibm.cloud.is.vpc.v1.model.VolumeProfile; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileCollection; import com.ibm.cloud.is.vpc.v1.model.Zone; @@ -668,7 +692,7 @@ * The IBM Cloud Virtual Private Cloud (VPC) API can be used to programmatically provision and manage virtual server * instances, along with subnets, volumes, load balancers, and more. * - * API Version: 2025-07-08 + * API Version: 2025-12-16 */ public class Vpc extends BaseService { private static final Logger LOGGER = Logger.getLogger(Vpc.class.getName()); @@ -700,6 +724,8 @@ public class Vpc extends BaseService { m.put("eu-gb", "https://eu-gb.iaas.cloud.ibm.com/v1"); // United Kingdom (London) + m.put("in-che", "https://in-che.iaas.cloud.ibm.com/v1"); // India (Chennai) + 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) @@ -722,7 +748,7 @@ public static String getServiceUrlForRegion(String region) { private Long generation = Long.valueOf("2"); - private String version = "2025-07-08"; + private String version = "2025-12-16"; /** * Class method which constructs an instance of the `Vpc` client. @@ -786,7 +812,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 - * `2025-06-30` and `2025-07-10`. + * `2025-12-09` and `2025-12-17`. * * @return the version */ @@ -805,1119 +831,1088 @@ public void setVersion(final String version) { } /** - * List VPCs. + * List backup policies. * - * This request lists VPCs in the region. A VPC is a virtual network that belongs to an account and provides logical - * isolation from other networks. A VPC is made up of resources in one or more zones. VPCs are regional, and each VPC - * can contain resources in multiple zones in a region. + * This request lists backup policies in the region. Backup policies control which sources are selected for backup and + * include a set of backup policy plans that provide the backup schedules and deletion triggers. * - * @param listVpcsOptions the {@link ListVpcsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPCCollection} + * @param listBackupPoliciesOptions the {@link ListBackupPoliciesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyCollection} */ - public ServiceCall listVpcs(ListVpcsOptions listVpcsOptions) { - if (listVpcsOptions == null) { - listVpcsOptions = new ListVpcsOptions.Builder().build(); + public ServiceCall listBackupPolicies(ListBackupPoliciesOptions listBackupPoliciesOptions) { + if (listBackupPoliciesOptions == null) { + listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder().build(); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcs"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBackupPolicies"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpcsOptions.start() != null) { - builder.query("start", String.valueOf(listVpcsOptions.start())); + if (listBackupPoliciesOptions.start() != null) { + builder.query("start", String.valueOf(listBackupPoliciesOptions.start())); } - if (listVpcsOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpcsOptions.limit())); + if (listBackupPoliciesOptions.limit() != null) { + builder.query("limit", String.valueOf(listBackupPoliciesOptions.limit())); } - if (listVpcsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listVpcsOptions.resourceGroupId())); + if (listBackupPoliciesOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listBackupPoliciesOptions.resourceGroupId())); } - if (listVpcsOptions.classicAccess() != null) { - builder.query("classic_access", String.valueOf(listVpcsOptions.classicAccess())); + if (listBackupPoliciesOptions.name() != null) { + builder.query("name", String.valueOf(listBackupPoliciesOptions.name())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listBackupPoliciesOptions.tag() != null) { + builder.query("tag", String.valueOf(listBackupPoliciesOptions.tag())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List VPCs. + * List backup policies. * - * This request lists VPCs in the region. A VPC is a virtual network that belongs to an account and provides logical - * isolation from other networks. A VPC is made up of resources in one or more zones. VPCs are regional, and each VPC - * can contain resources in multiple zones in a region. + * This request lists backup policies in the region. Backup policies control which sources are selected for backup and + * include a set of backup policy plans that provide the backup schedules and deletion triggers. * - * @return a {@link ServiceCall} with a result of type {@link VPCCollection} + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyCollection} */ - public ServiceCall listVpcs() { - return listVpcs(null); + public ServiceCall listBackupPolicies() { + return listBackupPolicies(null); } /** - * Create a VPC. - * - * This request creates a new VPC from a VPC prototype object. The prototype object is structured in the same way as a - * retrieved VPC, and contains the information necessary to create the new VPC. + * Create a backup policy. * - * The system will automatically create the following additional resources for the VPC: - * - Unless `address_prefix_management` is `manual`, a [default address - * prefix](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-address-prefix) for each zone - * - A [default network - * ACL](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-network-acl) - * - A [default routing - * table](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-routing-table) - * - A [default security - * group](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-security-group). + * This request creates a new backup policy from a backup policy prototype object. The prototype object is structured + * in the same way as a retrieved backup policy, and contains the information necessary to create the new backup + * policy. * - * @param createVpcOptions the {@link CreateVpcOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPC} + * @param createBackupPolicyOptions the {@link CreateBackupPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicy} */ - public ServiceCall createVpc(CreateVpcOptions createVpcOptions) { - boolean skipBody = false; - if (createVpcOptions == null) { - createVpcOptions = new CreateVpcOptions.Builder().build(); - skipBody = true; - } - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpc"); + public ServiceCall createBackupPolicy(CreateBackupPolicyOptions createBackupPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createBackupPolicyOptions, + "createBackupPolicyOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBackupPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (!skipBody) { - final JsonObject contentJson = new JsonObject(); - if (createVpcOptions.addressPrefixManagement() != null) { - contentJson.addProperty("address_prefix_management", createVpcOptions.addressPrefixManagement()); - } - if (createVpcOptions.classicAccess() != null) { - contentJson.addProperty("classic_access", createVpcOptions.classicAccess()); - } - if (createVpcOptions.dns() != null) { - contentJson.add("dns", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcOptions.dns())); - } - if (createVpcOptions.name() != null) { - contentJson.addProperty("name", createVpcOptions.name()); - } - if (createVpcOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcOptions.resourceGroup())); - } - builder.bodyJson(contentJson); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createBackupPolicyOptions.backupPolicyPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a VPC. - * - * This request creates a new VPC from a VPC prototype object. The prototype object is structured in the same way as a - * retrieved VPC, and contains the information necessary to create the new VPC. - * - * The system will automatically create the following additional resources for the VPC: - * - Unless `address_prefix_management` is `manual`, a [default address - * prefix](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-address-prefix) for each zone - * - A [default network - * ACL](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-network-acl) - * - A [default routing - * table](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-routing-table) - * - A [default security - * group](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-security-group). - * - * @return a {@link ServiceCall} with a result of type {@link VPC} - */ - public ServiceCall createVpc() { - return createVpc(null); - } - - /** - * Delete a VPC. - * - * This request deletes a VPC. This operation cannot be reversed. - * - * For this request to succeed: - * - Instances, subnets, public gateways, endpoint gateways, and private path service - * gateways must not reside in this VPC - * - The VPC must not be providing DNS resolution for any other VPCs - * - If `dns.enable_hub` is `true`, `dns.resolution_binding_count` must be zero + * List jobs for a backup policy. * - * All security groups and network ACLs associated with the VPC are automatically deleted. All flow log collectors - * with `auto_delete` set to `true` targeting the VPC or any resource in the VPC are automatically deleted. All public - * address ranges attached to the VPC are automatically detached. + * This request retrieves jobs for a backup policy. A backup job represents the execution of a backup policy plan for + * a resource matching the policy's criteria. * - * @param deleteVpcOptions the {@link DeleteVpcOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listBackupPolicyJobsOptions the {@link ListBackupPolicyJobsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyJobCollection} */ - public ServiceCall deleteVpc(DeleteVpcOptions deleteVpcOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcOptions, - "deleteVpcOptions cannot be null"); + public ServiceCall listBackupPolicyJobs(ListBackupPolicyJobsOptions listBackupPolicyJobsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listBackupPolicyJobsOptions, + "listBackupPolicyJobsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteVpcOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpc"); + pathParamsMap.put("backup_policy_id", listBackupPolicyJobsOptions.backupPolicyId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/jobs", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBackupPolicyJobs"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - if (deleteVpcOptions.ifMatch() != null) { - builder.header("If-Match", deleteVpcOptions.ifMatch()); - } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listBackupPolicyJobsOptions.status() != null) { + builder.query("status", String.valueOf(listBackupPolicyJobsOptions.status())); + } + if (listBackupPolicyJobsOptions.backupPolicyPlanId() != null) { + builder.query("backup_policy_plan.id", String.valueOf(listBackupPolicyJobsOptions.backupPolicyPlanId())); + } + if (listBackupPolicyJobsOptions.start() != null) { + builder.query("start", String.valueOf(listBackupPolicyJobsOptions.start())); + } + if (listBackupPolicyJobsOptions.limit() != null) { + builder.query("limit", String.valueOf(listBackupPolicyJobsOptions.limit())); + } + if (listBackupPolicyJobsOptions.sort() != null) { + builder.query("sort", String.valueOf(listBackupPolicyJobsOptions.sort())); + } + if (listBackupPolicyJobsOptions.sourceId() != null) { + builder.query("source.id", String.valueOf(listBackupPolicyJobsOptions.sourceId())); + } + if (listBackupPolicyJobsOptions.targetSnapshotsId() != null) { + builder.query("target_snapshots[].id", String.valueOf(listBackupPolicyJobsOptions.targetSnapshotsId())); + } + if (listBackupPolicyJobsOptions.targetSnapshotsCrn() != null) { + builder.query("target_snapshots[].crn", String.valueOf(listBackupPolicyJobsOptions.targetSnapshotsCrn())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a VPC. + * Retrieve a backup policy job. * - * This request retrieves a single VPC specified by the identifier in the URL. + * This request retrieves a single backup policy job specified by the identifier in the URL. * - * @param getVpcOptions the {@link GetVpcOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPC} + * @param getBackupPolicyJobOptions the {@link GetBackupPolicyJobOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyJob} */ - public ServiceCall getVpc(GetVpcOptions getVpcOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcOptions, - "getVpcOptions cannot be null"); + public ServiceCall getBackupPolicyJob(GetBackupPolicyJobOptions getBackupPolicyJobOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBackupPolicyJobOptions, + "getBackupPolicyJobOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVpcOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpc"); + pathParamsMap.put("backup_policy_id", getBackupPolicyJobOptions.backupPolicyId()); + pathParamsMap.put("id", getBackupPolicyJobOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/jobs/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBackupPolicyJob"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a VPC. + * List plans for a backup policy. * - * This request updates a VPC with the information provided in a VPC patch object. The patch object is structured in - * the same way as a retrieved VPC and needs to contain only the information to be updated. + * This request retrieves plans for a backup policy. Backup plans provide the backup schedule and deletion triggers. * - * @param updateVpcOptions the {@link UpdateVpcOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPC} + * @param listBackupPolicyPlansOptions the {@link ListBackupPolicyPlansOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlanCollection} */ - public ServiceCall updateVpc(UpdateVpcOptions updateVpcOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcOptions, - "updateVpcOptions cannot be null"); + public ServiceCall listBackupPolicyPlans(ListBackupPolicyPlansOptions listBackupPolicyPlansOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listBackupPolicyPlansOptions, + "listBackupPolicyPlansOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateVpcOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpc"); + pathParamsMap.put("backup_policy_id", listBackupPolicyPlansOptions.backupPolicyId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBackupPolicyPlans"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateVpcOptions.ifMatch() != null) { - builder.header("If-Match", updateVpcOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcOptions.vpcPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Retrieve a VPC's default network ACL. + if (listBackupPolicyPlansOptions.name() != null) { + builder.query("name", String.valueOf(listBackupPolicyPlansOptions.name())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create a plan for a backup policy. * - * This request retrieves the default network ACL for the VPC specified by the identifier in the URL. The default - * network ACL is applied to any new subnets in the VPC which do not specify a network ACL. + * This request creates a new backup policy plan from a backup policy plan prototype object. The prototype object is + * structured in the same way as a retrieved backup policy plan, and contains the information necessary to create the + * new backup policy plan. * - * @param getVpcDefaultNetworkAclOptions the {@link GetVpcDefaultNetworkAclOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DefaultNetworkACL} + * Backups created by this plan will use the resource group of the source being backed up. + * + * Backups created by this plan will use the plan's name truncated to 46 characters, followed by a unique 16-character + * suffix. + * + * @param createBackupPolicyPlanOptions the {@link CreateBackupPolicyPlanOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlan} */ - public ServiceCall getVpcDefaultNetworkAcl(GetVpcDefaultNetworkAclOptions getVpcDefaultNetworkAclOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcDefaultNetworkAclOptions, - "getVpcDefaultNetworkAclOptions cannot be null"); + public ServiceCall createBackupPolicyPlan(CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createBackupPolicyPlanOptions, + "createBackupPolicyPlanOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVpcDefaultNetworkAclOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}/default_network_acl", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcDefaultNetworkAcl"); + pathParamsMap.put("backup_policy_id", createBackupPolicyPlanOptions.backupPolicyId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBackupPolicyPlan"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("cron_spec", createBackupPolicyPlanOptions.cronSpec()); + if (createBackupPolicyPlanOptions.active() != null) { + contentJson.addProperty("active", createBackupPolicyPlanOptions.active()); + } + if (createBackupPolicyPlanOptions.attachUserTags() != null) { + contentJson.add("attach_user_tags", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createBackupPolicyPlanOptions.attachUserTags())); + } + if (createBackupPolicyPlanOptions.clonePolicy() != null) { + contentJson.add("clone_policy", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createBackupPolicyPlanOptions.clonePolicy())); + } + if (createBackupPolicyPlanOptions.copyUserTags() != null) { + contentJson.addProperty("copy_user_tags", createBackupPolicyPlanOptions.copyUserTags()); + } + if (createBackupPolicyPlanOptions.deletionTrigger() != null) { + contentJson.add("deletion_trigger", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createBackupPolicyPlanOptions.deletionTrigger())); + } + if (createBackupPolicyPlanOptions.name() != null) { + contentJson.addProperty("name", createBackupPolicyPlanOptions.name()); + } + if (createBackupPolicyPlanOptions.remoteRegionPolicies() != null) { + contentJson.add("remote_region_policies", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createBackupPolicyPlanOptions.remoteRegionPolicies())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a VPC's default routing table. + * Delete a backup policy plan. * - * This request retrieves the default routing table for the VPC specified by the identifier in the URL. The default - * routing table is associated with any subnets in the VPC which have not been explicitly associated with another - * routing table. + * This request deletes a backup policy plan. This operation cannot be reversed. Any backups that have been created by + * the plan will remain but will no longer be subject to the plan's deletion trigger. Any running jobs associated with + * the plan will run to completion before the plan is deleted. * - * @param getVpcDefaultRoutingTableOptions the {@link GetVpcDefaultRoutingTableOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DefaultRoutingTable} + * If the request is accepted, the backup policy plan `status` will be set to `deleting`. Once deletion processing + * completes, the backup policy plan will no longer be retrievable. + * + * @param deleteBackupPolicyPlanOptions the {@link DeleteBackupPolicyPlanOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlan} */ - public ServiceCall getVpcDefaultRoutingTable(GetVpcDefaultRoutingTableOptions getVpcDefaultRoutingTableOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcDefaultRoutingTableOptions, - "getVpcDefaultRoutingTableOptions cannot be null"); + public ServiceCall deleteBackupPolicyPlan(DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBackupPolicyPlanOptions, + "deleteBackupPolicyPlanOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVpcDefaultRoutingTableOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}/default_routing_table", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcDefaultRoutingTable"); + pathParamsMap.put("backup_policy_id", deleteBackupPolicyPlanOptions.backupPolicyId()); + pathParamsMap.put("id", deleteBackupPolicyPlanOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBackupPolicyPlan"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (deleteBackupPolicyPlanOptions.ifMatch() != null) { + builder.header("If-Match", deleteBackupPolicyPlanOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a VPC's default security group. + * Retrieve a backup policy plan. * - * This request retrieves the default security group for the VPC specified by the identifier in the URL. Resources - * created in this VPC that allow a security group to be optionally specified will use this security group by default. + * This request retrieves a single backup policy plan specified by the identifier in the URL. * - * @param getVpcDefaultSecurityGroupOptions the {@link GetVpcDefaultSecurityGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DefaultSecurityGroup} + * @param getBackupPolicyPlanOptions the {@link GetBackupPolicyPlanOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlan} */ - public ServiceCall getVpcDefaultSecurityGroup(GetVpcDefaultSecurityGroupOptions getVpcDefaultSecurityGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcDefaultSecurityGroupOptions, - "getVpcDefaultSecurityGroupOptions cannot be null"); + public ServiceCall getBackupPolicyPlan(GetBackupPolicyPlanOptions getBackupPolicyPlanOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBackupPolicyPlanOptions, + "getBackupPolicyPlanOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVpcDefaultSecurityGroupOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}/default_security_group", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcDefaultSecurityGroup"); + pathParamsMap.put("backup_policy_id", getBackupPolicyPlanOptions.backupPolicyId()); + pathParamsMap.put("id", getBackupPolicyPlanOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBackupPolicyPlan"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List address prefixes for a VPC. + * Update a backup policy plan. * - * This request lists address pool prefixes for a VPC. + * This request updates a backup policy plan with the information in a provided plan patch. The plan patch object is + * structured in the same way as a retrieved backup policy plan and can contains only the information to be updated. * - * @param listVpcAddressPrefixesOptions the {@link ListVpcAddressPrefixesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link AddressPrefixCollection} + * @param updateBackupPolicyPlanOptions the {@link UpdateBackupPolicyPlanOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlan} */ - public ServiceCall listVpcAddressPrefixes(ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcAddressPrefixesOptions, - "listVpcAddressPrefixesOptions cannot be null"); + public ServiceCall updateBackupPolicyPlan(UpdateBackupPolicyPlanOptions updateBackupPolicyPlanOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateBackupPolicyPlanOptions, + "updateBackupPolicyPlanOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", listVpcAddressPrefixesOptions.vpcId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcAddressPrefixes"); + pathParamsMap.put("backup_policy_id", updateBackupPolicyPlanOptions.backupPolicyId()); + pathParamsMap.put("id", updateBackupPolicyPlanOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBackupPolicyPlan"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateBackupPolicyPlanOptions.ifMatch() != null) { + builder.header("If-Match", updateBackupPolicyPlanOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpcAddressPrefixesOptions.start() != null) { - builder.query("start", String.valueOf(listVpcAddressPrefixesOptions.start())); - } - if (listVpcAddressPrefixesOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpcAddressPrefixesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBackupPolicyPlanOptions.backupPolicyPlanPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create an address prefix for a VPC. + * Delete a backup policy. * - * This request creates a new prefix from a prefix prototype object. The prototype object is structured in the same - * way as a retrieved prefix, and contains the information necessary to create the new prefix. + * This request deletes a backup policy. This operation cannot be reversed. * - * @param createVpcAddressPrefixOptions the {@link CreateVpcAddressPrefixOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link AddressPrefix} + * If the request is accepted, the backup policy `status` will be set to `deleting`. Once deletion processing + * completes, the backup policy will no longer be retrievable. + * + * @param deleteBackupPolicyOptions the {@link DeleteBackupPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicy} */ - public ServiceCall createVpcAddressPrefix(CreateVpcAddressPrefixOptions createVpcAddressPrefixOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcAddressPrefixOptions, - "createVpcAddressPrefixOptions cannot be null"); + public ServiceCall deleteBackupPolicy(DeleteBackupPolicyOptions deleteBackupPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBackupPolicyOptions, + "deleteBackupPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", createVpcAddressPrefixOptions.vpcId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcAddressPrefix"); + pathParamsMap.put("id", deleteBackupPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBackupPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (deleteBackupPolicyOptions.ifMatch() != null) { + builder.header("If-Match", deleteBackupPolicyOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("cidr", createVpcAddressPrefixOptions.cidr()); - contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcAddressPrefixOptions.zone())); - if (createVpcAddressPrefixOptions.isDefault() != null) { - contentJson.addProperty("is_default", createVpcAddressPrefixOptions.isDefault()); - } - if (createVpcAddressPrefixOptions.name() != null) { - contentJson.addProperty("name", createVpcAddressPrefixOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an address prefix. + * Retrieve a backup policy. * - * This request deletes a prefix. This operation cannot be reversed. The request will fail if any subnets use - * addresses from this prefix. + * This request retrieves a single backup policy specified by the identifier in the URL. * - * @param deleteVpcAddressPrefixOptions the {@link DeleteVpcAddressPrefixOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getBackupPolicyOptions the {@link GetBackupPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicy} */ - public ServiceCall deleteVpcAddressPrefix(DeleteVpcAddressPrefixOptions deleteVpcAddressPrefixOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcAddressPrefixOptions, - "deleteVpcAddressPrefixOptions cannot be null"); + public ServiceCall getBackupPolicy(GetBackupPolicyOptions getBackupPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBackupPolicyOptions, + "getBackupPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", deleteVpcAddressPrefixOptions.vpcId()); - pathParamsMap.put("id", deleteVpcAddressPrefixOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcAddressPrefix"); + pathParamsMap.put("id", getBackupPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBackupPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an address prefix. + * Update a backup policy. * - * This request retrieves a single prefix specified by the identifier in the URL. + * This request updates a backup policy with the information in a provided backup policy patch. The backup policy + * patch object is structured in the same way as a retrieved backup policy and contains only the information to be + * updated. * - * @param getVpcAddressPrefixOptions the {@link GetVpcAddressPrefixOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link AddressPrefix} + * @param updateBackupPolicyOptions the {@link UpdateBackupPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BackupPolicy} */ - public ServiceCall getVpcAddressPrefix(GetVpcAddressPrefixOptions getVpcAddressPrefixOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcAddressPrefixOptions, - "getVpcAddressPrefixOptions cannot be null"); + public ServiceCall updateBackupPolicy(UpdateBackupPolicyOptions updateBackupPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateBackupPolicyOptions, + "updateBackupPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", getVpcAddressPrefixOptions.vpcId()); - pathParamsMap.put("id", getVpcAddressPrefixOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcAddressPrefix"); + pathParamsMap.put("id", updateBackupPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBackupPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateBackupPolicyOptions.ifMatch() != null) { + builder.header("If-Match", updateBackupPolicyOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBackupPolicyOptions.backupPolicyPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an address prefix. + * List bare metal server profiles. * - * This request updates a prefix with the information in a provided prefix patch. The prefix patch object is - * structured in the same way as a retrieved prefix and contains only the information to be updated. + * This request lists [bare metal server + * profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare + * metal server profile specifies the performance characteristics and pricing model for a bare metal server. * - * @param updateVpcAddressPrefixOptions the {@link UpdateVpcAddressPrefixOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link AddressPrefix} + * @param listBareMetalServerProfilesOptions the {@link ListBareMetalServerProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerProfileCollection} */ - public ServiceCall updateVpcAddressPrefix(UpdateVpcAddressPrefixOptions updateVpcAddressPrefixOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcAddressPrefixOptions, - "updateVpcAddressPrefixOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", updateVpcAddressPrefixOptions.vpcId()); - pathParamsMap.put("id", updateVpcAddressPrefixOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcAddressPrefix"); + public ServiceCall listBareMetalServerProfiles(ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions) { + if (listBareMetalServerProfilesOptions == null) { + listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_server/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcAddressPrefixOptions.addressPrefixPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listBareMetalServerProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listBareMetalServerProfilesOptions.start())); + } + if (listBareMetalServerProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listBareMetalServerProfilesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List DNS resolution bindings for a VPC. + * List bare metal server profiles. * - * This request lists DNS resolution bindings for a VPC. A DNS resolution binding represents an association with - * another VPC for centralizing DNS name resolution. + * This request lists [bare metal server + * profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare + * metal server profile specifies the performance characteristics and pricing model for a bare metal server. * - * If the VPC specified by the identifier in the URL is a DNS hub VPC (has `dns.enable_hub` set to `true`) then there - * is one binding for each VPC bound to the hub VPC. The endpoint gateways in the bound VPCs can allow (using - * `allow_dns_resolution_binding`) the hub VPC to centralize resolution of their DNS names. + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerProfileCollection} + */ + public ServiceCall listBareMetalServerProfiles() { + return listBareMetalServerProfiles(null); + } + + /** + * Retrieve a bare metal server profile. * - * If the VPC specified by the identifier in the URL is not a DNS hub VPC, then there is at most one binding (to a hub - * VPC). The endpoint gateways in the VPC specified by the identifier in the URL can allow (using - * `allow_dns_resolution_binding`) its hub VPC to centralize resolution of their DNS names. + * This request retrieves a single bare metal server profile specified by the name in the URL. * - * To make use of centralized DNS resolution, a VPC bound to a DNS hub VPC must delegate DNS resolution to its hub VPC - * by setting `dns.resolver.type` to `delegate`. + * @param getBareMetalServerProfileOptions the {@link GetBareMetalServerProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerProfile} + */ + public ServiceCall getBareMetalServerProfile(GetBareMetalServerProfileOptions getBareMetalServerProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerProfileOptions, + "getBareMetalServerProfileOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("name", getBareMetalServerProfileOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_server/profiles/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerProfile"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List bare metal servers. * - * The bindings will be sorted by their `created_at` property values, with newest bindings first. Bindings with - * identical `created_at` property values will in turn be sorted by ascending `name` property values. + * This request lists bare metal servers in the region. * - * @param listVpcDnsResolutionBindingsOptions the {@link ListVpcDnsResolutionBindingsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBindingCollection} + * @param listBareMetalServersOptions the {@link ListBareMetalServersOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerCollection} */ - public ServiceCall listVpcDnsResolutionBindings(ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcDnsResolutionBindingsOptions, - "listVpcDnsResolutionBindingsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", listVpcDnsResolutionBindingsOptions.vpcId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcDnsResolutionBindings"); + public ServiceCall listBareMetalServers(ListBareMetalServersOptions listBareMetalServersOptions) { + if (listBareMetalServersOptions == null) { + listBareMetalServersOptions = new ListBareMetalServersOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServers"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpcDnsResolutionBindingsOptions.sort() != null) { - builder.query("sort", String.valueOf(listVpcDnsResolutionBindingsOptions.sort())); + if (listBareMetalServersOptions.start() != null) { + builder.query("start", String.valueOf(listBareMetalServersOptions.start())); } - if (listVpcDnsResolutionBindingsOptions.start() != null) { - builder.query("start", String.valueOf(listVpcDnsResolutionBindingsOptions.start())); + if (listBareMetalServersOptions.limit() != null) { + builder.query("limit", String.valueOf(listBareMetalServersOptions.limit())); } - if (listVpcDnsResolutionBindingsOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpcDnsResolutionBindingsOptions.limit())); + if (listBareMetalServersOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listBareMetalServersOptions.resourceGroupId())); } - if (listVpcDnsResolutionBindingsOptions.name() != null) { - builder.query("name", String.valueOf(listVpcDnsResolutionBindingsOptions.name())); + if (listBareMetalServersOptions.name() != null) { + builder.query("name", String.valueOf(listBareMetalServersOptions.name())); } - if (listVpcDnsResolutionBindingsOptions.vpcCrn() != null) { - builder.query("vpc.crn", String.valueOf(listVpcDnsResolutionBindingsOptions.vpcCrn())); + if (listBareMetalServersOptions.reservationId() != null) { + builder.query("reservation.id", String.valueOf(listBareMetalServersOptions.reservationId())); } - if (listVpcDnsResolutionBindingsOptions.vpcName() != null) { - builder.query("vpc.name", String.valueOf(listVpcDnsResolutionBindingsOptions.vpcName())); + if (listBareMetalServersOptions.reservationCrn() != null) { + builder.query("reservation.crn", String.valueOf(listBareMetalServersOptions.reservationCrn())); } - if (listVpcDnsResolutionBindingsOptions.accountId() != null) { - builder.query("account.id", String.valueOf(listVpcDnsResolutionBindingsOptions.accountId())); + if (listBareMetalServersOptions.reservationName() != null) { + builder.query("reservation.name", String.valueOf(listBareMetalServersOptions.reservationName())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listBareMetalServersOptions.vpcId() != null) { + builder.query("vpc.id", String.valueOf(listBareMetalServersOptions.vpcId())); + } + if (listBareMetalServersOptions.vpcCrn() != null) { + builder.query("vpc.crn", String.valueOf(listBareMetalServersOptions.vpcCrn())); + } + if (listBareMetalServersOptions.vpcName() != null) { + builder.query("vpc.name", String.valueOf(listBareMetalServersOptions.vpcName())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a DNS resolution binding. + * List bare metal servers. * - * This request creates a new DNS resolution binding from a DNS resolution binding prototype object. The prototype - * object is structured in the same way as a retrieved DNS resolution binding, and contains the information necessary - * to create the new DNS resolution binding. + * This request lists bare metal servers in the region. * - * For this request to succeed: - * - The VPC specified by the identifier in the URL must not already have a DNS resolution - * binding - * - The VPC specified by the identifier in the URL must have `dns.enable_hub` set to `false` - * - The updated DNS sharing connected topology must not contain more than one endpoint - * gateway with `allow_dns_resolution_binding` set to `true` targeting the same service. + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerCollection} + */ + public ServiceCall listBareMetalServers() { + return listBareMetalServers(null); + } + + /** + * Create a bare metal server. * - * See [About DNS sharing for VPE gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) for more information. + * This request provisions a new bare metal server from a prototype object. The prototype object is structured in the + * same way as a retrieved bare metal server, and contains the information necessary to provision the new bare metal + * server. The bare metal server is automatically started. * - * @param createVpcDnsResolutionBindingOptions the {@link CreateVpcDnsResolutionBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBinding} + * For this request to succeed, the properties in the request must adhere to the source image's `allowed_use` + * property. + * + * @param createBareMetalServerOptions the {@link CreateBareMetalServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServer} */ - public ServiceCall createVpcDnsResolutionBinding(CreateVpcDnsResolutionBindingOptions createVpcDnsResolutionBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcDnsResolutionBindingOptions, - "createVpcDnsResolutionBindingOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", createVpcDnsResolutionBindingOptions.vpcId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcDnsResolutionBinding"); + public ServiceCall createBareMetalServer(CreateBareMetalServerOptions createBareMetalServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createBareMetalServerOptions, + "createBareMetalServerOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBareMetalServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcDnsResolutionBindingOptions.vpc())); - if (createVpcDnsResolutionBindingOptions.name() != null) { - contentJson.addProperty("name", createVpcDnsResolutionBindingOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createBareMetalServerOptions.bareMetalServerPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a DNS resolution binding. - * - * This request deletes a DNS resolution binding. This operation cannot be reversed. + * Create a console access token for a bare metal server. * - * For this request to succeed, the VPC specified by the identifier in the URL must not have - * `dns.resolver.type` set to `delegated`. + * This request creates a new single-use console access token for a bare metal server. All console configuration is + * provided at token create time, and the token is subsequently used in the `access_token` query parameter for the + * WebSocket request. The access token is only valid for a short period of time, and a maximum of one token is valid + * for a given bare metal server at a time. For this request to succeed, the server must have a `status` of + * `stopped`, `starting`, or `running`. * - * @param deleteVpcDnsResolutionBindingOptions the {@link DeleteVpcDnsResolutionBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBinding} + * @param createBareMetalServerConsoleAccessTokenOptions the {@link CreateBareMetalServerConsoleAccessTokenOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerConsoleAccessToken} */ - public ServiceCall deleteVpcDnsResolutionBinding(DeleteVpcDnsResolutionBindingOptions deleteVpcDnsResolutionBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcDnsResolutionBindingOptions, - "deleteVpcDnsResolutionBindingOptions cannot be null"); + public ServiceCall createBareMetalServerConsoleAccessToken(CreateBareMetalServerConsoleAccessTokenOptions createBareMetalServerConsoleAccessTokenOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createBareMetalServerConsoleAccessTokenOptions, + "createBareMetalServerConsoleAccessTokenOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", deleteVpcDnsResolutionBindingOptions.vpcId()); - pathParamsMap.put("id", deleteVpcDnsResolutionBindingOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcDnsResolutionBinding"); + pathParamsMap.put("bare_metal_server_id", createBareMetalServerConsoleAccessTokenOptions.bareMetalServerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/console_access_token", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBareMetalServerConsoleAccessToken"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("console_type", createBareMetalServerConsoleAccessTokenOptions.consoleType()); + if (createBareMetalServerConsoleAccessTokenOptions.force() != null) { + contentJson.addProperty("force", createBareMetalServerConsoleAccessTokenOptions.force()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a DNS resolution binding. + * List disks on a bare metal server. * - * This request retrieves a single DNS resolution binding specified by the identifier in the URL. + * This request lists disks on a bare metal server. A disk is a block device that is locally attached to the + * physical server. By default, the listed disks are sorted by their `created_at` property values, with the newest + * disk first. * - * @param getVpcDnsResolutionBindingOptions the {@link GetVpcDnsResolutionBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBinding} + * @param listBareMetalServerDisksOptions the {@link ListBareMetalServerDisksOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerDiskCollection} */ - public ServiceCall getVpcDnsResolutionBinding(GetVpcDnsResolutionBindingOptions getVpcDnsResolutionBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcDnsResolutionBindingOptions, - "getVpcDnsResolutionBindingOptions cannot be null"); + public ServiceCall listBareMetalServerDisks(ListBareMetalServerDisksOptions listBareMetalServerDisksOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerDisksOptions, + "listBareMetalServerDisksOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", getVpcDnsResolutionBindingOptions.vpcId()); - pathParamsMap.put("id", getVpcDnsResolutionBindingOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcDnsResolutionBinding"); + pathParamsMap.put("bare_metal_server_id", listBareMetalServerDisksOptions.bareMetalServerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/disks", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerDisks"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a DNS resolution binding. + * Retrieve a bare metal server disk. * - * This request updates a DNS resolution binding with the information in a provided DNS resolution binding patch. The - * DNS resolution binding patch object is structured in the same way as a retrieved DNS resolution binding and - * contains only the information to be updated. + * This request retrieves a single disk specified by the identifier in the URL. * - * @param updateVpcDnsResolutionBindingOptions the {@link UpdateVpcDnsResolutionBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBinding} + * @param getBareMetalServerDiskOptions the {@link GetBareMetalServerDiskOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerDisk} */ - public ServiceCall updateVpcDnsResolutionBinding(UpdateVpcDnsResolutionBindingOptions updateVpcDnsResolutionBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcDnsResolutionBindingOptions, - "updateVpcDnsResolutionBindingOptions cannot be null"); + public ServiceCall getBareMetalServerDisk(GetBareMetalServerDiskOptions getBareMetalServerDiskOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerDiskOptions, + "getBareMetalServerDiskOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", updateVpcDnsResolutionBindingOptions.vpcId()); - pathParamsMap.put("id", updateVpcDnsResolutionBindingOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcDnsResolutionBinding"); + pathParamsMap.put("bare_metal_server_id", getBareMetalServerDiskOptions.bareMetalServerId()); + pathParamsMap.put("id", getBareMetalServerDiskOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/disks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerDisk"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcDnsResolutionBindingOptions.vpcdnsResolutionBindingPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List routes in a VPC's default routing table. + * Update a bare metal server disk. * - * This request lists routes in the VPC's default routing table. Each route is zone-specific and directs any packets - * matching its destination CIDR block to a `next_hop` IP address. The most specific route matching a packet's - * destination will be used. If multiple equally-specific routes exist, traffic will be distributed across them. + * This request updates the bare metal server disk with the information in a provided patch. * - * @param listVpcRoutesOptions the {@link ListVpcRoutesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RouteCollectionVPCContext} - * @deprecated this method is deprecated and may be removed in a future release + * @param updateBareMetalServerDiskOptions the {@link UpdateBareMetalServerDiskOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerDisk} */ - @Deprecated - public ServiceCall listVpcRoutes(ListVpcRoutesOptions listVpcRoutesOptions) { - LOGGER.warning("A deprecated operation has been invoked: listVpcRoutes"); - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcRoutesOptions, - "listVpcRoutesOptions cannot be null"); + public ServiceCall updateBareMetalServerDisk(UpdateBareMetalServerDiskOptions updateBareMetalServerDiskOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateBareMetalServerDiskOptions, + "updateBareMetalServerDiskOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", listVpcRoutesOptions.vpcId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcRoutes"); + pathParamsMap.put("bare_metal_server_id", updateBareMetalServerDiskOptions.bareMetalServerId()); + pathParamsMap.put("id", updateBareMetalServerDiskOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/disks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBareMetalServerDisk"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpcRoutesOptions.zoneName() != null) { - builder.query("zone.name", String.valueOf(listVpcRoutesOptions.zoneName())); - } - if (listVpcRoutesOptions.start() != null) { - builder.query("start", String.valueOf(listVpcRoutesOptions.start())); - } - if (listVpcRoutesOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpcRoutesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBareMetalServerDiskOptions.bareMetalServerDiskPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a route in a VPC's default routing table. + * List network attachments on a bare metal server. * - * This request creates a new route in the VPC's default routing table. The route prototype object is structured in - * the same way as a retrieved route, and contains the information necessary to create the new route. The request will - * fail if the new route will cause a loop. + * This request lists network attachments on a bare metal server. A bare metal server network attachment is an + * abstract representation of a network device and attaches a bare metal server to a single subnet. Each network + * interface on a bare metal server can attach to any subnet in the zone, including subnets that are already attached + * to the bare metal server. * - * @param createVpcRouteOptions the {@link CreateVpcRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Route} - * @deprecated this method is deprecated and may be removed in a future release + * The network attachments will be sorted by their `created_at` property values, with newest network attachments + * first. Network attachments with identical `created_at` property values will in turn be sorted by ascending `name` + * property values. + * + * @param listBareMetalServerNetworkAttachmentsOptions the {@link ListBareMetalServerNetworkAttachmentsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkAttachmentCollection} */ - @Deprecated - public ServiceCall createVpcRoute(CreateVpcRouteOptions createVpcRouteOptions) { - LOGGER.warning("A deprecated operation has been invoked: createVpcRoute"); - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcRouteOptions, - "createVpcRouteOptions cannot be null"); + public ServiceCall listBareMetalServerNetworkAttachments(ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkAttachmentsOptions, + "listBareMetalServerNetworkAttachmentsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", createVpcRouteOptions.vpcId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcRoute"); + pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkAttachmentsOptions.bareMetalServerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkAttachments"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("destination", createVpcRouteOptions.destination()); - contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRouteOptions.zone())); - if (createVpcRouteOptions.action() != null) { - contentJson.addProperty("action", createVpcRouteOptions.action()); - } - if (createVpcRouteOptions.advertise() != null) { - contentJson.addProperty("advertise", createVpcRouteOptions.advertise()); - } - if (createVpcRouteOptions.name() != null) { - contentJson.addProperty("name", createVpcRouteOptions.name()); - } - if (createVpcRouteOptions.nextHop() != null) { - contentJson.add("next_hop", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRouteOptions.nextHop())); + if (listBareMetalServerNetworkAttachmentsOptions.start() != null) { + builder.query("start", String.valueOf(listBareMetalServerNetworkAttachmentsOptions.start())); } - if (createVpcRouteOptions.priority() != null) { - contentJson.addProperty("priority", createVpcRouteOptions.priority()); + if (listBareMetalServerNetworkAttachmentsOptions.limit() != null) { + builder.query("limit", String.valueOf(listBareMetalServerNetworkAttachmentsOptions.limit())); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a VPC route. + * Create a network attachment on a bare metal server. * - * This request deletes a route. This operation cannot be reversed. + * This request creates a new bare metal server network attachment from a bare metal server network attachment + * prototype object. The prototype object is structured in the same way as a retrieved bare metal server network + * attachment, and contains the information necessary to create the new bare metal server network attachment. * - * @param deleteVpcRouteOptions the {@link DeleteVpcRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result - * @deprecated this method is deprecated and may be removed in a future release + * @param createBareMetalServerNetworkAttachmentOptions the {@link CreateBareMetalServerNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkAttachment} */ - @Deprecated - public ServiceCall deleteVpcRoute(DeleteVpcRouteOptions deleteVpcRouteOptions) { - LOGGER.warning("A deprecated operation has been invoked: deleteVpcRoute"); - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcRouteOptions, - "deleteVpcRouteOptions cannot be null"); + public ServiceCall createBareMetalServerNetworkAttachment(CreateBareMetalServerNetworkAttachmentOptions createBareMetalServerNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createBareMetalServerNetworkAttachmentOptions, + "createBareMetalServerNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", deleteVpcRouteOptions.vpcId()); - pathParamsMap.put("id", deleteVpcRouteOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcRoute"); + pathParamsMap.put("bare_metal_server_id", createBareMetalServerNetworkAttachmentOptions.bareMetalServerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBareMetalServerNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createBareMetalServerNetworkAttachmentOptions.bareMetalServerNetworkAttachmentPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a VPC route. + * Delete a bare metal server network attachment. * - * This request retrieves a single route specified by the identifier in the URL. + * This request deletes a bare metal server network attachment. This operation cannot be reversed. Any floating IPs + * associated with the bare metal server network attachment are implicitly disassociated. * - * @param getVpcRouteOptions the {@link GetVpcRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Route} - * @deprecated this method is deprecated and may be removed in a future release + * The bare metal server's primary network attachment cannot be deleted. + * + * @param deleteBareMetalServerNetworkAttachmentOptions the {@link DeleteBareMetalServerNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - @Deprecated - public ServiceCall getVpcRoute(GetVpcRouteOptions getVpcRouteOptions) { - LOGGER.warning("A deprecated operation has been invoked: getVpcRoute"); - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcRouteOptions, - "getVpcRouteOptions cannot be null"); + public ServiceCall deleteBareMetalServerNetworkAttachment(DeleteBareMetalServerNetworkAttachmentOptions deleteBareMetalServerNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBareMetalServerNetworkAttachmentOptions, + "deleteBareMetalServerNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", getVpcRouteOptions.vpcId()); - pathParamsMap.put("id", getVpcRouteOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcRoute"); + pathParamsMap.put("bare_metal_server_id", deleteBareMetalServerNetworkAttachmentOptions.bareMetalServerId()); + pathParamsMap.put("id", deleteBareMetalServerNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBareMetalServerNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update a VPC route. + * Retrieve a bare metal server network attachment. * - * This request updates a route with the information in a provided route patch. The route patch object is structured - * in the same way as a retrieved route and contains only the information to be updated. + * This request retrieves a single bare metal server network attachment specified by the identifier in the URL. * - * @param updateVpcRouteOptions the {@link UpdateVpcRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Route} - * @deprecated this method is deprecated and may be removed in a future release + * @param getBareMetalServerNetworkAttachmentOptions the {@link GetBareMetalServerNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkAttachment} */ - @Deprecated - public ServiceCall updateVpcRoute(UpdateVpcRouteOptions updateVpcRouteOptions) { - LOGGER.warning("A deprecated operation has been invoked: updateVpcRoute"); - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcRouteOptions, - "updateVpcRouteOptions cannot be null"); + public ServiceCall getBareMetalServerNetworkAttachment(GetBareMetalServerNetworkAttachmentOptions getBareMetalServerNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkAttachmentOptions, + "getBareMetalServerNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", updateVpcRouteOptions.vpcId()); - pathParamsMap.put("id", updateVpcRouteOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcRoute"); + pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkAttachmentOptions.bareMetalServerId()); + pathParamsMap.put("id", getBareMetalServerNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcRouteOptions.routePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List routing tables for a VPC. + * Update a bare metal server network attachment. * - * This request lists routing tables for a VPC. Each subnet in a VPC is associated with a routing table, which - * controls delivery of packets sent on that subnet according to the action of the most specific matching route in the - * table. If multiple equally-specific routes exist, traffic will be distributed across them. If no routes match, - * delivery will be controlled by the system's built-in routes. + * This request updates a bare metal server network attachment with the information provided in a bare metal server + * network attachment patch object. The bare metal server network attachment patch object is structured in the same + * way as a retrieved bare metal server network attachment and contains only the information to be updated. * - * @param listVpcRoutingTablesOptions the {@link ListVpcRoutingTablesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RoutingTableCollection} + * @param updateBareMetalServerNetworkAttachmentOptions the {@link UpdateBareMetalServerNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkAttachment} */ - public ServiceCall listVpcRoutingTables(ListVpcRoutingTablesOptions listVpcRoutingTablesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcRoutingTablesOptions, - "listVpcRoutingTablesOptions cannot be null"); + public ServiceCall updateBareMetalServerNetworkAttachment(UpdateBareMetalServerNetworkAttachmentOptions updateBareMetalServerNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateBareMetalServerNetworkAttachmentOptions, + "updateBareMetalServerNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", listVpcRoutingTablesOptions.vpcId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcRoutingTables"); + pathParamsMap.put("bare_metal_server_id", updateBareMetalServerNetworkAttachmentOptions.bareMetalServerId()); + pathParamsMap.put("id", updateBareMetalServerNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBareMetalServerNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpcRoutingTablesOptions.start() != null) { - builder.query("start", String.valueOf(listVpcRoutingTablesOptions.start())); - } - if (listVpcRoutingTablesOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpcRoutingTablesOptions.limit())); - } - if (listVpcRoutingTablesOptions.isDefault() != null) { - builder.query("is_default", String.valueOf(listVpcRoutingTablesOptions.isDefault())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBareMetalServerNetworkAttachmentOptions.bareMetalServerNetworkAttachmentPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a routing table for a VPC. + * List network interfaces on a bare metal server. * - * This request creates a routing table from a routing table prototype object. The prototype object is structured in - * the same way as a retrieved routing table, and contains the information necessary to create the new routing table. + * This request lists network interfaces on a bare metal server. A bare metal server network interface is an abstract + * representation of a network device and attaches a bare metal server to a single subnet. Each network interface on a + * bare metal server can attach to any subnet in the zone, including subnets that are already attached to the bare + * metal server. * - * At present, the routing table's `resource_group` will be inherited from its VPC, but may be specifiable in the - * future. + * If this bare metal server has network attachments, each returned network interface is a [read-only + * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding + * network attachment and its attached virtual network interface. * - * @param createVpcRoutingTableOptions the {@link CreateVpcRoutingTableOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RoutingTable} + * @param listBareMetalServerNetworkInterfacesOptions the {@link ListBareMetalServerNetworkInterfacesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkInterfaceCollection} */ - public ServiceCall createVpcRoutingTable(CreateVpcRoutingTableOptions createVpcRoutingTableOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcRoutingTableOptions, - "createVpcRoutingTableOptions cannot be null"); + public ServiceCall listBareMetalServerNetworkInterfaces(ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkInterfacesOptions, + "listBareMetalServerNetworkInterfacesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", createVpcRoutingTableOptions.vpcId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcRoutingTable"); + pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkInterfacesOptions.bareMetalServerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkInterfaces"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - if (createVpcRoutingTableOptions.acceptRoutesFrom() != null) { - contentJson.add("accept_routes_from", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableOptions.acceptRoutesFrom())); - } - if (createVpcRoutingTableOptions.advertiseRoutesTo() != null) { - contentJson.add("advertise_routes_to", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableOptions.advertiseRoutesTo())); - } - if (createVpcRoutingTableOptions.name() != null) { - contentJson.addProperty("name", createVpcRoutingTableOptions.name()); - } - if (createVpcRoutingTableOptions.routeDirectLinkIngress() != null) { - contentJson.addProperty("route_direct_link_ingress", createVpcRoutingTableOptions.routeDirectLinkIngress()); - } - if (createVpcRoutingTableOptions.routeInternetIngress() != null) { - contentJson.addProperty("route_internet_ingress", createVpcRoutingTableOptions.routeInternetIngress()); - } - if (createVpcRoutingTableOptions.routeTransitGatewayIngress() != null) { - contentJson.addProperty("route_transit_gateway_ingress", createVpcRoutingTableOptions.routeTransitGatewayIngress()); - } - if (createVpcRoutingTableOptions.routeVpcZoneIngress() != null) { - contentJson.addProperty("route_vpc_zone_ingress", createVpcRoutingTableOptions.routeVpcZoneIngress()); + if (listBareMetalServerNetworkInterfacesOptions.start() != null) { + builder.query("start", String.valueOf(listBareMetalServerNetworkInterfacesOptions.start())); } - if (createVpcRoutingTableOptions.routes() != null) { - contentJson.add("routes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableOptions.routes())); + if (listBareMetalServerNetworkInterfacesOptions.limit() != null) { + builder.query("limit", String.valueOf(listBareMetalServerNetworkInterfacesOptions.limit())); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a VPC routing table. + * Create a network interface on a bare metal server. * - * This request deletes a routing table. A routing table cannot be deleted if it is associated with any subnets in - * the VPC. Additionally, a VPC's default routing table cannot be deleted. This operation cannot be reversed. + * This request creates a new bare metal server network interface from a bare metal server network interface prototype + * object. The prototype object is structured in the same way as a retrieved bare metal server network interface, and + * contains the information necessary to create the new bare metal server network interface. Any subnet in the bare + * metal server's VPC may be specified, even if it is already attached to another bare metal server network interface. + * Addresses on the bare metal server network interface must be within the specified subnet's CIDR blocks. * - * @param deleteVpcRoutingTableOptions the {@link DeleteVpcRoutingTableOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * If this bare metal server has network attachments, each network interface is a [read-only + * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding + * network attachment and its attached virtual network interface, and new network interfaces are not allowed to be + * created. + * + * @param createBareMetalServerNetworkInterfaceOptions the {@link CreateBareMetalServerNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkInterface} */ - public ServiceCall deleteVpcRoutingTable(DeleteVpcRoutingTableOptions deleteVpcRoutingTableOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcRoutingTableOptions, - "deleteVpcRoutingTableOptions cannot be null"); + public ServiceCall createBareMetalServerNetworkInterface(CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createBareMetalServerNetworkInterfaceOptions, + "createBareMetalServerNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", deleteVpcRoutingTableOptions.vpcId()); - pathParamsMap.put("id", deleteVpcRoutingTableOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcRoutingTable"); + pathParamsMap.put("bare_metal_server_id", createBareMetalServerNetworkInterfaceOptions.bareMetalServerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBareMetalServerNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - if (deleteVpcRoutingTableOptions.ifMatch() != null) { - builder.header("If-Match", deleteVpcRoutingTableOptions.ifMatch()); - } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createBareMetalServerNetworkInterfaceOptions.bareMetalServerNetworkInterfacePrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a VPC routing table. + * Delete a bare metal server network interface. * - * This request retrieves a single routing table specified by the identifier in the URL. + * This request deletes a bare metal server network interface. This operation cannot be reversed. Any floating IPs + * associated with the bare metal server network interface are implicitly disassociated. The primary bare metal + * server network interface is not allowed to be deleted. * - * @param getVpcRoutingTableOptions the {@link GetVpcRoutingTableOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RoutingTable} + * If this bare metal server has network attachments, this network interface is a [read-only + * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding + * network attachment and its attached virtual network interface, and is not allowed to be deleted. + * + * @param deleteBareMetalServerNetworkInterfaceOptions the {@link DeleteBareMetalServerNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getVpcRoutingTable(GetVpcRoutingTableOptions getVpcRoutingTableOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcRoutingTableOptions, - "getVpcRoutingTableOptions cannot be null"); + public ServiceCall deleteBareMetalServerNetworkInterface(DeleteBareMetalServerNetworkInterfaceOptions deleteBareMetalServerNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBareMetalServerNetworkInterfaceOptions, + "deleteBareMetalServerNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", getVpcRoutingTableOptions.vpcId()); - pathParamsMap.put("id", getVpcRoutingTableOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcRoutingTable"); + pathParamsMap.put("bare_metal_server_id", deleteBareMetalServerNetworkInterfaceOptions.bareMetalServerId()); + pathParamsMap.put("id", deleteBareMetalServerNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBareMetalServerNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update a VPC routing table. + * Retrieve a bare metal server network interface. * - * This request updates a routing table with the information in a provided routing table patch. The patch object is - * structured in the same way as a retrieved table and contains only the information to be updated. + * This request retrieves a single bare metal server network interface specified by the identifier in the URL. * - * @param updateVpcRoutingTableOptions the {@link UpdateVpcRoutingTableOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RoutingTable} + * If this bare metal server has network attachments, the retrieved network interface is a [read-only + * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding + * network attachment and its attached virtual network interface. + * + * @param getBareMetalServerNetworkInterfaceOptions the {@link GetBareMetalServerNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkInterface} */ - public ServiceCall updateVpcRoutingTable(UpdateVpcRoutingTableOptions updateVpcRoutingTableOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcRoutingTableOptions, - "updateVpcRoutingTableOptions cannot be null"); + public ServiceCall getBareMetalServerNetworkInterface(GetBareMetalServerNetworkInterfaceOptions getBareMetalServerNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkInterfaceOptions, + "getBareMetalServerNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", updateVpcRoutingTableOptions.vpcId()); - pathParamsMap.put("id", updateVpcRoutingTableOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcRoutingTable"); + pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkInterfaceOptions.bareMetalServerId()); + pathParamsMap.put("id", getBareMetalServerNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateVpcRoutingTableOptions.ifMatch() != null) { - builder.header("If-Match", updateVpcRoutingTableOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcRoutingTableOptions.routingTablePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List routes in a VPC routing table. + * Update a bare metal server network interface. * - * This request lists routes in a VPC routing table. If subnets are associated with this routing table, delivery of - * packets sent on a subnet is performed according to the action of the most specific matching route in the table - * (provided the subnet and route are in the same zone). If multiple equally-specific routes exist, the route with the - * highest priority will be used. If two matching routes have the same destination and priority, traffic will be - * distributed between them. If no routes match, delivery will be controlled by the system's built-in routes. + * This request updates a bare metal server network interface with the information provided in a bare metal server + * network interface patch object. The bare metal server network interface patch object is structured in the same way + * as a retrieved bare metal server network interface and needs to contain only the information to be updated. * - * @param listVpcRoutingTableRoutesOptions the {@link ListVpcRoutingTableRoutesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RouteCollection} + * If this bare metal server has network attachments, this network interface is a [read-only + * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding + * network attachment and its attached virtual network interface, and is not allowed to be updated. + * + * @param updateBareMetalServerNetworkInterfaceOptions the {@link UpdateBareMetalServerNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkInterface} */ - public ServiceCall listVpcRoutingTableRoutes(ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcRoutingTableRoutesOptions, - "listVpcRoutingTableRoutesOptions cannot be null"); + public ServiceCall updateBareMetalServerNetworkInterface(UpdateBareMetalServerNetworkInterfaceOptions updateBareMetalServerNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateBareMetalServerNetworkInterfaceOptions, + "updateBareMetalServerNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", listVpcRoutingTableRoutesOptions.vpcId()); - pathParamsMap.put("routing_table_id", listVpcRoutingTableRoutesOptions.routingTableId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcRoutingTableRoutes"); + pathParamsMap.put("bare_metal_server_id", updateBareMetalServerNetworkInterfaceOptions.bareMetalServerId()); + pathParamsMap.put("id", updateBareMetalServerNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBareMetalServerNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpcRoutingTableRoutesOptions.start() != null) { - builder.query("start", String.valueOf(listVpcRoutingTableRoutesOptions.start())); - } - if (listVpcRoutingTableRoutesOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpcRoutingTableRoutesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBareMetalServerNetworkInterfaceOptions.bareMetalServerNetworkInterfacePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a route in a VPC routing table. + * List floating IPs associated with a bare metal server network interface. * - * This request creates a new VPC route from a VPC route prototype object. The prototype object is structured in the - * same way as a retrieved VPC route and contains the information necessary to create the route. + * This request lists floating IPs associated with a bare metal server network interface. * - * @param createVpcRoutingTableRouteOptions the {@link CreateVpcRoutingTableRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Route} + * @param listBareMetalServerNetworkInterfaceFloatingIpsOptions the {@link ListBareMetalServerNetworkInterfaceFloatingIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIPUnpaginatedCollection} */ - public ServiceCall createVpcRoutingTableRoute(CreateVpcRoutingTableRouteOptions createVpcRoutingTableRouteOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcRoutingTableRouteOptions, - "createVpcRoutingTableRouteOptions cannot be null"); + public ServiceCall listBareMetalServerNetworkInterfaceFloatingIps(ListBareMetalServerNetworkInterfaceFloatingIpsOptions listBareMetalServerNetworkInterfaceFloatingIpsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkInterfaceFloatingIpsOptions, + "listBareMetalServerNetworkInterfaceFloatingIpsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", createVpcRoutingTableRouteOptions.vpcId()); - pathParamsMap.put("routing_table_id", createVpcRoutingTableRouteOptions.routingTableId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcRoutingTableRoute"); + pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkInterfaceFloatingIpsOptions.bareMetalServerId()); + pathParamsMap.put("network_interface_id", listBareMetalServerNetworkInterfaceFloatingIpsOptions.networkInterfaceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkInterfaceFloatingIps"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("destination", createVpcRoutingTableRouteOptions.destination()); - contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableRouteOptions.zone())); - if (createVpcRoutingTableRouteOptions.action() != null) { - contentJson.addProperty("action", createVpcRoutingTableRouteOptions.action()); - } - if (createVpcRoutingTableRouteOptions.advertise() != null) { - contentJson.addProperty("advertise", createVpcRoutingTableRouteOptions.advertise()); - } - if (createVpcRoutingTableRouteOptions.name() != null) { - contentJson.addProperty("name", createVpcRoutingTableRouteOptions.name()); - } - if (createVpcRoutingTableRouteOptions.nextHop() != null) { - contentJson.add("next_hop", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableRouteOptions.nextHop())); - } - if (createVpcRoutingTableRouteOptions.priority() != null) { - contentJson.addProperty("priority", createVpcRoutingTableRouteOptions.priority()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a VPC routing table route. + * Disassociate a floating IP from a bare metal server network interface. * - * This request deletes a VPC route. This operation cannot be reversed. Only VPC routes with an `origin` of `user` are - * allowed to be deleted. + * This request disassociates the specified floating IP from the specified bare metal server network interface. * - * @param deleteVpcRoutingTableRouteOptions the {@link DeleteVpcRoutingTableRouteOptions} containing the options for the call + * @param removeBareMetalServerNetworkInterfaceFloatingIpOptions the {@link RemoveBareMetalServerNetworkInterfaceFloatingIpOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteVpcRoutingTableRoute(DeleteVpcRoutingTableRouteOptions deleteVpcRoutingTableRouteOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcRoutingTableRouteOptions, - "deleteVpcRoutingTableRouteOptions cannot be null"); + public ServiceCall removeBareMetalServerNetworkInterfaceFloatingIp(RemoveBareMetalServerNetworkInterfaceFloatingIpOptions removeBareMetalServerNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(removeBareMetalServerNetworkInterfaceFloatingIpOptions, + "removeBareMetalServerNetworkInterfaceFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", deleteVpcRoutingTableRouteOptions.vpcId()); - pathParamsMap.put("routing_table_id", deleteVpcRoutingTableRouteOptions.routingTableId()); - pathParamsMap.put("id", deleteVpcRoutingTableRouteOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcRoutingTableRoute"); + pathParamsMap.put("bare_metal_server_id", removeBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId()); + pathParamsMap.put("network_interface_id", removeBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId()); + pathParamsMap.put("id", removeBareMetalServerNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeBareMetalServerNetworkInterfaceFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -1928,175 +1923,147 @@ public ServiceCall deleteVpcRoutingTableRoute(DeleteVpcRoutingTableRouteOp } /** - * Retrieve a VPC routing table route. + * Retrieve associated floating IP. * - * This request retrieves a single VPC route specified by the identifier in the URL path. + * This request retrieves a specified floating IP if it is associated with the bare metal server network interface + * specified in the URL. * - * @param getVpcRoutingTableRouteOptions the {@link GetVpcRoutingTableRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Route} + * @param getBareMetalServerNetworkInterfaceFloatingIpOptions the {@link GetBareMetalServerNetworkInterfaceFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIP} */ - public ServiceCall getVpcRoutingTableRoute(GetVpcRoutingTableRouteOptions getVpcRoutingTableRouteOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcRoutingTableRouteOptions, - "getVpcRoutingTableRouteOptions cannot be null"); + public ServiceCall getBareMetalServerNetworkInterfaceFloatingIp(GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkInterfaceFloatingIpOptions, + "getBareMetalServerNetworkInterfaceFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", getVpcRoutingTableRouteOptions.vpcId()); - pathParamsMap.put("routing_table_id", getVpcRoutingTableRouteOptions.routingTableId()); - pathParamsMap.put("id", getVpcRoutingTableRouteOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcRoutingTableRoute"); + pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId()); + pathParamsMap.put("network_interface_id", getBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId()); + pathParamsMap.put("id", getBareMetalServerNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkInterfaceFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a VPC routing table route. + * Associate a floating IP with a bare metal server network interface. * - * This request updates a VPC route with the information provided in a route patch object. The patch object is - * structured in the same way as a retrieved VPC route and needs to contain only the information to be updated. Only - * VPC routes with an `origin` of `user` are allowed to be updated. + * This request associates the specified floating IP with the specified bare metal server network interface. If + * `enable_infrastructure_nat` is `false`, this adds the IP to any existing associations. If + * `enable_infrastructure_nat` is `true`, this replaces any existing association. * - * @param updateVpcRoutingTableRouteOptions the {@link UpdateVpcRoutingTableRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Route} + * The existing floating IP must: + * - not be required by another resource, such as a public gateway + * - be in the same `zone` as the bare metal server + * + * A request body is not required, and if provided, is ignored. + * + * @param addBareMetalServerNetworkInterfaceFloatingIpOptions the {@link AddBareMetalServerNetworkInterfaceFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIP} */ - public ServiceCall updateVpcRoutingTableRoute(UpdateVpcRoutingTableRouteOptions updateVpcRoutingTableRouteOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcRoutingTableRouteOptions, - "updateVpcRoutingTableRouteOptions cannot be null"); + public ServiceCall addBareMetalServerNetworkInterfaceFloatingIp(AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(addBareMetalServerNetworkInterfaceFloatingIpOptions, + "addBareMetalServerNetworkInterfaceFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpc_id", updateVpcRoutingTableRouteOptions.vpcId()); - pathParamsMap.put("routing_table_id", updateVpcRoutingTableRouteOptions.routingTableId()); - pathParamsMap.put("id", updateVpcRoutingTableRouteOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcRoutingTableRoute"); + pathParamsMap.put("bare_metal_server_id", addBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId()); + pathParamsMap.put("network_interface_id", addBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId()); + pathParamsMap.put("id", addBareMetalServerNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addBareMetalServerNetworkInterfaceFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcRoutingTableRouteOptions.routePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List subnets. + * List the primary reserved IP for a bare metal server network interface. * - * This request lists subnets in the region. Subnets are contiguous ranges of IP addresses specified in CIDR block - * notation. Each subnet is within a particular zone and cannot span multiple zones or regions. + * This request lists the primary reserved IP for a bare metal server network interface. * - * @param listSubnetsOptions the {@link ListSubnetsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SubnetCollection} + * @param listBareMetalServerNetworkInterfaceIpsOptions the {@link ListBareMetalServerNetworkInterfaceIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionBareMetalServerNetworkInterfaceContext} + * @deprecated this method is deprecated and may be removed in a future release */ - public ServiceCall listSubnets(ListSubnetsOptions listSubnetsOptions) { - if (listSubnetsOptions == null) { - listSubnetsOptions = new ListSubnetsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSubnets"); + @Deprecated + public ServiceCall listBareMetalServerNetworkInterfaceIps(ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptions) { + LOGGER.warning("A deprecated operation has been invoked: listBareMetalServerNetworkInterfaceIps"); + com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkInterfaceIpsOptions, + "listBareMetalServerNetworkInterfaceIpsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkInterfaceIpsOptions.bareMetalServerId()); + pathParamsMap.put("network_interface_id", listBareMetalServerNetworkInterfaceIpsOptions.networkInterfaceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkInterfaceIps"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listSubnetsOptions.start() != null) { - builder.query("start", String.valueOf(listSubnetsOptions.start())); - } - if (listSubnetsOptions.limit() != null) { - builder.query("limit", String.valueOf(listSubnetsOptions.limit())); - } - if (listSubnetsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listSubnetsOptions.resourceGroupId())); - } - if (listSubnetsOptions.zoneName() != null) { - builder.query("zone.name", String.valueOf(listSubnetsOptions.zoneName())); - } - if (listSubnetsOptions.vpcId() != null) { - builder.query("vpc.id", String.valueOf(listSubnetsOptions.vpcId())); - } - if (listSubnetsOptions.vpcCrn() != null) { - builder.query("vpc.crn", String.valueOf(listSubnetsOptions.vpcCrn())); - } - if (listSubnetsOptions.vpcName() != null) { - builder.query("vpc.name", String.valueOf(listSubnetsOptions.vpcName())); - } - if (listSubnetsOptions.routingTableId() != null) { - builder.query("routing_table.id", String.valueOf(listSubnetsOptions.routingTableId())); - } - if (listSubnetsOptions.routingTableName() != null) { - builder.query("routing_table.name", String.valueOf(listSubnetsOptions.routingTableName())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List subnets. - * - * This request lists subnets in the region. Subnets are contiguous ranges of IP addresses specified in CIDR block - * notation. Each subnet is within a particular zone and cannot span multiple zones or regions. - * - * @return a {@link ServiceCall} with a result of type {@link SubnetCollection} - */ - public ServiceCall listSubnets() { - return listSubnets(null); - } - - /** - * Create a subnet. + * Retrieve the primary reserved IP. * - * This request creates a new subnet from a subnet prototype object. The prototype object is structured in the same - * way as a retrieved subnet, and contains the information necessary to create the new subnet. For this request to - * succeed, the prototype's CIDR block must not overlap with an existing subnet in the VPC. + * This request retrieves the primary reserved IP for a bare metal server network interface. * - * @param createSubnetOptions the {@link CreateSubnetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Subnet} + * @param getBareMetalServerNetworkInterfaceIpOptions the {@link GetBareMetalServerNetworkInterfaceIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIP} + * @deprecated this method is deprecated and may be removed in a future release */ - public ServiceCall createSubnet(CreateSubnetOptions createSubnetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createSubnetOptions, - "createSubnetOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSubnet"); + @Deprecated + public ServiceCall getBareMetalServerNetworkInterfaceIp(GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptions) { + LOGGER.warning("A deprecated operation has been invoked: getBareMetalServerNetworkInterfaceIp"); + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkInterfaceIpOptions, + "getBareMetalServerNetworkInterfaceIpOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkInterfaceIpOptions.bareMetalServerId()); + pathParamsMap.put("network_interface_id", getBareMetalServerNetworkInterfaceIpOptions.networkInterfaceId()); + pathParamsMap.put("id", getBareMetalServerNetworkInterfaceIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkInterfaceIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createSubnetOptions.subnetPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a subnet. + * Delete a bare metal server. * - * This request deletes a subnet. This operation cannot be reversed. For this request to succeed, the subnet must not - * be referenced by any bare metal server network interfaces, instance network interfaces, virtual network interfaces, - * VPN gateways, or load balancers. A delete operation automatically detaches the subnet from any network ACLs, public - * gateways, or endpoint gateways. All flow log collectors with `auto_delete` set to `true` targeting the subnet or - * any resource in the subnet are automatically deleted. + * This request deletes a bare metal server. This operation cannot be reversed. Any floating IPs associated with the + * bare metal server network interfaces are implicitly disassociated. * - * @param deleteSubnetOptions the {@link DeleteSubnetOptions} containing the options for the call + * @param deleteBareMetalServerOptions the {@link DeleteBareMetalServerOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteSubnet(DeleteSubnetOptions deleteSubnetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSubnetOptions, - "deleteSubnetOptions cannot be null"); + public ServiceCall deleteBareMetalServer(DeleteBareMetalServerOptions deleteBareMetalServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBareMetalServerOptions, + "deleteBareMetalServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteSubnetOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSubnet"); + pathParamsMap.put("id", deleteBareMetalServerOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBareMetalServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -2107,127 +2074,176 @@ public ServiceCall deleteSubnet(DeleteSubnetOptions deleteSubnetOptions) { } /** - * Retrieve a subnet. + * Retrieve a bare metal server. * - * This request retrieves a single subnet specified by the identifier in the URL. + * This request retrieves a single bare metal server specified by the identifier in the URL. * - * @param getSubnetOptions the {@link GetSubnetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Subnet} + * @param getBareMetalServerOptions the {@link GetBareMetalServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServer} */ - public ServiceCall getSubnet(GetSubnetOptions getSubnetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetOptions, - "getSubnetOptions cannot be null"); + public ServiceCall getBareMetalServer(GetBareMetalServerOptions getBareMetalServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerOptions, + "getBareMetalServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getSubnetOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnet"); + pathParamsMap.put("id", getBareMetalServerOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a subnet. + * Update a bare metal server. * - * This request updates a subnet with the information in a provided subnet patch. The subnet patch object is - * structured in the same way as a retrieved subnet and contains only the information to be updated. + * This request updates a bare metal server with the information in a provided patch. The bare metal server patch + * object is structured in the same way as a retrieved bare metal server and contains only the information to be + * updated. * - * @param updateSubnetOptions the {@link UpdateSubnetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Subnet} - */ - public ServiceCall updateSubnet(UpdateSubnetOptions updateSubnetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateSubnetOptions, - "updateSubnetOptions cannot be null"); + * For this request to succeed, the properties in the request must adhere to the `allowed_use` property of the disk + * referenced in the server's `boot_target`. + * + * @param updateBareMetalServerOptions the {@link UpdateBareMetalServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServer} + */ + public ServiceCall updateBareMetalServer(UpdateBareMetalServerOptions updateBareMetalServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateBareMetalServerOptions, + "updateBareMetalServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateSubnetOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSubnet"); + pathParamsMap.put("id", updateBareMetalServerOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBareMetalServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSubnetOptions.subnetPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBareMetalServerOptions.bareMetalServerPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a subnet's attached network ACL. + * Update firmware for a bare metal server. * - * This request retrieves the network ACL attached to the subnet specified by the identifier in the URL. + * This request updates a bare metal server to the latest available firmware. The server must be stopped. * - * @param getSubnetNetworkAclOptions the {@link GetSubnetNetworkAclOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACL} + * @param updateFirmwareForBareMetalServerOptions the {@link UpdateFirmwareForBareMetalServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getSubnetNetworkAcl(GetSubnetNetworkAclOptions getSubnetNetworkAclOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetNetworkAclOptions, - "getSubnetNetworkAclOptions cannot be null"); + public ServiceCall updateFirmwareForBareMetalServer(UpdateFirmwareForBareMetalServerOptions updateFirmwareForBareMetalServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateFirmwareForBareMetalServerOptions, + "updateFirmwareForBareMetalServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getSubnetNetworkAclOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/network_acl", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnetNetworkAcl"); + pathParamsMap.put("id", updateFirmwareForBareMetalServerOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/firmware/update", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateFirmwareForBareMetalServer"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + final JsonObject contentJson = new JsonObject(); + if (updateFirmwareForBareMetalServerOptions.autoStart() != null) { + contentJson.addProperty("auto_start", updateFirmwareForBareMetalServerOptions.autoStart()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Retrieve initialization configuration for a bare metal server. + * + * This request retrieves configuration used to initialize the bare metal server, such as the image used, SSH keys, + * and any configured usernames and passwords. These can subsequently be changed on the server and therefore may not + * be current. + * + * @param getBareMetalServerInitializationOptions the {@link GetBareMetalServerInitializationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerInitialization} + */ + public ServiceCall getBareMetalServerInitialization(GetBareMetalServerInitializationOptions getBareMetalServerInitializationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerInitializationOptions, + "getBareMetalServerInitializationOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getBareMetalServerInitializationOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/initialization", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerInitialization"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Replace the network ACL for a subnet. + * Reinitialize a bare metal server. * - * This request replaces the existing network ACL for a subnet with the network ACL specified in the request body. + * This request reinitializes a bare metal server with the specified image and SSH keys. The server must be stopped. + * Upon successful reinitiatilization, the bare metal server will be started automatically. * - * @param replaceSubnetNetworkAclOptions the {@link ReplaceSubnetNetworkAclOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACL} + * For this request to succeed, the properties of the server which would result from the reinitialization must adhere + * to the specified image's `allowed_use` property. + * + * @param replaceBareMetalServerInitializationOptions the {@link ReplaceBareMetalServerInitializationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link BareMetalServerInitialization} */ - public ServiceCall replaceSubnetNetworkAcl(ReplaceSubnetNetworkAclOptions replaceSubnetNetworkAclOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(replaceSubnetNetworkAclOptions, - "replaceSubnetNetworkAclOptions cannot be null"); + public ServiceCall replaceBareMetalServerInitialization(ReplaceBareMetalServerInitializationOptions replaceBareMetalServerInitializationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(replaceBareMetalServerInitializationOptions, + "replaceBareMetalServerInitializationOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", replaceSubnetNetworkAclOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/network_acl", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "replaceSubnetNetworkAcl"); + pathParamsMap.put("id", replaceBareMetalServerInitializationOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/initialization", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "replaceBareMetalServerInitialization"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(replaceSubnetNetworkAclOptions.networkAclIdentity()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("image", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceBareMetalServerInitializationOptions.image())); + contentJson.add("keys", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceBareMetalServerInitializationOptions.keys())); + if (replaceBareMetalServerInitializationOptions.defaultTrustedProfile() != null) { + contentJson.add("default_trusted_profile", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceBareMetalServerInitializationOptions.defaultTrustedProfile())); + } + if (replaceBareMetalServerInitializationOptions.userData() != null) { + contentJson.addProperty("user_data", replaceBareMetalServerInitializationOptions.userData()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Detach a public gateway from a subnet. + * Restart a bare metal server. * - * This request detaches the public gateway from the subnet specified by the subnet identifier in the URL. + * This request immediately restarts a bare metal server. For this request to succeed, the server must have a + * `status` of `running`. * - * @param unsetSubnetPublicGatewayOptions the {@link UnsetSubnetPublicGatewayOptions} containing the options for the call + * @param restartBareMetalServerOptions the {@link RestartBareMetalServerOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall unsetSubnetPublicGateway(UnsetSubnetPublicGatewayOptions unsetSubnetPublicGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(unsetSubnetPublicGatewayOptions, - "unsetSubnetPublicGatewayOptions cannot be null"); + public ServiceCall restartBareMetalServer(RestartBareMetalServerOptions restartBareMetalServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(restartBareMetalServerOptions, + "restartBareMetalServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", unsetSubnetPublicGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/public_gateway", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "unsetSubnetPublicGateway"); + pathParamsMap.put("id", restartBareMetalServerOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/restart", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "restartBareMetalServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -2238,179 +2254,206 @@ public ServiceCall unsetSubnetPublicGateway(UnsetSubnetPublicGatewayOption } /** - * Retrieve a subnet's attached public gateway. + * Start a bare metal server. * - * This request retrieves the public gateway attached to the subnet specified by the identifier in the URL. + * This request starts a bare metal server. It will run immediately provided the server is stopped. * - * @param getSubnetPublicGatewayOptions the {@link GetSubnetPublicGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicGateway} + * @param startBareMetalServerOptions the {@link StartBareMetalServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getSubnetPublicGateway(GetSubnetPublicGatewayOptions getSubnetPublicGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetPublicGatewayOptions, - "getSubnetPublicGatewayOptions cannot be null"); + public ServiceCall startBareMetalServer(StartBareMetalServerOptions startBareMetalServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(startBareMetalServerOptions, + "startBareMetalServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getSubnetPublicGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/public_gateway", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnetPublicGateway"); + pathParamsMap.put("id", startBareMetalServerOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/start", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "startBareMetalServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Attach a public gateway to a subnet. + * Stop a bare metal server. * - * This request attaches the public gateway, specified in the request body, to the subnet specified by the subnet - * identifier in the URL. The public gateway must have the same VPC and zone as the subnet. + * This request stops a bare metal server. It will run immediately provided the server is running. Note: A soft stop + * may not complete as it relies on the operating system to perform the operation. * - * @param setSubnetPublicGatewayOptions the {@link SetSubnetPublicGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicGateway} + * @param stopBareMetalServerOptions the {@link StopBareMetalServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall setSubnetPublicGateway(SetSubnetPublicGatewayOptions setSubnetPublicGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(setSubnetPublicGatewayOptions, - "setSubnetPublicGatewayOptions cannot be null"); + public ServiceCall stopBareMetalServer(StopBareMetalServerOptions stopBareMetalServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(stopBareMetalServerOptions, + "stopBareMetalServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", setSubnetPublicGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/public_gateway", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "setSubnetPublicGateway"); + pathParamsMap.put("id", stopBareMetalServerOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/stop", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "stopBareMetalServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(setSubnetPublicGatewayOptions.publicGatewayIdentity()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("type", stopBareMetalServerOptions.type()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a subnet's attached routing table. + * List cluster network profiles. * - * This request retrieves the routing table attached to the subnet specified by the identifier in the URL. + * This request lists cluster network profiles available in the region. A cluster network profile specifies the + * performance characteristics and capabilities for a cluster network. * - * @param getSubnetRoutingTableOptions the {@link GetSubnetRoutingTableOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RoutingTable} + * @param listClusterNetworkProfilesOptions the {@link ListClusterNetworkProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkProfileCollection} */ - public ServiceCall getSubnetRoutingTable(GetSubnetRoutingTableOptions getSubnetRoutingTableOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetRoutingTableOptions, - "getSubnetRoutingTableOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getSubnetRoutingTableOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/routing_table", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnetRoutingTable"); + public ServiceCall listClusterNetworkProfiles(ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptions) { + if (listClusterNetworkProfilesOptions == null) { + listClusterNetworkProfilesOptions = new ListClusterNetworkProfilesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_network/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworkProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listClusterNetworkProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listClusterNetworkProfilesOptions.start())); + } + if (listClusterNetworkProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listClusterNetworkProfilesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Replace the routing table for a subnet. + * List cluster network profiles. * - * This request replaces the existing routing table for a subnet with the routing table specified in the request body. + * This request lists cluster network profiles available in the region. A cluster network profile specifies the + * performance characteristics and capabilities for a cluster network. * - * For this request to succeed, the routing table `route_direct_link_ingress`, - * `route_internet_ingress`, `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkProfileCollection} + */ + public ServiceCall listClusterNetworkProfiles() { + return listClusterNetworkProfiles(null); + } + + /** + * Retrieve a cluster network profile. * - * @param replaceSubnetRoutingTableOptions the {@link ReplaceSubnetRoutingTableOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RoutingTable} + * This request retrieves a single cluster network profile specified by the name in the URL. + * + * @param getClusterNetworkProfileOptions the {@link GetClusterNetworkProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkProfile} */ - public ServiceCall replaceSubnetRoutingTable(ReplaceSubnetRoutingTableOptions replaceSubnetRoutingTableOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(replaceSubnetRoutingTableOptions, - "replaceSubnetRoutingTableOptions cannot be null"); + public ServiceCall getClusterNetworkProfile(GetClusterNetworkProfileOptions getClusterNetworkProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkProfileOptions, + "getClusterNetworkProfileOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", replaceSubnetRoutingTableOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/routing_table", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "replaceSubnetRoutingTable"); + pathParamsMap.put("name", getClusterNetworkProfileOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_network/profiles/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetworkProfile"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(replaceSubnetRoutingTableOptions.routingTableIdentity()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List reserved IPs in a subnet. + * List cluster networks. * - * This request lists reserved IPs in a subnet. A reserved IP resource will exist for every address in the subnet - * which is not available for use. + * This request lists [cluster networks](https://cloud.ibm.com/docs/vpc?topic=vpc-about-cluster-network) in the + * region. A cluster network is a grouping of resources in a separate networking space for high performance computing + * and networking. * - * @param listSubnetReservedIpsOptions the {@link ListSubnetReservedIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollection} + * @param listClusterNetworksOptions the {@link ListClusterNetworksOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkCollection} */ - public ServiceCall listSubnetReservedIps(ListSubnetReservedIpsOptions listSubnetReservedIpsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listSubnetReservedIpsOptions, - "listSubnetReservedIpsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("subnet_id", listSubnetReservedIpsOptions.subnetId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSubnetReservedIps"); + public ServiceCall listClusterNetworks(ListClusterNetworksOptions listClusterNetworksOptions) { + if (listClusterNetworksOptions == null) { + listClusterNetworksOptions = new ListClusterNetworksOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworks"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listSubnetReservedIpsOptions.start() != null) { - builder.query("start", String.valueOf(listSubnetReservedIpsOptions.start())); + if (listClusterNetworksOptions.start() != null) { + builder.query("start", String.valueOf(listClusterNetworksOptions.start())); } - if (listSubnetReservedIpsOptions.limit() != null) { - builder.query("limit", String.valueOf(listSubnetReservedIpsOptions.limit())); + if (listClusterNetworksOptions.limit() != null) { + builder.query("limit", String.valueOf(listClusterNetworksOptions.limit())); } - if (listSubnetReservedIpsOptions.sort() != null) { - builder.query("sort", String.valueOf(listSubnetReservedIpsOptions.sort())); + if (listClusterNetworksOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listClusterNetworksOptions.resourceGroupId())); } - if (listSubnetReservedIpsOptions.targetId() != null) { - builder.query("target.id", String.valueOf(listSubnetReservedIpsOptions.targetId())); + if (listClusterNetworksOptions.name() != null) { + builder.query("name", String.valueOf(listClusterNetworksOptions.name())); } - if (listSubnetReservedIpsOptions.targetCrn() != null) { - builder.query("target.crn", String.valueOf(listSubnetReservedIpsOptions.targetCrn())); + if (listClusterNetworksOptions.sort() != null) { + builder.query("sort", String.valueOf(listClusterNetworksOptions.sort())); } - if (listSubnetReservedIpsOptions.targetName() != null) { - builder.query("target.name", String.valueOf(listSubnetReservedIpsOptions.targetName())); + if (listClusterNetworksOptions.vpcId() != null) { + builder.query("vpc.id", String.valueOf(listClusterNetworksOptions.vpcId())); } - if (listSubnetReservedIpsOptions.targetResourceType() != null) { - builder.query("target.resource_type", String.valueOf(listSubnetReservedIpsOptions.targetResourceType())); + if (listClusterNetworksOptions.vpcCrn() != null) { + builder.query("vpc.crn", String.valueOf(listClusterNetworksOptions.vpcCrn())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listClusterNetworksOptions.vpcName() != null) { + builder.query("vpc.name", String.valueOf(listClusterNetworksOptions.vpcName())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Reserve an IP in a subnet. + * List cluster networks. * - * This request reserves an IP address in a subnet. If the provided prototype object includes an `address`, the - * address must not already be reserved. + * This request lists [cluster networks](https://cloud.ibm.com/docs/vpc?topic=vpc-about-cluster-network) in the + * region. A cluster network is a grouping of resources in a separate networking space for high performance computing + * and networking. * - * @param createSubnetReservedIpOptions the {@link CreateSubnetReservedIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIP} + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkCollection} */ - public ServiceCall createSubnetReservedIp(CreateSubnetReservedIpOptions createSubnetReservedIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createSubnetReservedIpOptions, - "createSubnetReservedIpOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("subnet_id", createSubnetReservedIpOptions.subnetId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSubnetReservedIp"); + public ServiceCall listClusterNetworks() { + return listClusterNetworks(null); + } + + /** + * Create a cluster network. + * + * This request creates a new cluster network from a cluster network prototype object. The prototype object is + * structured in the same way as a retrieved cluster network, and contains the information necessary to create the new + * cluster network. + * + * @param createClusterNetworkOptions the {@link CreateClusterNetworkOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetwork} + */ + public ServiceCall createClusterNetwork(CreateClusterNetworkOptions createClusterNetworkOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkOptions, + "createClusterNetworkOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetwork"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -2418,636 +2461,685 @@ public ServiceCall createSubnetReservedIp(CreateSubnetReservedIpOpti builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - if (createSubnetReservedIpOptions.address() != null) { - contentJson.addProperty("address", createSubnetReservedIpOptions.address()); - } - if (createSubnetReservedIpOptions.autoDelete() != null) { - contentJson.addProperty("auto_delete", createSubnetReservedIpOptions.autoDelete()); + contentJson.add("profile", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.profile())); + contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.vpc())); + contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.zone())); + if (createClusterNetworkOptions.name() != null) { + contentJson.addProperty("name", createClusterNetworkOptions.name()); } - if (createSubnetReservedIpOptions.name() != null) { - contentJson.addProperty("name", createSubnetReservedIpOptions.name()); + if (createClusterNetworkOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.resourceGroup())); } - if (createSubnetReservedIpOptions.target() != null) { - contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createSubnetReservedIpOptions.target())); + if (createClusterNetworkOptions.subnetPrefixes() != null) { + contentJson.add("subnet_prefixes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.subnetPrefixes())); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a reserved IP. + * List cluster network interfaces. * - * This request releases a reserved IP. This operation cannot be reversed. + * This request lists cluster network interfaces in the region. A cluster network interface is a logical abstraction + * of a cluster network interface in a subnet, and may be attached to a target resource. * - * For this request to succeed, the reserved IP must not be required by another resource, such as a bare metal server - * network interface, instance network interface or virtual network interface for which it is the primary IP. A - * provider-owned reserved IP is not allowed to be deleted. + * The cluster network interfaces will be sorted by their `created_at` property values, with newest cluster network + * interfaces first. Cluster network interfaces with identical + * `created_at` property values will in turn be sorted by ascending `name` property values. * - * @param deleteSubnetReservedIpOptions the {@link DeleteSubnetReservedIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listClusterNetworkInterfacesOptions the {@link ListClusterNetworkInterfacesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterfaceCollection} */ - public ServiceCall deleteSubnetReservedIp(DeleteSubnetReservedIpOptions deleteSubnetReservedIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSubnetReservedIpOptions, - "deleteSubnetReservedIpOptions cannot be null"); + public ServiceCall listClusterNetworkInterfaces(ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listClusterNetworkInterfacesOptions, + "listClusterNetworkInterfacesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("subnet_id", deleteSubnetReservedIpOptions.subnetId()); - pathParamsMap.put("id", deleteSubnetReservedIpOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSubnetReservedIp"); + pathParamsMap.put("cluster_network_id", listClusterNetworkInterfacesOptions.clusterNetworkId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworkInterfaces"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listClusterNetworkInterfacesOptions.start() != null) { + builder.query("start", String.valueOf(listClusterNetworkInterfacesOptions.start())); + } + if (listClusterNetworkInterfacesOptions.limit() != null) { + builder.query("limit", String.valueOf(listClusterNetworkInterfacesOptions.limit())); + } + if (listClusterNetworkInterfacesOptions.name() != null) { + builder.query("name", String.valueOf(listClusterNetworkInterfacesOptions.name())); + } + if (listClusterNetworkInterfacesOptions.sort() != null) { + builder.query("sort", String.valueOf(listClusterNetworkInterfacesOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a reserved IP. + * Create a cluster network interface. * - * This request retrieves a single reserved IP specified by the identifier in the URL. + * This request creates a new cluster network interface from a cluster network interface prototype object. The + * prototype object is structured in the same way as a retrieved cluster network interface, and contains the + * information necessary to create the new cluster network interface. * - * @param getSubnetReservedIpOptions the {@link GetSubnetReservedIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIP} + * @param createClusterNetworkInterfaceOptions the {@link CreateClusterNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterface} */ - public ServiceCall getSubnetReservedIp(GetSubnetReservedIpOptions getSubnetReservedIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetReservedIpOptions, - "getSubnetReservedIpOptions cannot be null"); + public ServiceCall createClusterNetworkInterface(CreateClusterNetworkInterfaceOptions createClusterNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkInterfaceOptions, + "createClusterNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("subnet_id", getSubnetReservedIpOptions.subnetId()); - pathParamsMap.put("id", getSubnetReservedIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnetReservedIp"); + pathParamsMap.put("cluster_network_id", createClusterNetworkInterfaceOptions.clusterNetworkId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + if (createClusterNetworkInterfaceOptions.name() != null) { + contentJson.addProperty("name", createClusterNetworkInterfaceOptions.name()); + } + if (createClusterNetworkInterfaceOptions.primaryIp() != null) { + contentJson.add("primary_ip", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkInterfaceOptions.primaryIp())); + } + if (createClusterNetworkInterfaceOptions.subnet() != null) { + contentJson.add("subnet", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkInterfaceOptions.subnet())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a reserved IP. - * - * This request updates a reserved IP with the information in a provided reserved IP patch. The reserved IP patch - * object is structured in the same way as a retrieved reserved IP and contains only the information to be updated. + * Delete a cluster network interface. * - * A provider-owned reserved IP is not allowed to be updated. + * This request deletes a cluster network interface. This operation cannot be reversed. For this request to succeed, + * the cluster network interface must not be required by another resource, such as a cluster network attachment for a + * virtual server instance. * - * @param updateSubnetReservedIpOptions the {@link UpdateSubnetReservedIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIP} + * @param deleteClusterNetworkInterfaceOptions the {@link DeleteClusterNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterface} */ - public ServiceCall updateSubnetReservedIp(UpdateSubnetReservedIpOptions updateSubnetReservedIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateSubnetReservedIpOptions, - "updateSubnetReservedIpOptions cannot be null"); + public ServiceCall deleteClusterNetworkInterface(DeleteClusterNetworkInterfaceOptions deleteClusterNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteClusterNetworkInterfaceOptions, + "deleteClusterNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("subnet_id", updateSubnetReservedIpOptions.subnetId()); - pathParamsMap.put("id", updateSubnetReservedIpOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSubnetReservedIp"); + pathParamsMap.put("cluster_network_id", deleteClusterNetworkInterfaceOptions.clusterNetworkId()); + pathParamsMap.put("id", deleteClusterNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteClusterNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (deleteClusterNetworkInterfaceOptions.ifMatch() != null) { + builder.header("If-Match", deleteClusterNetworkInterfaceOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSubnetReservedIpOptions.reservedIpPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List images. + * Retrieve a cluster network interface. * - * This request lists images available in the region. An image provides source data for a volume. Images are either - * system-provided, or created from another source, such as importing from Cloud Object Storage. + * This request retrieves a single cluster network interface specified by the identifier in the URL. * - * @param listImagesOptions the {@link ListImagesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ImageCollection} + * @param getClusterNetworkInterfaceOptions the {@link GetClusterNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterface} */ - public ServiceCall listImages(ListImagesOptions listImagesOptions) { - if (listImagesOptions == null) { - listImagesOptions = new ListImagesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listImages"); + public ServiceCall getClusterNetworkInterface(GetClusterNetworkInterfaceOptions getClusterNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkInterfaceOptions, + "getClusterNetworkInterfaceOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("cluster_network_id", getClusterNetworkInterfaceOptions.clusterNetworkId()); + pathParamsMap.put("id", getClusterNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listImagesOptions.start() != null) { - builder.query("start", String.valueOf(listImagesOptions.start())); - } - if (listImagesOptions.limit() != null) { - builder.query("limit", String.valueOf(listImagesOptions.limit())); - } - if (listImagesOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listImagesOptions.resourceGroupId())); - } - if (listImagesOptions.name() != null) { - builder.query("name", String.valueOf(listImagesOptions.name())); - } - if (listImagesOptions.status() != null) { - builder.query("status", RequestUtils.join(listImagesOptions.status(), ",")); - } - if (listImagesOptions.visibility() != null) { - builder.query("visibility", String.valueOf(listImagesOptions.visibility())); - } - if (listImagesOptions.userDataFormat() != null) { - builder.query("user_data_format", RequestUtils.join(listImagesOptions.userDataFormat(), ",")); - } - if (listImagesOptions.remoteAccountId() != null) { - builder.query("remote.account.id", String.valueOf(listImagesOptions.remoteAccountId())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List images. + * Update a cluster network interface. * - * This request lists images available in the region. An image provides source data for a volume. Images are either - * system-provided, or created from another source, such as importing from Cloud Object Storage. + * This request updates a cluster network interface with the information provided in a cluster network interface patch + * object. The patch object is structured in the same way as a retrieved cluster network interface and needs to + * contain only the information to be updated. * - * @return a {@link ServiceCall} with a result of type {@link ImageCollection} + * @param updateClusterNetworkInterfaceOptions the {@link UpdateClusterNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterface} */ - public ServiceCall listImages() { - return listImages(null); + public ServiceCall updateClusterNetworkInterface(UpdateClusterNetworkInterfaceOptions updateClusterNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateClusterNetworkInterfaceOptions, + "updateClusterNetworkInterfaceOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("cluster_network_id", updateClusterNetworkInterfaceOptions.clusterNetworkId()); + pathParamsMap.put("id", updateClusterNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateClusterNetworkInterface"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (updateClusterNetworkInterfaceOptions.ifMatch() != null) { + builder.header("If-Match", updateClusterNetworkInterfaceOptions.ifMatch()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateClusterNetworkInterfaceOptions.clusterNetworkInterfacePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); } /** - * Create an image. + * List cluster network subnets. * - * This request creates a new image from an image prototype object. The prototype object is structured in the same way - * as a retrieved image, and contains the information necessary to create the new image. If an image is being - * imported, a URL to the image file on object storage must be specified. If an image is being created from an - * existing volume, that volume must be specified. + * This request lists cluster network subnets in the cluster network. A cluster network subnet provides network + * routing between other cluster network subnets within a cluster network. * - * @param createImageOptions the {@link CreateImageOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Image} + * @param listClusterNetworkSubnetsOptions the {@link ListClusterNetworkSubnetsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetCollection} */ - public ServiceCall createImage(CreateImageOptions createImageOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createImageOptions, - "createImageOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createImage"); + public ServiceCall listClusterNetworkSubnets(ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listClusterNetworkSubnetsOptions, + "listClusterNetworkSubnetsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("cluster_network_id", listClusterNetworkSubnetsOptions.clusterNetworkId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworkSubnets"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createImageOptions.imagePrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listClusterNetworkSubnetsOptions.start() != null) { + builder.query("start", String.valueOf(listClusterNetworkSubnetsOptions.start())); + } + if (listClusterNetworkSubnetsOptions.limit() != null) { + builder.query("limit", String.valueOf(listClusterNetworkSubnetsOptions.limit())); + } + if (listClusterNetworkSubnetsOptions.name() != null) { + builder.query("name", String.valueOf(listClusterNetworkSubnetsOptions.name())); + } + if (listClusterNetworkSubnetsOptions.sort() != null) { + builder.query("sort", String.valueOf(listClusterNetworkSubnetsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an image. + * Create a cluster network subnet. * - * This request deletes an image. Any active image export jobs will be completed first. This operation cannot be - * reversed. An image with `remote.account` set is not allowed to be deleted. Additionally, an image cannot be deleted - * if it: - * - has a `status` of `deleting` - * - has a `status` of `pending` with a `status_reasons` code of `image_request_in_progress` - * - has `catalog_offering.managed` set to `true`. + * This request creates a new cluster network subnet from a cluster network subnet prototype object. The prototype + * object is structured in the same way as a retrieved cluster network subnet, and contains the information necessary + * to create the new cluster network subnet. * - * @param deleteImageOptions the {@link DeleteImageOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param createClusterNetworkSubnetOptions the {@link CreateClusterNetworkSubnetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnet} */ - public ServiceCall deleteImage(DeleteImageOptions deleteImageOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteImageOptions, - "deleteImageOptions cannot be null"); + public ServiceCall createClusterNetworkSubnet(CreateClusterNetworkSubnetOptions createClusterNetworkSubnetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkSubnetOptions, + "createClusterNetworkSubnetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteImageOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteImage"); + pathParamsMap.put("cluster_network_id", createClusterNetworkSubnetOptions.clusterNetworkId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetworkSubnet"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createClusterNetworkSubnetOptions.clusterNetworkSubnetPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an image. + * List cluster network subnet reserved IPs. * - * This request retrieves a single image specified by the identifier in the URL. + * This request lists cluster network subnet reserved IPs in the cluster network. * - * @param getImageOptions the {@link GetImageOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Image} + * @param listClusterNetworkSubnetReservedIpsOptions the {@link ListClusterNetworkSubnetReservedIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIPCollection} */ - public ServiceCall getImage(GetImageOptions getImageOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getImageOptions, - "getImageOptions cannot be null"); + public ServiceCall listClusterNetworkSubnetReservedIps(ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listClusterNetworkSubnetReservedIpsOptions, + "listClusterNetworkSubnetReservedIpsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getImageOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getImage"); + pathParamsMap.put("cluster_network_id", listClusterNetworkSubnetReservedIpsOptions.clusterNetworkId()); + pathParamsMap.put("cluster_network_subnet_id", listClusterNetworkSubnetReservedIpsOptions.clusterNetworkSubnetId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworkSubnetReservedIps"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listClusterNetworkSubnetReservedIpsOptions.start() != null) { + builder.query("start", String.valueOf(listClusterNetworkSubnetReservedIpsOptions.start())); + } + if (listClusterNetworkSubnetReservedIpsOptions.limit() != null) { + builder.query("limit", String.valueOf(listClusterNetworkSubnetReservedIpsOptions.limit())); + } + if (listClusterNetworkSubnetReservedIpsOptions.name() != null) { + builder.query("name", String.valueOf(listClusterNetworkSubnetReservedIpsOptions.name())); + } + if (listClusterNetworkSubnetReservedIpsOptions.sort() != null) { + builder.query("sort", String.valueOf(listClusterNetworkSubnetReservedIpsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an image. + * Create a cluster network subnet reserved IP. * - * This request updates an image with the information in a provided image patch. The image patch object is structured - * in the same way as a retrieved image and contains only the information to be updated. An image with - * `remote.account` set is not allowed to be updated. An image with a `status` of `deleting` cannot be updated. + * This request creates a new cluster network subnet reserved IP from a cluster network subnet reserved IP prototype + * object. The prototype object is structured in the same way as a retrieved cluster network subnet reserved IP, and + * contains the information necessary to create the new cluster network subnet reserved IP. * - * @param updateImageOptions the {@link UpdateImageOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Image} + * @param createClusterNetworkSubnetReservedIpOptions the {@link CreateClusterNetworkSubnetReservedIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIP} */ - public ServiceCall updateImage(UpdateImageOptions updateImageOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateImageOptions, - "updateImageOptions cannot be null"); + public ServiceCall createClusterNetworkSubnetReservedIp(CreateClusterNetworkSubnetReservedIpOptions createClusterNetworkSubnetReservedIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkSubnetReservedIpOptions, + "createClusterNetworkSubnetReservedIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateImageOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateImage"); + pathParamsMap.put("cluster_network_id", createClusterNetworkSubnetReservedIpOptions.clusterNetworkId()); + pathParamsMap.put("cluster_network_subnet_id", createClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetworkSubnetReservedIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateImageOptions.imagePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + if (createClusterNetworkSubnetReservedIpOptions.address() != null) { + contentJson.addProperty("address", createClusterNetworkSubnetReservedIpOptions.address()); + } + if (createClusterNetworkSubnetReservedIpOptions.name() != null) { + contentJson.addProperty("name", createClusterNetworkSubnetReservedIpOptions.name()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Deprecate an image. - * - * This request deprecates an image, resulting in its `status` becoming `deprecated` and - * `deprecation_at` being set to the current date and time. + * Delete a cluster network subnet reserved IP. * - * The image must: - * - have a `status` of `available` - * - have `catalog_offering.managed` set to `false` - * - not have `deprecation_at` set + * This request deletes a cluster network subnet reserved IP. This operation cannot be reversed. * - * An image with `remote.account` set is not allowed to be deprecated. + * For this request to succeed, the reserved IP must be unbound. A provider-owned reserved IP is not allowed to be + * deleted. * - * @param deprecateImageOptions the {@link DeprecateImageOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param deleteClusterNetworkSubnetReservedIpOptions the {@link DeleteClusterNetworkSubnetReservedIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIP} */ - public ServiceCall deprecateImage(DeprecateImageOptions deprecateImageOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deprecateImageOptions, - "deprecateImageOptions cannot be null"); + public ServiceCall deleteClusterNetworkSubnetReservedIp(DeleteClusterNetworkSubnetReservedIpOptions deleteClusterNetworkSubnetReservedIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteClusterNetworkSubnetReservedIpOptions, + "deleteClusterNetworkSubnetReservedIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deprecateImageOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}/deprecate", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deprecateImage"); + pathParamsMap.put("cluster_network_id", deleteClusterNetworkSubnetReservedIpOptions.clusterNetworkId()); + pathParamsMap.put("cluster_network_subnet_id", deleteClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetId()); + pathParamsMap.put("id", deleteClusterNetworkSubnetReservedIpOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteClusterNetworkSubnetReservedIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); + if (deleteClusterNetworkSubnetReservedIpOptions.ifMatch() != null) { + builder.header("If-Match", deleteClusterNetworkSubnetReservedIpOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Obsolete an image. + * Retrieve a cluster network subnet reserved IP. * - * This request obsoletes an image, resulting in its `status` becoming `obsolete` and - * `obsolescence_at` being set to the current date and time. + * This request retrieves a single cluster network subnet reserved IP specified by the identifier in the URL. * - * The image must: - * - have a `status` of `available` or `deprecated` - * - have `catalog_offering.managed` set to `false` - * - not have `deprecation_at` set in the future - * - not have `obsolescence_at` set - * - * An image with `remote.account` set is not allowed to be obsoleted. - * - * @param obsoleteImageOptions the {@link ObsoleteImageOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getClusterNetworkSubnetReservedIpOptions the {@link GetClusterNetworkSubnetReservedIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIP} */ - public ServiceCall obsoleteImage(ObsoleteImageOptions obsoleteImageOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(obsoleteImageOptions, - "obsoleteImageOptions cannot be null"); + public ServiceCall getClusterNetworkSubnetReservedIp(GetClusterNetworkSubnetReservedIpOptions getClusterNetworkSubnetReservedIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkSubnetReservedIpOptions, + "getClusterNetworkSubnetReservedIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", obsoleteImageOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}/obsolete", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "obsoleteImage"); + pathParamsMap.put("cluster_network_id", getClusterNetworkSubnetReservedIpOptions.clusterNetworkId()); + pathParamsMap.put("cluster_network_subnet_id", getClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetId()); + pathParamsMap.put("id", getClusterNetworkSubnetReservedIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetworkSubnetReservedIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List export jobs for an image. - * - * This request lists export jobs for an image. Each job tracks the exporting of the image to another location, such - * as a bucket within cloud object storage. + * Update a cluster network subnet reserved IP. * - * The jobs will be sorted by their `created_at` property values, with newest jobs first. Jobs with identical - * `created_at` property values will in turn be sorted by ascending - * `name` property values. + * This request updates a cluster network subnet reserved IP with the information provided in a cluster network subnet + * reserved IP patch object. The patch object is structured in the same way as a retrieved cluster network subnet + * reserved IP and needs to contain only the information to be updated. * - * @param listImageExportJobsOptions the {@link ListImageExportJobsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ImageExportJobUnpaginatedCollection} + * @param updateClusterNetworkSubnetReservedIpOptions the {@link UpdateClusterNetworkSubnetReservedIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIP} */ - public ServiceCall listImageExportJobs(ListImageExportJobsOptions listImageExportJobsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listImageExportJobsOptions, - "listImageExportJobsOptions cannot be null"); + public ServiceCall updateClusterNetworkSubnetReservedIp(UpdateClusterNetworkSubnetReservedIpOptions updateClusterNetworkSubnetReservedIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateClusterNetworkSubnetReservedIpOptions, + "updateClusterNetworkSubnetReservedIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("image_id", listImageExportJobsOptions.imageId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listImageExportJobs"); + pathParamsMap.put("cluster_network_id", updateClusterNetworkSubnetReservedIpOptions.clusterNetworkId()); + pathParamsMap.put("cluster_network_subnet_id", updateClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetId()); + pathParamsMap.put("id", updateClusterNetworkSubnetReservedIpOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateClusterNetworkSubnetReservedIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateClusterNetworkSubnetReservedIpOptions.ifMatch() != null) { + builder.header("If-Match", updateClusterNetworkSubnetReservedIpOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listImageExportJobsOptions.name() != null) { - builder.query("name", String.valueOf(listImageExportJobsOptions.name())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetReservedIpPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create an export job for an image. + * Delete a cluster network subnet. * - * This request creates and queues a new export job for the image specified in the URL using the image export job - * prototype object. The image must be owned by the account and be in the `available`, `deprecated`, `obsolete`, or - * `unusable` state. The prototype object is structured in the same way as a retrieved image export job, and contains - * the information necessary to create and queue the new image export job. + * This request deletes a cluster network subnet. This operation cannot be reversed. * - * @param createImageExportJobOptions the {@link CreateImageExportJobOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ImageExportJob} + * For this request to succeed, this cluster subnet must not be attached to a cluster network interface. + * + * @param deleteClusterNetworkSubnetOptions the {@link DeleteClusterNetworkSubnetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnet} */ - public ServiceCall createImageExportJob(CreateImageExportJobOptions createImageExportJobOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createImageExportJobOptions, - "createImageExportJobOptions cannot be null"); + public ServiceCall deleteClusterNetworkSubnet(DeleteClusterNetworkSubnetOptions deleteClusterNetworkSubnetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteClusterNetworkSubnetOptions, + "deleteClusterNetworkSubnetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("image_id", createImageExportJobOptions.imageId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createImageExportJob"); + pathParamsMap.put("cluster_network_id", deleteClusterNetworkSubnetOptions.clusterNetworkId()); + pathParamsMap.put("id", deleteClusterNetworkSubnetOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteClusterNetworkSubnet"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (deleteClusterNetworkSubnetOptions.ifMatch() != null) { + builder.header("If-Match", deleteClusterNetworkSubnetOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("storage_bucket", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createImageExportJobOptions.storageBucket())); - if (createImageExportJobOptions.format() != null) { - contentJson.addProperty("format", createImageExportJobOptions.format()); - } - if (createImageExportJobOptions.name() != null) { - contentJson.addProperty("name", createImageExportJobOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an image export job. + * Retrieve a cluster network subnet. * - * This request deletes an image export job. This operation cannot be reversed. If the job has not completed, the job - * will be canceled, and the incomplete exported image object deleted. If the job has completed, the exported image - * object will not be deleted. + * This request retrieves a single cluster network subnet specified by the identifier in the URL. * - * @param deleteImageExportJobOptions the {@link DeleteImageExportJobOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getClusterNetworkSubnetOptions the {@link GetClusterNetworkSubnetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnet} */ - public ServiceCall deleteImageExportJob(DeleteImageExportJobOptions deleteImageExportJobOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteImageExportJobOptions, - "deleteImageExportJobOptions cannot be null"); + public ServiceCall getClusterNetworkSubnet(GetClusterNetworkSubnetOptions getClusterNetworkSubnetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkSubnetOptions, + "getClusterNetworkSubnetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("image_id", deleteImageExportJobOptions.imageId()); - pathParamsMap.put("id", deleteImageExportJobOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteImageExportJob"); + pathParamsMap.put("cluster_network_id", getClusterNetworkSubnetOptions.clusterNetworkId()); + pathParamsMap.put("id", getClusterNetworkSubnetOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetworkSubnet"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an image export job. + * Update a cluster network subnet. * - * This request retrieves a single image export job specified by the identifier in the URL. + * This request updates a cluster network subnet with the information provided in a cluster network subnet patch + * object. The patch object is structured in the same way as a retrieved cluster network subnet and needs to contain + * only the information to be updated. * - * @param getImageExportJobOptions the {@link GetImageExportJobOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ImageExportJob} + * @param updateClusterNetworkSubnetOptions the {@link UpdateClusterNetworkSubnetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnet} */ - public ServiceCall getImageExportJob(GetImageExportJobOptions getImageExportJobOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getImageExportJobOptions, - "getImageExportJobOptions cannot be null"); + public ServiceCall updateClusterNetworkSubnet(UpdateClusterNetworkSubnetOptions updateClusterNetworkSubnetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateClusterNetworkSubnetOptions, + "updateClusterNetworkSubnetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("image_id", getImageExportJobOptions.imageId()); - pathParamsMap.put("id", getImageExportJobOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getImageExportJob"); + pathParamsMap.put("cluster_network_id", updateClusterNetworkSubnetOptions.clusterNetworkId()); + pathParamsMap.put("id", updateClusterNetworkSubnetOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateClusterNetworkSubnet"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateClusterNetworkSubnetOptions.ifMatch() != null) { + builder.header("If-Match", updateClusterNetworkSubnetOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateClusterNetworkSubnetOptions.clusterNetworkSubnetPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an image export job. + * Delete a cluster network. * - * This request updates an image export job with the information in a provided image export job patch. The image - * export job patch object is structured in the same way as a retrieved image export job and contains only the - * information to be updated. + * This request deletes a cluster network. This operation cannot be reversed. * - * @param updateImageExportJobOptions the {@link UpdateImageExportJobOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ImageExportJob} + * For this request to succeed, virtual server instances must not reside in this cluster network. + * + * @param deleteClusterNetworkOptions the {@link DeleteClusterNetworkOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetwork} */ - public ServiceCall updateImageExportJob(UpdateImageExportJobOptions updateImageExportJobOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateImageExportJobOptions, - "updateImageExportJobOptions cannot be null"); + public ServiceCall deleteClusterNetwork(DeleteClusterNetworkOptions deleteClusterNetworkOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteClusterNetworkOptions, + "deleteClusterNetworkOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("image_id", updateImageExportJobOptions.imageId()); - pathParamsMap.put("id", updateImageExportJobOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateImageExportJob"); + pathParamsMap.put("id", deleteClusterNetworkOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteClusterNetwork"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (deleteClusterNetworkOptions.ifMatch() != null) { + builder.header("If-Match", deleteClusterNetworkOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateImageExportJobOptions.imageExportJobPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List operating systems. + * Retrieve a cluster network. * - * This request lists operating systems in the region. + * This request retrieves a single cluster network specified by the identifier in the URL. * - * @param listOperatingSystemsOptions the {@link ListOperatingSystemsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link OperatingSystemCollection} + * @param getClusterNetworkOptions the {@link GetClusterNetworkOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetwork} */ - public ServiceCall listOperatingSystems(ListOperatingSystemsOptions listOperatingSystemsOptions) { - if (listOperatingSystemsOptions == null) { - listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/operating_systems")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listOperatingSystems"); + public ServiceCall getClusterNetwork(GetClusterNetworkOptions getClusterNetworkOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkOptions, + "getClusterNetworkOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getClusterNetworkOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetwork"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listOperatingSystemsOptions.start() != null) { - builder.query("start", String.valueOf(listOperatingSystemsOptions.start())); - } - if (listOperatingSystemsOptions.limit() != null) { - builder.query("limit", String.valueOf(listOperatingSystemsOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List operating systems. - * - * This request lists operating systems in the region. - * - * @return a {@link ServiceCall} with a result of type {@link OperatingSystemCollection} - */ - public ServiceCall listOperatingSystems() { - return listOperatingSystems(null); - } - - /** - * Retrieve an operating system. + * Update a cluster. * - * This request retrieves a single operating system specified by the name in the URL. + * This request updates a cluster network with the information provided in a cluster network patch object. The patch + * object is structured in the same way as a retrieved cluster network and needs to contain only the information to be + * updated. * - * @param getOperatingSystemOptions the {@link GetOperatingSystemOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link OperatingSystem} + * @param updateClusterNetworkOptions the {@link UpdateClusterNetworkOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ClusterNetwork} */ - public ServiceCall getOperatingSystem(GetOperatingSystemOptions getOperatingSystemOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getOperatingSystemOptions, - "getOperatingSystemOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getOperatingSystemOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/operating_systems/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getOperatingSystem"); + public ServiceCall updateClusterNetwork(UpdateClusterNetworkOptions updateClusterNetworkOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateClusterNetworkOptions, + "updateClusterNetworkOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", updateClusterNetworkOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateClusterNetwork"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateClusterNetworkOptions.ifMatch() != null) { + builder.header("If-Match", updateClusterNetworkOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateClusterNetworkOptions.clusterNetworkPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List keys. + * List dedicated host groups. * - * This request lists keys in the region. A key contains a public SSH key which may be installed on instances when - * they are created. Private keys are not stored. + * This request lists dedicated host groups in the region. Each dedicated host must belong to exactly one group, which + * controls placement of instances. Dedicated host groups do not span zones. * - * @param listKeysOptions the {@link ListKeysOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link KeyCollection} + * @param listDedicatedHostGroupsOptions the {@link ListDedicatedHostGroupsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroupCollection} */ - public ServiceCall listKeys(ListKeysOptions listKeysOptions) { - if (listKeysOptions == null) { - listKeysOptions = new ListKeysOptions.Builder().build(); + public ServiceCall listDedicatedHostGroups(ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions) { + if (listDedicatedHostGroupsOptions == null) { + listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder().build(); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listKeys"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listDedicatedHostGroups"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listKeysOptions.start() != null) { - builder.query("start", String.valueOf(listKeysOptions.start())); + if (listDedicatedHostGroupsOptions.start() != null) { + builder.query("start", String.valueOf(listDedicatedHostGroupsOptions.start())); } - if (listKeysOptions.limit() != null) { - builder.query("limit", String.valueOf(listKeysOptions.limit())); + if (listDedicatedHostGroupsOptions.limit() != null) { + builder.query("limit", String.valueOf(listDedicatedHostGroupsOptions.limit())); } - if (listKeysOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listKeysOptions.resourceGroupId())); + if (listDedicatedHostGroupsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listDedicatedHostGroupsOptions.resourceGroupId())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listDedicatedHostGroupsOptions.zoneName() != null) { + builder.query("zone.name", String.valueOf(listDedicatedHostGroupsOptions.zoneName())); + } + if (listDedicatedHostGroupsOptions.name() != null) { + builder.query("name", String.valueOf(listDedicatedHostGroupsOptions.name())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List keys. + * List dedicated host groups. * - * This request lists keys in the region. A key contains a public SSH key which may be installed on instances when - * they are created. Private keys are not stored. + * This request lists dedicated host groups in the region. Each dedicated host must belong to exactly one group, which + * controls placement of instances. Dedicated host groups do not span zones. * - * @return a {@link ServiceCall} with a result of type {@link KeyCollection} + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroupCollection} */ - public ServiceCall listKeys() { - return listKeys(null); + public ServiceCall listDedicatedHostGroups() { + return listDedicatedHostGroups(null); } /** - * Create a key. + * Create a dedicated host group. * - * This request creates a new SSH key from an key prototype object. The prototype object is structured in the same way - * as a retrieved key, and contains the information necessary to create the new key. The public key value must be - * provided. + * This request creates a new dedicated host group. * - * @param createKeyOptions the {@link CreateKeyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Key} + * @param createDedicatedHostGroupOptions the {@link CreateDedicatedHostGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroup} */ - public ServiceCall createKey(CreateKeyOptions createKeyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createKeyOptions, - "createKeyOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createKey"); + public ServiceCall createDedicatedHostGroup(CreateDedicatedHostGroupOptions createDedicatedHostGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createDedicatedHostGroupOptions, + "createDedicatedHostGroupOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createDedicatedHostGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -3055,37 +3147,36 @@ public ServiceCall createKey(CreateKeyOptions createKeyOptions) { builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("public_key", createKeyOptions.publicKey()); - if (createKeyOptions.name() != null) { - contentJson.addProperty("name", createKeyOptions.name()); - } - if (createKeyOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createKeyOptions.resourceGroup())); + contentJson.addProperty("class", createDedicatedHostGroupOptions.xClass()); + contentJson.addProperty("family", createDedicatedHostGroupOptions.family()); + contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createDedicatedHostGroupOptions.zone())); + if (createDedicatedHostGroupOptions.name() != null) { + contentJson.addProperty("name", createDedicatedHostGroupOptions.name()); } - if (createKeyOptions.type() != null) { - contentJson.addProperty("type", createKeyOptions.type()); + if (createDedicatedHostGroupOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createDedicatedHostGroupOptions.resourceGroup())); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a key. + * Delete a dedicated host group. * - * This request deletes a key. This operation cannot be reversed. + * This request deletes a dedicated host group. * - * @param deleteKeyOptions the {@link DeleteKeyOptions} containing the options for the call + * @param deleteDedicatedHostGroupOptions the {@link DeleteDedicatedHostGroupOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteKey(DeleteKeyOptions deleteKeyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteKeyOptions, - "deleteKeyOptions cannot be null"); + public ServiceCall deleteDedicatedHostGroup(DeleteDedicatedHostGroupOptions deleteDedicatedHostGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteDedicatedHostGroupOptions, + "deleteDedicatedHostGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteKeyOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteKey"); + pathParamsMap.put("id", deleteDedicatedHostGroupOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteDedicatedHostGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -3096,196 +3187,308 @@ public ServiceCall deleteKey(DeleteKeyOptions deleteKeyOptions) { } /** - * Retrieve a key. + * Retrieve a dedicated host group. * - * This request retrieves a single key specified by the identifier in the URL. + * This request retrieves a single dedicated host group specified by the identifier in the URL. * - * @param getKeyOptions the {@link GetKeyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Key} + * @param getDedicatedHostGroupOptions the {@link GetDedicatedHostGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroup} */ - public ServiceCall getKey(GetKeyOptions getKeyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getKeyOptions, - "getKeyOptions cannot be null"); + public ServiceCall getDedicatedHostGroup(GetDedicatedHostGroupOptions getDedicatedHostGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getDedicatedHostGroupOptions, + "getDedicatedHostGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getKeyOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getKey"); + pathParamsMap.put("id", getDedicatedHostGroupOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getDedicatedHostGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a key. + * Update a dedicated host group. * - * This request updates a key's name. + * This request updates a dedicated host group with the information in a provided dedicated host group patch. The + * dedicated host group patch object is structured in the same way as a retrieved dedicated host group and contains + * only the information to be updated. * - * @param updateKeyOptions the {@link UpdateKeyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Key} + * @param updateDedicatedHostGroupOptions the {@link UpdateDedicatedHostGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroup} */ - public ServiceCall updateKey(UpdateKeyOptions updateKeyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateKeyOptions, - "updateKeyOptions cannot be null"); + public ServiceCall updateDedicatedHostGroup(UpdateDedicatedHostGroupOptions updateDedicatedHostGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateDedicatedHostGroupOptions, + "updateDedicatedHostGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateKeyOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateKey"); + pathParamsMap.put("id", updateDedicatedHostGroupOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateDedicatedHostGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateKeyOptions.keyPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateDedicatedHostGroupOptions.dedicatedHostGroupPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List instance profiles. + * List dedicated host profiles. * - * This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the - * region. An instance profile specifies the performance characteristics and pricing model for an instance. + * This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in + * the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. * - * @param listInstanceProfilesOptions the {@link ListInstanceProfilesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceProfileCollection} + * @param listDedicatedHostProfilesOptions the {@link ListDedicatedHostProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostProfileCollection} */ - public ServiceCall listInstanceProfiles(ListInstanceProfilesOptions listInstanceProfilesOptions) { - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/profiles")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceProfiles"); + public ServiceCall listDedicatedHostProfiles(ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions) { + if (listDedicatedHostProfilesOptions == null) { + listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listDedicatedHostProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listDedicatedHostProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listDedicatedHostProfilesOptions.start())); + } + if (listDedicatedHostProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listDedicatedHostProfilesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List instance profiles. + * List dedicated host profiles. * - * This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the - * region. An instance profile specifies the performance characteristics and pricing model for an instance. + * This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in + * the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. * - * @return a {@link ServiceCall} with a result of type {@link InstanceProfileCollection} + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostProfileCollection} */ - public ServiceCall listInstanceProfiles() { - return listInstanceProfiles(null); + public ServiceCall listDedicatedHostProfiles() { + return listDedicatedHostProfiles(null); } /** - * Retrieve an instance profile. + * Retrieve a dedicated host profile. * - * This request retrieves a single instance profile specified by the name in the URL. + * This request retrieves a single dedicated host profile specified by the name in the URL. * - * @param getInstanceProfileOptions the {@link GetInstanceProfileOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceProfile} + * @param getDedicatedHostProfileOptions the {@link GetDedicatedHostProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostProfile} */ - public ServiceCall getInstanceProfile(GetInstanceProfileOptions getInstanceProfileOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceProfileOptions, - "getInstanceProfileOptions cannot be null"); + public ServiceCall getDedicatedHostProfile(GetDedicatedHostProfileOptions getDedicatedHostProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getDedicatedHostProfileOptions, + "getDedicatedHostProfileOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getInstanceProfileOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/profiles/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceProfile"); + pathParamsMap.put("name", getDedicatedHostProfileOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/profiles/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getDedicatedHostProfile"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List instance templates. + * List dedicated hosts. * - * This request lists instance templates in the region. + * This request lists dedicated hosts in the region. * - * @param listInstanceTemplatesOptions the {@link ListInstanceTemplatesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceTemplateCollection} + * @param listDedicatedHostsOptions the {@link ListDedicatedHostsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostCollection} */ - public ServiceCall listInstanceTemplates(ListInstanceTemplatesOptions listInstanceTemplatesOptions) { - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceTemplates"); + public ServiceCall listDedicatedHosts(ListDedicatedHostsOptions listDedicatedHostsOptions) { + if (listDedicatedHostsOptions == null) { + listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listDedicatedHosts"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listDedicatedHostsOptions.dedicatedHostGroupId() != null) { + builder.query("dedicated_host_group.id", String.valueOf(listDedicatedHostsOptions.dedicatedHostGroupId())); + } + if (listDedicatedHostsOptions.start() != null) { + builder.query("start", String.valueOf(listDedicatedHostsOptions.start())); + } + if (listDedicatedHostsOptions.limit() != null) { + builder.query("limit", String.valueOf(listDedicatedHostsOptions.limit())); + } + if (listDedicatedHostsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listDedicatedHostsOptions.resourceGroupId())); + } + if (listDedicatedHostsOptions.zoneName() != null) { + builder.query("zone.name", String.valueOf(listDedicatedHostsOptions.zoneName())); + } + if (listDedicatedHostsOptions.name() != null) { + builder.query("name", String.valueOf(listDedicatedHostsOptions.name())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List instance templates. + * List dedicated hosts. * - * This request lists instance templates in the region. + * This request lists dedicated hosts in the region. * - * @return a {@link ServiceCall} with a result of type {@link InstanceTemplateCollection} + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostCollection} */ - public ServiceCall listInstanceTemplates() { - return listInstanceTemplates(null); + public ServiceCall listDedicatedHosts() { + return listDedicatedHosts(null); } /** - * Create an instance template. + * Create a dedicated host. * - * This request creates a new instance template. The prototype object is structured in the same way as a retrieved - * instance template, and contains the information necessary to provision a new instance from the template. + * This request creates a new dedicated host. * - * If a `source_template` is specified in the prototype object, its contents are copied into the new template prior to - * copying any other properties provided in the prototype object. + * @param createDedicatedHostOptions the {@link CreateDedicatedHostOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHost} + */ + public ServiceCall createDedicatedHost(CreateDedicatedHostOptions createDedicatedHostOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createDedicatedHostOptions, + "createDedicatedHostOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createDedicatedHost"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createDedicatedHostOptions.dedicatedHostPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List disks on a dedicated host. * - * @param createInstanceTemplateOptions the {@link CreateInstanceTemplateOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceTemplate} + * This request lists disks on a dedicated host. A disk is a physical device that is locally attached to the compute + * node. By default, the listed disks are sorted by their + * `created_at` property values, with the newest disk first. + * + * @param listDedicatedHostDisksOptions the {@link ListDedicatedHostDisksOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostDiskCollection} */ - public ServiceCall createInstanceTemplate(CreateInstanceTemplateOptions createInstanceTemplateOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceTemplateOptions, - "createInstanceTemplateOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceTemplate"); + public ServiceCall listDedicatedHostDisks(ListDedicatedHostDisksOptions listDedicatedHostDisksOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listDedicatedHostDisksOptions, + "listDedicatedHostDisksOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("dedicated_host_id", listDedicatedHostDisksOptions.dedicatedHostId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{dedicated_host_id}/disks", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listDedicatedHostDisks"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceTemplateOptions.instanceTemplatePrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance template. + * Retrieve a dedicated host disk. * - * This request deletes the instance template. This operation cannot be reversed. + * This request retrieves a single dedicated host disk specified by the identifier in the URL. * - * @param deleteInstanceTemplateOptions the {@link DeleteInstanceTemplateOptions} containing the options for the call + * @param getDedicatedHostDiskOptions the {@link GetDedicatedHostDiskOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostDisk} + */ + public ServiceCall getDedicatedHostDisk(GetDedicatedHostDiskOptions getDedicatedHostDiskOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getDedicatedHostDiskOptions, + "getDedicatedHostDiskOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("dedicated_host_id", getDedicatedHostDiskOptions.dedicatedHostId()); + pathParamsMap.put("id", getDedicatedHostDiskOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{dedicated_host_id}/disks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getDedicatedHostDisk"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update a dedicated host disk. + * + * This request updates the dedicated host disk with the information in a provided patch. + * + * @param updateDedicatedHostDiskOptions the {@link UpdateDedicatedHostDiskOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHostDisk} + */ + public ServiceCall updateDedicatedHostDisk(UpdateDedicatedHostDiskOptions updateDedicatedHostDiskOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateDedicatedHostDiskOptions, + "updateDedicatedHostDiskOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("dedicated_host_id", updateDedicatedHostDiskOptions.dedicatedHostId()); + pathParamsMap.put("id", updateDedicatedHostDiskOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{dedicated_host_id}/disks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateDedicatedHostDisk"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateDedicatedHostDiskOptions.dedicatedHostDiskPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Delete a dedicated host. + * + * This request deletes a dedicated host. This operation cannot be reversed. For this request to succeed, `instances` + * must be empty and `instance_placement_enabled` must be `false`. + * + * @param deleteDedicatedHostOptions the {@link DeleteDedicatedHostOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteInstanceTemplate(DeleteInstanceTemplateOptions deleteInstanceTemplateOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceTemplateOptions, - "deleteInstanceTemplateOptions cannot be null"); + public ServiceCall deleteDedicatedHost(DeleteDedicatedHostOptions deleteDedicatedHostOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteDedicatedHostOptions, + "deleteDedicatedHostOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteInstanceTemplateOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceTemplate"); + pathParamsMap.put("id", deleteDedicatedHostOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteDedicatedHost"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -3296,814 +3499,794 @@ public ServiceCall deleteInstanceTemplate(DeleteInstanceTemplateOptions de } /** - * Retrieve an instance template. + * Retrieve a dedicated host. * - * This request retrieves a single instance template specified by the identifier in the URL. + * This request retrieves a single dedicated host specified by the identifiers in the URL. * - * @param getInstanceTemplateOptions the {@link GetInstanceTemplateOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceTemplate} + * @param getDedicatedHostOptions the {@link GetDedicatedHostOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHost} */ - public ServiceCall getInstanceTemplate(GetInstanceTemplateOptions getInstanceTemplateOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceTemplateOptions, - "getInstanceTemplateOptions cannot be null"); + public ServiceCall getDedicatedHost(GetDedicatedHostOptions getDedicatedHostOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getDedicatedHostOptions, + "getDedicatedHostOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getInstanceTemplateOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceTemplate"); + pathParamsMap.put("id", getDedicatedHostOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getDedicatedHost"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance template. + * Update a dedicated host. * - * This request updates an instance template with the information provided in the instance template patch. The - * instance template patch object is structured in the same way as a retrieved instance template and contains only the - * information to be updated. + * This request updates a dedicated host with the information in a provided dedicated host patch. The dedicated host + * patch object is structured in the same way as a retrieved dedicated host and contains only the information to be + * updated. * - * @param updateInstanceTemplateOptions the {@link UpdateInstanceTemplateOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceTemplate} + * @param updateDedicatedHostOptions the {@link UpdateDedicatedHostOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DedicatedHost} */ - public ServiceCall updateInstanceTemplate(UpdateInstanceTemplateOptions updateInstanceTemplateOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceTemplateOptions, - "updateInstanceTemplateOptions cannot be null"); + public ServiceCall updateDedicatedHost(UpdateDedicatedHostOptions updateDedicatedHostOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateDedicatedHostOptions, + "updateDedicatedHostOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateInstanceTemplateOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceTemplate"); + pathParamsMap.put("id", updateDedicatedHostOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateDedicatedHost"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceTemplateOptions.instanceTemplatePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateDedicatedHostOptions.dedicatedHostPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List instances. + * List endpoint gateways. * - * This request lists instances in the region. + * This request lists endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to a + * target outside the VPC. * - * @param listInstancesOptions the {@link ListInstancesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceCollection} + * The endpoint gateways will be sorted by their `created_at` property values, with newest endpoint gateway first. + * Endpoint gateways with identical `created_at` property values will in turn be sorted by ascending `name` property + * values. + * + * @param listEndpointGatewaysOptions the {@link ListEndpointGatewaysOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EndpointGatewayCollection} */ - public ServiceCall listInstances(ListInstancesOptions listInstancesOptions) { - if (listInstancesOptions == null) { - listInstancesOptions = new ListInstancesOptions.Builder().build(); + public ServiceCall listEndpointGateways(ListEndpointGatewaysOptions listEndpointGatewaysOptions) { + if (listEndpointGatewaysOptions == null) { + listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder().build(); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstances"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listEndpointGateways"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listInstancesOptions.start() != null) { - builder.query("start", String.valueOf(listInstancesOptions.start())); + if (listEndpointGatewaysOptions.name() != null) { + builder.query("name", String.valueOf(listEndpointGatewaysOptions.name())); } - if (listInstancesOptions.limit() != null) { - builder.query("limit", String.valueOf(listInstancesOptions.limit())); + if (listEndpointGatewaysOptions.start() != null) { + builder.query("start", String.valueOf(listEndpointGatewaysOptions.start())); } - if (listInstancesOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listInstancesOptions.resourceGroupId())); + if (listEndpointGatewaysOptions.limit() != null) { + builder.query("limit", String.valueOf(listEndpointGatewaysOptions.limit())); } - if (listInstancesOptions.name() != null) { - builder.query("name", String.valueOf(listInstancesOptions.name())); - } - if (listInstancesOptions.clusterNetworkId() != null) { - builder.query("cluster_network.id", String.valueOf(listInstancesOptions.clusterNetworkId())); - } - if (listInstancesOptions.clusterNetworkCrn() != null) { - builder.query("cluster_network.crn", String.valueOf(listInstancesOptions.clusterNetworkCrn())); - } - if (listInstancesOptions.clusterNetworkName() != null) { - builder.query("cluster_network.name", String.valueOf(listInstancesOptions.clusterNetworkName())); - } - if (listInstancesOptions.dedicatedHostId() != null) { - builder.query("dedicated_host.id", String.valueOf(listInstancesOptions.dedicatedHostId())); - } - if (listInstancesOptions.dedicatedHostCrn() != null) { - builder.query("dedicated_host.crn", String.valueOf(listInstancesOptions.dedicatedHostCrn())); - } - if (listInstancesOptions.dedicatedHostName() != null) { - builder.query("dedicated_host.name", String.valueOf(listInstancesOptions.dedicatedHostName())); - } - if (listInstancesOptions.placementGroupId() != null) { - builder.query("placement_group.id", String.valueOf(listInstancesOptions.placementGroupId())); - } - if (listInstancesOptions.placementGroupCrn() != null) { - builder.query("placement_group.crn", String.valueOf(listInstancesOptions.placementGroupCrn())); - } - if (listInstancesOptions.placementGroupName() != null) { - builder.query("placement_group.name", String.valueOf(listInstancesOptions.placementGroupName())); - } - if (listInstancesOptions.reservationAffinityPolicy() != null) { - builder.query("reservation_affinity.policy", String.valueOf(listInstancesOptions.reservationAffinityPolicy())); - } - if (listInstancesOptions.reservationId() != null) { - builder.query("reservation.id", String.valueOf(listInstancesOptions.reservationId())); + if (listEndpointGatewaysOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listEndpointGatewaysOptions.resourceGroupId())); } - if (listInstancesOptions.reservationCrn() != null) { - builder.query("reservation.crn", String.valueOf(listInstancesOptions.reservationCrn())); + if (listEndpointGatewaysOptions.lifecycleState() != null) { + builder.query("lifecycle_state", RequestUtils.join(listEndpointGatewaysOptions.lifecycleState(), ",")); } - if (listInstancesOptions.reservationName() != null) { - builder.query("reservation.name", String.valueOf(listInstancesOptions.reservationName())); + if (listEndpointGatewaysOptions.vpcId() != null) { + builder.query("vpc.id", String.valueOf(listEndpointGatewaysOptions.vpcId())); } - if (listInstancesOptions.vpcId() != null) { - builder.query("vpc.id", String.valueOf(listInstancesOptions.vpcId())); + if (listEndpointGatewaysOptions.vpcCrn() != null) { + builder.query("vpc.crn", String.valueOf(listEndpointGatewaysOptions.vpcCrn())); } - if (listInstancesOptions.vpcCrn() != null) { - builder.query("vpc.crn", String.valueOf(listInstancesOptions.vpcCrn())); + if (listEndpointGatewaysOptions.vpcName() != null) { + builder.query("vpc.name", String.valueOf(listEndpointGatewaysOptions.vpcName())); } - if (listInstancesOptions.vpcName() != null) { - builder.query("vpc.name", String.valueOf(listInstancesOptions.vpcName())); + if (listEndpointGatewaysOptions.dnsResolutionBindingMode() != null) { + builder.query("dns_resolution_binding_mode", RequestUtils.join(listEndpointGatewaysOptions.dnsResolutionBindingMode(), ",")); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List instances. + * List endpoint gateways. * - * This request lists instances in the region. + * This request lists endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to a + * target outside the VPC. * - * @return a {@link ServiceCall} with a result of type {@link InstanceCollection} + * The endpoint gateways will be sorted by their `created_at` property values, with newest endpoint gateway first. + * Endpoint gateways with identical `created_at` property values will in turn be sorted by ascending `name` property + * values. + * + * @return a {@link ServiceCall} with a result of type {@link EndpointGatewayCollection} */ - public ServiceCall listInstances() { - return listInstances(null); + public ServiceCall listEndpointGateways() { + return listEndpointGateways(null); } /** - * Create an instance. + * Create an endpoint gateway. * - * This request provisions a new instance from an instance prototype object. The prototype object is structured in the - * same way as a retrieved instance, and contains the information necessary to provision the new instance. The - * instance is automatically started. + * This request creates a new endpoint gateway from an endpoint gateway prototype object. The prototype object is + * structured in the same way as a retrieved endpoint gateway, and contains the information necessary to create a new + * endpoint gateway. An endpoint gateway maps one or more reserved IPs in a VPC to a target service outside the VPC. * - * @param createInstanceOptions the {@link CreateInstanceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Instance} + * @param createEndpointGatewayOptions the {@link CreateEndpointGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EndpointGateway} */ - public ServiceCall createInstance(CreateInstanceOptions createInstanceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceOptions, - "createInstanceOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstance"); + public ServiceCall createEndpointGateway(CreateEndpointGatewayOptions createEndpointGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createEndpointGatewayOptions, + "createEndpointGatewayOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createEndpointGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceOptions.instancePrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.target())); + contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.vpc())); + if (createEndpointGatewayOptions.dnsResolutionBindingMode() != null) { + contentJson.addProperty("dns_resolution_binding_mode", createEndpointGatewayOptions.dnsResolutionBindingMode()); + } + if (createEndpointGatewayOptions.ips() != null) { + contentJson.add("ips", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.ips())); + } + if (createEndpointGatewayOptions.name() != null) { + contentJson.addProperty("name", createEndpointGatewayOptions.name()); + } + if (createEndpointGatewayOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.resourceGroup())); + } + if (createEndpointGatewayOptions.securityGroups() != null) { + contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.securityGroups())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance. + * List reserved IPs bound to an endpoint gateway. * - * This request deletes an instance. This operation cannot be reversed. Any floating IPs associated with instance - * network interfaces are implicitly disassociated. All virtual network interfaces with `auto_delete` set to `true` - * targeting instance network attachments on the instance are automatically deleted. All flow log collectors with - * `auto_delete` set to `true` targeting the instance, the instance network attachments, the instance network - * interfaces, or the automatically deleted virtual network interfaces are automatically deleted. + * This request lists reserved IPs bound to an endpoint gateway. * - * @param deleteInstanceOptions the {@link DeleteInstanceOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listEndpointGatewayIpsOptions the {@link ListEndpointGatewayIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionEndpointGatewayContext} */ - public ServiceCall deleteInstance(DeleteInstanceOptions deleteInstanceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceOptions, - "deleteInstanceOptions cannot be null"); + public ServiceCall listEndpointGatewayIps(ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listEndpointGatewayIpsOptions, + "listEndpointGatewayIpsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteInstanceOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstance"); + pathParamsMap.put("endpoint_gateway_id", listEndpointGatewayIpsOptions.endpointGatewayId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listEndpointGatewayIps"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - if (deleteInstanceOptions.ifMatch() != null) { - builder.header("If-Match", deleteInstanceOptions.ifMatch()); - } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listEndpointGatewayIpsOptions.start() != null) { + builder.query("start", String.valueOf(listEndpointGatewayIpsOptions.start())); + } + if (listEndpointGatewayIpsOptions.limit() != null) { + builder.query("limit", String.valueOf(listEndpointGatewayIpsOptions.limit())); + } + if (listEndpointGatewayIpsOptions.sort() != null) { + builder.query("sort", String.valueOf(listEndpointGatewayIpsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an instance. + * Unbind a reserved IP from an endpoint gateway. * - * This request retrieves a single instance specified by the identifier in the URL. + * This request unbinds the specified reserved IP from the specified endpoint gateway. If the reserved IP has + * `auto_delete` set to `true`, the reserved IP will be deleted. * - * @param getInstanceOptions the {@link GetInstanceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Instance} + * @param removeEndpointGatewayIpOptions the {@link RemoveEndpointGatewayIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getInstance(GetInstanceOptions getInstanceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceOptions, - "getInstanceOptions cannot be null"); + public ServiceCall removeEndpointGatewayIp(RemoveEndpointGatewayIpOptions removeEndpointGatewayIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(removeEndpointGatewayIpOptions, + "removeEndpointGatewayIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getInstanceOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstance"); + pathParamsMap.put("endpoint_gateway_id", removeEndpointGatewayIpOptions.endpointGatewayId()); + pathParamsMap.put("id", removeEndpointGatewayIpOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeEndpointGatewayIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance. + * Retrieve a reserved IP bound to an endpoint gateway. * - * This request updates an instance with the information in a provided instance patch. The instance patch object is - * structured in the same way as a retrieved instance and contains only the information to be updated. + * This request retrieves the specified reserved IP address if it is bound to the endpoint gateway specified in the + * URL. * - * @param updateInstanceOptions the {@link UpdateInstanceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Instance} + * @param getEndpointGatewayIpOptions the {@link GetEndpointGatewayIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIP} */ - public ServiceCall updateInstance(UpdateInstanceOptions updateInstanceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceOptions, - "updateInstanceOptions cannot be null"); + public ServiceCall getEndpointGatewayIp(GetEndpointGatewayIpOptions getEndpointGatewayIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getEndpointGatewayIpOptions, + "getEndpointGatewayIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateInstanceOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstance"); + pathParamsMap.put("endpoint_gateway_id", getEndpointGatewayIpOptions.endpointGatewayId()); + pathParamsMap.put("id", getEndpointGatewayIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getEndpointGatewayIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateInstanceOptions.ifMatch() != null) { - builder.header("If-Match", updateInstanceOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceOptions.instancePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve initialization configuration for an instance. + * Bind a reserved IP to an endpoint gateway. * - * This request retrieves configuration used to initialize the instance, such as SSH keys and the Windows - * administrator password. These can subsequently be changed on the instance and therefore may not be current. + * This request binds the specified reserved IP to the specified endpoint gateway. The reserved IP: * - * @param getInstanceInitializationOptions the {@link GetInstanceInitializationOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceInitialization} + * - must currently be unbound, or not required by its target + * - must not be in the same zone as any other reserved IP bound to the endpoint gateway. + * + * @param addEndpointGatewayIpOptions the {@link AddEndpointGatewayIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIP} */ - public ServiceCall getInstanceInitialization(GetInstanceInitializationOptions getInstanceInitializationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceInitializationOptions, - "getInstanceInitializationOptions cannot be null"); + public ServiceCall addEndpointGatewayIp(AddEndpointGatewayIpOptions addEndpointGatewayIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(addEndpointGatewayIpOptions, + "addEndpointGatewayIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getInstanceInitializationOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{id}/initialization", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceInitialization"); + pathParamsMap.put("endpoint_gateway_id", addEndpointGatewayIpOptions.endpointGatewayId()); + pathParamsMap.put("id", addEndpointGatewayIpOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addEndpointGatewayIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create an instance action. + * List resource bindings for an endpoint gateway. * - * This request creates a new action which will be queued up to run as soon as any pending or running actions have - * completed. + * This request lists resource bindings for an endpoint gateway. A resource binding is an association between the + * endpoint gateway and a resource in the endpoint gateway's `target` service. The resource binding provides a fully + * qualified domain name for the + * `service_endpoint` to access the resource from the endpoint gateway's VPC. * - * @param createInstanceActionOptions the {@link CreateInstanceActionOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceAction} + * The resource bindings will be sorted by their `created_at` property values, with newest resource bindings first. + * Resource bindings with identical `created_at` property values will in turn be sorted by ascending `name` property + * values. + * + * @param listEndpointGatewayResourceBindingsOptions the {@link ListEndpointGatewayResourceBindingsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EndpointGatewayResourceBindingCollection} */ - public ServiceCall createInstanceAction(CreateInstanceActionOptions createInstanceActionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceActionOptions, - "createInstanceActionOptions cannot be null"); + public ServiceCall listEndpointGatewayResourceBindings(ListEndpointGatewayResourceBindingsOptions listEndpointGatewayResourceBindingsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listEndpointGatewayResourceBindingsOptions, + "listEndpointGatewayResourceBindingsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", createInstanceActionOptions.instanceId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/actions", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceAction"); + pathParamsMap.put("endpoint_gateway_id", listEndpointGatewayResourceBindingsOptions.endpointGatewayId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/resource_bindings", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listEndpointGatewayResourceBindings"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("type", createInstanceActionOptions.type()); - if (createInstanceActionOptions.force() != null) { - contentJson.addProperty("force", createInstanceActionOptions.force()); + if (listEndpointGatewayResourceBindingsOptions.start() != null) { + builder.query("start", String.valueOf(listEndpointGatewayResourceBindingsOptions.start())); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listEndpointGatewayResourceBindingsOptions.limit() != null) { + builder.query("limit", String.valueOf(listEndpointGatewayResourceBindingsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List cluster network attachments on an instance. + * Create a resource binding for an endpoint gateway. * - * This request lists cluster network attachments on an instance. A cluster network attachment represents a device on - * the instance to which a cluster network interface is attached. + * This request creates a new resource binding for an endpoint gateway from an endpoint gateway resource binding + * prototype object. The prototype object is structured in the same way as a retrieved endpoint gateway resource + * binding, and contains the information necessary to create the new resource binding. * - * @param listInstanceClusterNetworkAttachmentsOptions the {@link ListInstanceClusterNetworkAttachmentsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachmentCollection} + * For this request to succeed, resource binding must be enabled for this endpoint gateway's + * `target` service and this endpoint gateway resource binding must not conflict with another resource binding in the + * [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected topology. + * + * @param createEndpointGatewayResourceBindingOptions the {@link CreateEndpointGatewayResourceBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EndpointGatewayResourceBinding} */ - public ServiceCall listInstanceClusterNetworkAttachments(ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceClusterNetworkAttachmentsOptions, - "listInstanceClusterNetworkAttachmentsOptions cannot be null"); + public ServiceCall createEndpointGatewayResourceBinding(CreateEndpointGatewayResourceBindingOptions createEndpointGatewayResourceBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createEndpointGatewayResourceBindingOptions, + "createEndpointGatewayResourceBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", listInstanceClusterNetworkAttachmentsOptions.instanceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceClusterNetworkAttachments"); + pathParamsMap.put("endpoint_gateway_id", createEndpointGatewayResourceBindingOptions.endpointGatewayId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/resource_bindings", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createEndpointGatewayResourceBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listInstanceClusterNetworkAttachmentsOptions.start() != null) { - builder.query("start", String.valueOf(listInstanceClusterNetworkAttachmentsOptions.start())); - } - if (listInstanceClusterNetworkAttachmentsOptions.limit() != null) { - builder.query("limit", String.valueOf(listInstanceClusterNetworkAttachmentsOptions.limit())); + final JsonObject contentJson = new JsonObject(); + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayResourceBindingOptions.target())); + if (createEndpointGatewayResourceBindingOptions.name() != null) { + contentJson.addProperty("name", createEndpointGatewayResourceBindingOptions.name()); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a cluster network attachment. + * Delete a resource binding from an endpoint gateway. * - * This request creates a cluster network attachment from an instance cluster network attachment prototype object. A - * cluster network attachment will attach the instance to a cluster network. The cluster network attachment prototype - * must specify a cluster network interface identity or a cluster network interface prototype. - * - * The instance must be in a `stopped` or `stopping` state to create an instance cluster network attachment. + * This request deletes the specified resource binding from the specified endpoint gateway. This operation cannot be + * reversed. * - * @param createClusterNetworkAttachmentOptions the {@link CreateClusterNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachment} + * @param deleteEndpointGatewayResourceBindingOptions the {@link DeleteEndpointGatewayResourceBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createClusterNetworkAttachment(CreateClusterNetworkAttachmentOptions createClusterNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkAttachmentOptions, - "createClusterNetworkAttachmentOptions cannot be null"); + public ServiceCall deleteEndpointGatewayResourceBinding(DeleteEndpointGatewayResourceBindingOptions deleteEndpointGatewayResourceBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteEndpointGatewayResourceBindingOptions, + "deleteEndpointGatewayResourceBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", createClusterNetworkAttachmentOptions.instanceId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetworkAttachment"); + pathParamsMap.put("endpoint_gateway_id", deleteEndpointGatewayResourceBindingOptions.endpointGatewayId()); + pathParamsMap.put("id", deleteEndpointGatewayResourceBindingOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/resource_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteEndpointGatewayResourceBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("cluster_network_interface", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkAttachmentOptions.clusterNetworkInterface())); - if (createClusterNetworkAttachmentOptions.before() != null) { - contentJson.add("before", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkAttachmentOptions.before())); - } - if (createClusterNetworkAttachmentOptions.name() != null) { - contentJson.addProperty("name", createClusterNetworkAttachmentOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance cluster network attachment. - * - * This request deletes an instance cluster network attachment. The instance must be in a - * `stopped` or `stopping` state to delete an instance cluster network attachment. + * Retrieve an endpoint gateway resource binding. * - * This operation cannot be reversed. + * This request retrieves a single endpoint gateway resource binding specified by the identifier in the URL. * - * @param deleteInstanceClusterNetworkAttachmentOptions the {@link DeleteInstanceClusterNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachment} + * @param getEndpointGatewayResourceBindingOptions the {@link GetEndpointGatewayResourceBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EndpointGatewayResourceBinding} */ - public ServiceCall deleteInstanceClusterNetworkAttachment(DeleteInstanceClusterNetworkAttachmentOptions deleteInstanceClusterNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceClusterNetworkAttachmentOptions, - "deleteInstanceClusterNetworkAttachmentOptions cannot be null"); + public ServiceCall getEndpointGatewayResourceBinding(GetEndpointGatewayResourceBindingOptions getEndpointGatewayResourceBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getEndpointGatewayResourceBindingOptions, + "getEndpointGatewayResourceBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", deleteInstanceClusterNetworkAttachmentOptions.instanceId()); - pathParamsMap.put("id", deleteInstanceClusterNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceClusterNetworkAttachment"); + pathParamsMap.put("endpoint_gateway_id", getEndpointGatewayResourceBindingOptions.endpointGatewayId()); + pathParamsMap.put("id", getEndpointGatewayResourceBindingOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/resource_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getEndpointGatewayResourceBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an instance cluster network attachment. + * Update an endpoint gateway resource binding. * - * This request retrieves a single instance cluster network attachment specified by the identifier in the URL. + * This request updates an endpoint gateway resource binding with the information in a provided endpoint gateway + * resource binding patch. The endpoint gateway resource binding patch object is structured in the same way as a + * retrieved endpoint gateway resource binding and contains only the information to be updated. * - * @param getInstanceClusterNetworkAttachmentOptions the {@link GetInstanceClusterNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachment} + * @param updateEndpointGatewayResourceBindingOptions the {@link UpdateEndpointGatewayResourceBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EndpointGatewayResourceBinding} */ - public ServiceCall getInstanceClusterNetworkAttachment(GetInstanceClusterNetworkAttachmentOptions getInstanceClusterNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceClusterNetworkAttachmentOptions, - "getInstanceClusterNetworkAttachmentOptions cannot be null"); + public ServiceCall updateEndpointGatewayResourceBinding(UpdateEndpointGatewayResourceBindingOptions updateEndpointGatewayResourceBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateEndpointGatewayResourceBindingOptions, + "updateEndpointGatewayResourceBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", getInstanceClusterNetworkAttachmentOptions.instanceId()); - pathParamsMap.put("id", getInstanceClusterNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceClusterNetworkAttachment"); + pathParamsMap.put("endpoint_gateway_id", updateEndpointGatewayResourceBindingOptions.endpointGatewayId()); + pathParamsMap.put("id", updateEndpointGatewayResourceBindingOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/resource_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateEndpointGatewayResourceBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateEndpointGatewayResourceBindingOptions.endpointGatewayResourceBindingPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance cluster network attachment. + * Delete an endpoint gateway. * - * This request updates an instance cluster network attachment with the information provided in an instance network - * interface patch object. The instance cluster network attachment patch object is structured in the same way as a - * retrieved instance cluster network attachment and needs to contain only the information to be updated. + * This request deletes an endpoint gateway. This operation cannot be reversed. * - * @param updateInstanceClusterNetworkAttachmentOptions the {@link UpdateInstanceClusterNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachment} + * Reserved IPs that were bound to the endpoint gateway will be released if their + * `auto_delete` property is set to true. + * + * If the VPC this endpoint gateway resides in has `dns.enable_hub` set to `true`, then no other VPC in the [DNS + * sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) topology must contain an endpoint gateway with the same `target` + * service as this endpoint gateway. + * + * @param deleteEndpointGatewayOptions the {@link DeleteEndpointGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updateInstanceClusterNetworkAttachment(UpdateInstanceClusterNetworkAttachmentOptions updateInstanceClusterNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceClusterNetworkAttachmentOptions, - "updateInstanceClusterNetworkAttachmentOptions cannot be null"); + public ServiceCall deleteEndpointGateway(DeleteEndpointGatewayOptions deleteEndpointGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteEndpointGatewayOptions, + "deleteEndpointGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", updateInstanceClusterNetworkAttachmentOptions.instanceId()); - pathParamsMap.put("id", updateInstanceClusterNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceClusterNetworkAttachment"); + pathParamsMap.put("id", deleteEndpointGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteEndpointGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceClusterNetworkAttachmentOptions.instanceClusterNetworkAttachmentPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Create a console access token for an instance. + * Retrieve an endpoint gateway. * - * This request creates a new single-use console access token for an instance. All console configuration is provided - * at token create time, and the token is subsequently used in the `access_token` query parameter for the WebSocket - * request. The access token is only valid for a short period of time, and a maximum of one token is valid for a - * given instance at a time. + * This request retrieves a single endpoint gateway specified by the identifier in the URL. * - * @param createInstanceConsoleAccessTokenOptions the {@link CreateInstanceConsoleAccessTokenOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceConsoleAccessToken} + * @param getEndpointGatewayOptions the {@link GetEndpointGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EndpointGateway} */ - public ServiceCall createInstanceConsoleAccessToken(CreateInstanceConsoleAccessTokenOptions createInstanceConsoleAccessTokenOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceConsoleAccessTokenOptions, - "createInstanceConsoleAccessTokenOptions cannot be null"); + public ServiceCall getEndpointGateway(GetEndpointGatewayOptions getEndpointGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getEndpointGatewayOptions, + "getEndpointGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", createInstanceConsoleAccessTokenOptions.instanceId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/console_access_token", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceConsoleAccessToken"); + pathParamsMap.put("id", getEndpointGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getEndpointGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("console_type", createInstanceConsoleAccessTokenOptions.consoleType()); - if (createInstanceConsoleAccessTokenOptions.force() != null) { - contentJson.addProperty("force", createInstanceConsoleAccessTokenOptions.force()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List disks on an instance. + * Update an endpoint gateway. * - * This request lists disks on an instance. A disk is a block device that is locally attached to the instance's - * physical host and is also referred to as instance storage. By default, the listed disks are sorted by their - * `created_at` property values, with the newest disk first. + * This request updates an endpoint gateway with the information in a provided endpoint gateway patch. The endpoint + * gateway patch object is structured in the same way as a retrieved endpoint gateway and contains only the + * information to be updated. * - * @param listInstanceDisksOptions the {@link ListInstanceDisksOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceDiskCollection} + * @param updateEndpointGatewayOptions the {@link UpdateEndpointGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link EndpointGateway} */ - public ServiceCall listInstanceDisks(ListInstanceDisksOptions listInstanceDisksOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceDisksOptions, - "listInstanceDisksOptions cannot be null"); + public ServiceCall updateEndpointGateway(UpdateEndpointGatewayOptions updateEndpointGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateEndpointGatewayOptions, + "updateEndpointGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", listInstanceDisksOptions.instanceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/disks", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceDisks"); + pathParamsMap.put("id", updateEndpointGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateEndpointGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateEndpointGatewayOptions.endpointGatewayPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an instance disk. + * List floating IPs. * - * This request retrieves a single instance disk specified by the identifier in the URL. + * This request lists floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet to + * an instance. * - * @param getInstanceDiskOptions the {@link GetInstanceDiskOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceDisk} + * @param listFloatingIpsOptions the {@link ListFloatingIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIPCollection} */ - public ServiceCall getInstanceDisk(GetInstanceDiskOptions getInstanceDiskOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceDiskOptions, - "getInstanceDiskOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", getInstanceDiskOptions.instanceId()); - pathParamsMap.put("id", getInstanceDiskOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/disks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceDisk"); + public ServiceCall listFloatingIps(ListFloatingIpsOptions listFloatingIpsOptions) { + if (listFloatingIpsOptions == null) { + listFloatingIpsOptions = new ListFloatingIpsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listFloatingIps"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listFloatingIpsOptions.start() != null) { + builder.query("start", String.valueOf(listFloatingIpsOptions.start())); + } + if (listFloatingIpsOptions.limit() != null) { + builder.query("limit", String.valueOf(listFloatingIpsOptions.limit())); + } + if (listFloatingIpsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listFloatingIpsOptions.resourceGroupId())); + } + if (listFloatingIpsOptions.sort() != null) { + builder.query("sort", String.valueOf(listFloatingIpsOptions.sort())); + } + if (listFloatingIpsOptions.targetId() != null) { + builder.query("target.id", String.valueOf(listFloatingIpsOptions.targetId())); + } + if (listFloatingIpsOptions.targetCrn() != null) { + builder.query("target.crn", String.valueOf(listFloatingIpsOptions.targetCrn())); + } + if (listFloatingIpsOptions.targetName() != null) { + builder.query("target.name", String.valueOf(listFloatingIpsOptions.targetName())); + } + if (listFloatingIpsOptions.targetResourceType() != null) { + builder.query("target.resource_type", String.valueOf(listFloatingIpsOptions.targetResourceType())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance disk. + * List floating IPs. * - * This request updates the instance disk with the information in a provided patch. + * This request lists floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet to + * an instance. * - * @param updateInstanceDiskOptions the {@link UpdateInstanceDiskOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceDisk} + * @return a {@link ServiceCall} with a result of type {@link FloatingIPCollection} */ - public ServiceCall updateInstanceDisk(UpdateInstanceDiskOptions updateInstanceDiskOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceDiskOptions, - "updateInstanceDiskOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", updateInstanceDiskOptions.instanceId()); - pathParamsMap.put("id", updateInstanceDiskOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/disks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceDisk"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceDiskOptions.instanceDiskPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listFloatingIps() { + return listFloatingIps(null); } /** - * List network attachments on an instance. + * Reserve a floating IP. * - * This request lists network attachments on an instance. A network attachment represents a device on the instance to - * which a virtual network interface is attached. - * - * The network attachments will be sorted by their `created_at` property values, with newest network attachments - * first. Network attachments with identical `created_at` property values will in turn be sorted by ascending `name` - * property values. + * This request reserves a new floating IP. * - * @param listInstanceNetworkAttachmentsOptions the {@link ListInstanceNetworkAttachmentsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceNetworkAttachmentCollection} + * @param createFloatingIpOptions the {@link CreateFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIP} */ - public ServiceCall listInstanceNetworkAttachments(ListInstanceNetworkAttachmentsOptions listInstanceNetworkAttachmentsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceNetworkAttachmentsOptions, - "listInstanceNetworkAttachmentsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", listInstanceNetworkAttachmentsOptions.instanceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceNetworkAttachments"); + public ServiceCall createFloatingIp(CreateFloatingIpOptions createFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createFloatingIpOptions, + "createFloatingIpOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createFloatingIpOptions.floatingIpPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a network attachment on an instance. + * Delete a floating IP. * - * This request creates a new instance network attachment from an instance network attachment prototype object. The - * prototype object is structured in the same way as a retrieved instance network attachment, and contains the - * information necessary to create the new instance network attachment. + * This request disassociates (if associated) and releases a floating IP. This operation cannot be reversed. For this + * request to succeed, the floating IP must not be required by another resource, such as a public gateway. * - * @param createInstanceNetworkAttachmentOptions the {@link CreateInstanceNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceNetworkAttachment} + * @param deleteFloatingIpOptions the {@link DeleteFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createInstanceNetworkAttachment(CreateInstanceNetworkAttachmentOptions createInstanceNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceNetworkAttachmentOptions, - "createInstanceNetworkAttachmentOptions cannot be null"); + public ServiceCall deleteFloatingIp(DeleteFloatingIpOptions deleteFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteFloatingIpOptions, + "deleteFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", createInstanceNetworkAttachmentOptions.instanceId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceNetworkAttachment"); + pathParamsMap.put("id", deleteFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("virtual_network_interface", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceNetworkAttachmentOptions.virtualNetworkInterface())); - if (createInstanceNetworkAttachmentOptions.name() != null) { - contentJson.addProperty("name", createInstanceNetworkAttachmentOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance network attachment. + * Retrieve a floating IP. * - * This request deletes an instance network attachment. This operation cannot be reversed. Any floating IPs associated - * with the instance network attachment are implicitly disassociated. All flow log collectors with `auto_delete` set - * to `true` targeting the instance network attachment are automatically deleted. The primary instance network - * attachment is not allowed to be deleted. + * This request retrieves a single floating IP specified by the identifier in the URL. * - * @param deleteInstanceNetworkAttachmentOptions the {@link DeleteInstanceNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getFloatingIpOptions the {@link GetFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIP} */ - public ServiceCall deleteInstanceNetworkAttachment(DeleteInstanceNetworkAttachmentOptions deleteInstanceNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceNetworkAttachmentOptions, - "deleteInstanceNetworkAttachmentOptions cannot be null"); + public ServiceCall getFloatingIp(GetFloatingIpOptions getFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getFloatingIpOptions, + "getFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", deleteInstanceNetworkAttachmentOptions.instanceId()); - pathParamsMap.put("id", deleteInstanceNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceNetworkAttachment"); + pathParamsMap.put("id", getFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an instance network attachment. + * Update a floating IP. * - * This request retrieves a single instance network attachment specified by the identifier in the URL. + * This request updates a floating IP's name and/or target. * - * @param getInstanceNetworkAttachmentOptions the {@link GetInstanceNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceNetworkAttachment} + * @param updateFloatingIpOptions the {@link UpdateFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIP} */ - public ServiceCall getInstanceNetworkAttachment(GetInstanceNetworkAttachmentOptions getInstanceNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceNetworkAttachmentOptions, - "getInstanceNetworkAttachmentOptions cannot be null"); + public ServiceCall updateFloatingIp(UpdateFloatingIpOptions updateFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateFloatingIpOptions, + "updateFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", getInstanceNetworkAttachmentOptions.instanceId()); - pathParamsMap.put("id", getInstanceNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceNetworkAttachment"); + pathParamsMap.put("id", updateFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateFloatingIpOptions.floatingIpPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance network attachment. + * List flow log collectors. * - * This request updates an instance network attachment with the information provided in an instance network interface - * patch object. The instance network attachment patch object is structured in the same way as a retrieved instance - * network attachment and needs to contain only the information to be updated. + * This request lists flow log collectors in the region. A [flow log + * collector](https://cloud.ibm.com/docs/vpc?topic=vpc-flow-logs) summarizes TCP and UDP data sent over the instance + * network interfaces and instance network attachments contained within its target. The collected flow logs are + * written to a cloud object storage bucket, where they can be + * [viewed](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). * - * @param updateInstanceNetworkAttachmentOptions the {@link UpdateInstanceNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceNetworkAttachment} + * @param listFlowLogCollectorsOptions the {@link ListFlowLogCollectorsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FlowLogCollectorCollection} */ - public ServiceCall updateInstanceNetworkAttachment(UpdateInstanceNetworkAttachmentOptions updateInstanceNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceNetworkAttachmentOptions, - "updateInstanceNetworkAttachmentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", updateInstanceNetworkAttachmentOptions.instanceId()); - pathParamsMap.put("id", updateInstanceNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceNetworkAttachment"); + public ServiceCall listFlowLogCollectors(ListFlowLogCollectorsOptions listFlowLogCollectorsOptions) { + if (listFlowLogCollectorsOptions == null) { + listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listFlowLogCollectors"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceNetworkAttachmentOptions.instanceNetworkAttachmentPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listFlowLogCollectorsOptions.start() != null) { + builder.query("start", String.valueOf(listFlowLogCollectorsOptions.start())); + } + if (listFlowLogCollectorsOptions.limit() != null) { + builder.query("limit", String.valueOf(listFlowLogCollectorsOptions.limit())); + } + if (listFlowLogCollectorsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listFlowLogCollectorsOptions.resourceGroupId())); + } + if (listFlowLogCollectorsOptions.name() != null) { + builder.query("name", String.valueOf(listFlowLogCollectorsOptions.name())); + } + if (listFlowLogCollectorsOptions.vpcId() != null) { + builder.query("vpc.id", String.valueOf(listFlowLogCollectorsOptions.vpcId())); + } + if (listFlowLogCollectorsOptions.vpcCrn() != null) { + builder.query("vpc.crn", String.valueOf(listFlowLogCollectorsOptions.vpcCrn())); + } + if (listFlowLogCollectorsOptions.vpcName() != null) { + builder.query("vpc.name", String.valueOf(listFlowLogCollectorsOptions.vpcName())); + } + if (listFlowLogCollectorsOptions.targetId() != null) { + builder.query("target.id", String.valueOf(listFlowLogCollectorsOptions.targetId())); + } + if (listFlowLogCollectorsOptions.targetResourceType() != null) { + builder.query("target.resource_type", String.valueOf(listFlowLogCollectorsOptions.targetResourceType())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List network interfaces on an instance. - * - * This request lists network interfaces on an instance. An instance network interface is an abstract representation - * of a network device and attaches an instance to a single subnet. Each network interface on an instance can attach - * to any subnet in the zone, including subnets that are already attached to the instance. Multiple network interfaces - * on the instance may also attach to the same subnet. + * List flow log collectors. * - * If this instance has network attachments, each returned network interface is a [read-only - * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding - * network attachment and its attached virtual network interface. + * This request lists flow log collectors in the region. A [flow log + * collector](https://cloud.ibm.com/docs/vpc?topic=vpc-flow-logs) summarizes TCP and UDP data sent over the instance + * network interfaces and instance network attachments contained within its target. The collected flow logs are + * written to a cloud object storage bucket, where they can be + * [viewed](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). * - * @param listInstanceNetworkInterfacesOptions the {@link ListInstanceNetworkInterfacesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkInterfaceUnpaginatedCollection} + * @return a {@link ServiceCall} with a result of type {@link FlowLogCollectorCollection} */ - public ServiceCall listInstanceNetworkInterfaces(ListInstanceNetworkInterfacesOptions listInstanceNetworkInterfacesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceNetworkInterfacesOptions, - "listInstanceNetworkInterfacesOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", listInstanceNetworkInterfacesOptions.instanceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceNetworkInterfaces"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listFlowLogCollectors() { + return listFlowLogCollectors(null); } /** - * Create a network interface on an instance. - * - * This request creates a new instance network interface from an instance network interface prototype object. The - * prototype object is structured in the same way as a retrieved instance network interface, and contains the - * information necessary to create the new instance network interface. Any subnet in the instance's VPC may be - * specified. Addresses on the instance network interface must be within the specified subnet's CIDR blocks. + * Create a flow log collector. * - * If this instance has network attachments, each network interface is a [read-only - * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding - * network attachment and its attached virtual network interface, and new network interfaces are not allowed to be - * created. + * This request creates and starts a new flow log collector from a flow log collector prototype object. The prototype + * object is structured in the same way as a retrieved flow log collector, and contains the information necessary to + * create and start the new flow log collector. * - * @param createInstanceNetworkInterfaceOptions the {@link CreateInstanceNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkInterface} + * @param createFlowLogCollectorOptions the {@link CreateFlowLogCollectorOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FlowLogCollector} */ - public ServiceCall createInstanceNetworkInterface(CreateInstanceNetworkInterfaceOptions createInstanceNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceNetworkInterfaceOptions, - "createInstanceNetworkInterfaceOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", createInstanceNetworkInterfaceOptions.instanceId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceNetworkInterface"); + public ServiceCall createFlowLogCollector(CreateFlowLogCollectorOptions createFlowLogCollectorOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createFlowLogCollectorOptions, + "createFlowLogCollectorOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createFlowLogCollector"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -4111,48 +4294,40 @@ public ServiceCall createInstanceNetworkInterface(CreateInstan builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.add("subnet", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceNetworkInterfaceOptions.subnet())); - if (createInstanceNetworkInterfaceOptions.allowIpSpoofing() != null) { - contentJson.addProperty("allow_ip_spoofing", createInstanceNetworkInterfaceOptions.allowIpSpoofing()); + contentJson.add("storage_bucket", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createFlowLogCollectorOptions.storageBucket())); + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createFlowLogCollectorOptions.target())); + if (createFlowLogCollectorOptions.active() != null) { + contentJson.addProperty("active", createFlowLogCollectorOptions.active()); } - if (createInstanceNetworkInterfaceOptions.name() != null) { - contentJson.addProperty("name", createInstanceNetworkInterfaceOptions.name()); + if (createFlowLogCollectorOptions.name() != null) { + contentJson.addProperty("name", createFlowLogCollectorOptions.name()); } - if (createInstanceNetworkInterfaceOptions.primaryIp() != null) { - contentJson.add("primary_ip", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceNetworkInterfaceOptions.primaryIp())); - } - if (createInstanceNetworkInterfaceOptions.securityGroups() != null) { - contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceNetworkInterfaceOptions.securityGroups())); + if (createFlowLogCollectorOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createFlowLogCollectorOptions.resourceGroup())); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance network interface. + * Delete a flow log collector. * - * This request deletes an instance network interface. This operation cannot be reversed. Any floating IPs associated - * with the instance network interface are implicitly disassociated. All flow log collectors with `auto_delete` set to - * `true` targeting the instance network interface are automatically deleted. The primary instance network interface - * is not allowed to be deleted. + * This request stops and deletes a flow log collector. This operation cannot be reversed. * - * If this instance has network attachments, this network interface is a [read-only - * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding - * network attachment and its attached virtual network interface, and is not allowed to be deleted. + * Collected flow logs remain available within the flow log collector's Cloud Object Storage bucket. * - * @param deleteInstanceNetworkInterfaceOptions the {@link DeleteInstanceNetworkInterfaceOptions} containing the options for the call + * @param deleteFlowLogCollectorOptions the {@link DeleteFlowLogCollectorOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteInstanceNetworkInterface(DeleteInstanceNetworkInterfaceOptions deleteInstanceNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceNetworkInterfaceOptions, - "deleteInstanceNetworkInterfaceOptions cannot be null"); + public ServiceCall deleteFlowLogCollector(DeleteFlowLogCollectorOptions deleteFlowLogCollectorOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteFlowLogCollectorOptions, + "deleteFlowLogCollectorOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", deleteInstanceNetworkInterfaceOptions.instanceId()); - pathParamsMap.put("id", deleteInstanceNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceNetworkInterface"); + pathParamsMap.put("id", deleteFlowLogCollectorOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteFlowLogCollector"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -4163,507 +4338,480 @@ public ServiceCall deleteInstanceNetworkInterface(DeleteInstanceNetworkInt } /** - * Retrieve an instance network interface. - * - * This request retrieves a single instance network interface specified by the identifier in the URL. + * Retrieve a flow log collector. * - * If this instance has network attachments, the retrieved network interface is a - * [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its - * corresponding network attachment and its attached virtual network interface. + * This request retrieves a single flow log collector specified by the identifier in the URL. * - * @param getInstanceNetworkInterfaceOptions the {@link GetInstanceNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkInterface} + * @param getFlowLogCollectorOptions the {@link GetFlowLogCollectorOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FlowLogCollector} */ - public ServiceCall getInstanceNetworkInterface(GetInstanceNetworkInterfaceOptions getInstanceNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceNetworkInterfaceOptions, - "getInstanceNetworkInterfaceOptions cannot be null"); + public ServiceCall getFlowLogCollector(GetFlowLogCollectorOptions getFlowLogCollectorOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getFlowLogCollectorOptions, + "getFlowLogCollectorOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", getInstanceNetworkInterfaceOptions.instanceId()); - pathParamsMap.put("id", getInstanceNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceNetworkInterface"); + pathParamsMap.put("id", getFlowLogCollectorOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getFlowLogCollector"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance network interface. - * - * This request updates an instance network interface with the information provided in an instance network interface - * patch object. The instance network interface patch object is structured in the same way as a retrieved instance - * network interface and needs to contain only the information to be updated. + * Update a flow log collector. * - * If this instance has network attachments, this network interface is a [read-only - * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding - * network attachment and its attached virtual network interface, and is not allowed to be updated. + * This request updates a flow log collector with the information in a provided flow log collector patch. The flow log + * collector patch object is structured in the same way as a retrieved flow log collector and contains only the + * information to be updated. * - * @param updateInstanceNetworkInterfaceOptions the {@link UpdateInstanceNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkInterface} + * @param updateFlowLogCollectorOptions the {@link UpdateFlowLogCollectorOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FlowLogCollector} */ - public ServiceCall updateInstanceNetworkInterface(UpdateInstanceNetworkInterfaceOptions updateInstanceNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceNetworkInterfaceOptions, - "updateInstanceNetworkInterfaceOptions cannot be null"); + public ServiceCall updateFlowLogCollector(UpdateFlowLogCollectorOptions updateFlowLogCollectorOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateFlowLogCollectorOptions, + "updateFlowLogCollectorOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", updateInstanceNetworkInterfaceOptions.instanceId()); - pathParamsMap.put("id", updateInstanceNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceNetworkInterface"); + pathParamsMap.put("id", updateFlowLogCollectorOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateFlowLogCollector"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceNetworkInterfaceOptions.networkInterfacePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateFlowLogCollectorOptions.flowLogCollectorPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List floating IPs associated with an instance network interface. + * List regions. * - * This request lists floating IPs associated with an instance network interface. + * This request lists regions. Each region is a separate geographic area that contains multiple isolated zones. + * Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other + * zones in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault + * isolation available. Resources deployed within a single region also benefit from the low latency afforded by + * geographic proximity. * - * @param listInstanceNetworkInterfaceFloatingIpsOptions the {@link ListInstanceNetworkInterfaceFloatingIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIPUnpaginatedCollection} + * @param listRegionsOptions the {@link ListRegionsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RegionCollection} */ - public ServiceCall listInstanceNetworkInterfaceFloatingIps(ListInstanceNetworkInterfaceFloatingIpsOptions listInstanceNetworkInterfaceFloatingIpsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceNetworkInterfaceFloatingIpsOptions, - "listInstanceNetworkInterfaceFloatingIpsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", listInstanceNetworkInterfaceFloatingIpsOptions.instanceId()); - pathParamsMap.put("network_interface_id", listInstanceNetworkInterfaceFloatingIpsOptions.networkInterfaceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceNetworkInterfaceFloatingIps"); + public ServiceCall listRegions(ListRegionsOptions listRegionsOptions) { + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/regions")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listRegions"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Disassociate a floating IP from an instance network interface. + * List regions. * - * This request disassociates the specified floating IP from the specified instance network interface. + * This request lists regions. Each region is a separate geographic area that contains multiple isolated zones. + * Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other + * zones in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault + * isolation available. Resources deployed within a single region also benefit from the low latency afforded by + * geographic proximity. * - * @param removeInstanceNetworkInterfaceFloatingIpOptions the {@link RemoveInstanceNetworkInterfaceFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @return a {@link ServiceCall} with a result of type {@link RegionCollection} */ - public ServiceCall removeInstanceNetworkInterfaceFloatingIp(RemoveInstanceNetworkInterfaceFloatingIpOptions removeInstanceNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(removeInstanceNetworkInterfaceFloatingIpOptions, - "removeInstanceNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall listRegions() { + return listRegions(null); + } + + /** + * Retrieve a region. + * + * This request retrieves a single region specified by the name in the URL. + * + * @param getRegionOptions the {@link GetRegionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Region} + */ + public ServiceCall getRegion(GetRegionOptions getRegionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getRegionOptions, + "getRegionOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", removeInstanceNetworkInterfaceFloatingIpOptions.instanceId()); - pathParamsMap.put("network_interface_id", removeInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId()); - pathParamsMap.put("id", removeInstanceNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeInstanceNetworkInterfaceFloatingIp"); + pathParamsMap.put("name", getRegionOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/regions/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getRegion"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve associated floating IP. + * List zones in a region. * - * This request retrieves a specified floating IP address if it is associated with the instance network interface and - * instance specified in the URL. + * This request lists zones in a region. Zones represent logically-isolated data centers with high-bandwidth and + * low-latency interconnects to other zones in the same region. Faults in a zone do not affect other zones. * - * @param getInstanceNetworkInterfaceFloatingIpOptions the {@link GetInstanceNetworkInterfaceFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIP} + * @param listRegionZonesOptions the {@link ListRegionZonesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ZoneCollection} */ - public ServiceCall getInstanceNetworkInterfaceFloatingIp(GetInstanceNetworkInterfaceFloatingIpOptions getInstanceNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceNetworkInterfaceFloatingIpOptions, - "getInstanceNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall listRegionZones(ListRegionZonesOptions listRegionZonesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listRegionZonesOptions, + "listRegionZonesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", getInstanceNetworkInterfaceFloatingIpOptions.instanceId()); - pathParamsMap.put("network_interface_id", getInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId()); - pathParamsMap.put("id", getInstanceNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceNetworkInterfaceFloatingIp"); + pathParamsMap.put("region_name", listRegionZonesOptions.regionName()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/regions/{region_name}/zones", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listRegionZones"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Associate a floating IP with an instance network interface. - * - * This request associates the specified floating IP with the specified instance network interface, replacing any - * existing association. - * - * The existing floating IP must: - * - not be required by another resource, such as a public gateway - * - be in the same `zone` as the instance + * Retrieve a zone. * - * A request body is not required, and if provided, is ignored. + * This request retrieves a single zone specified by the region and zone names in the URL. * - * @param addInstanceNetworkInterfaceFloatingIpOptions the {@link AddInstanceNetworkInterfaceFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIP} + * @param getRegionZoneOptions the {@link GetRegionZoneOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Zone} */ - public ServiceCall addInstanceNetworkInterfaceFloatingIp(AddInstanceNetworkInterfaceFloatingIpOptions addInstanceNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(addInstanceNetworkInterfaceFloatingIpOptions, - "addInstanceNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall getRegionZone(GetRegionZoneOptions getRegionZoneOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getRegionZoneOptions, + "getRegionZoneOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", addInstanceNetworkInterfaceFloatingIpOptions.instanceId()); - pathParamsMap.put("network_interface_id", addInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId()); - pathParamsMap.put("id", addInstanceNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addInstanceNetworkInterfaceFloatingIp"); + pathParamsMap.put("region_name", getRegionZoneOptions.regionName()); + pathParamsMap.put("name", getRegionZoneOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/regions/{region_name}/zones/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getRegionZone"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List the primary reserved IP for an instance network interface. + * List images. * - * This request lists the primary reserved IP for an instance network interface. + * This request lists images available in the region. An image provides source data for a volume. Images are either + * system-provided, or created from another source, such as importing from Cloud Object Storage. * - * @param listInstanceNetworkInterfaceIpsOptions the {@link ListInstanceNetworkInterfaceIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionInstanceNetworkInterfaceContext} - * @deprecated this method is deprecated and may be removed in a future release + * @param listImagesOptions the {@link ListImagesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ImageCollection} */ - @Deprecated - public ServiceCall listInstanceNetworkInterfaceIps(ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions) { - LOGGER.warning("A deprecated operation has been invoked: listInstanceNetworkInterfaceIps"); - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceNetworkInterfaceIpsOptions, - "listInstanceNetworkInterfaceIpsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", listInstanceNetworkInterfaceIpsOptions.instanceId()); - pathParamsMap.put("network_interface_id", listInstanceNetworkInterfaceIpsOptions.networkInterfaceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceNetworkInterfaceIps"); + public ServiceCall listImages(ListImagesOptions listImagesOptions) { + if (listImagesOptions == null) { + listImagesOptions = new ListImagesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listImages"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listInstanceNetworkInterfaceIpsOptions.start() != null) { - builder.query("start", String.valueOf(listInstanceNetworkInterfaceIpsOptions.start())); + if (listImagesOptions.start() != null) { + builder.query("start", String.valueOf(listImagesOptions.start())); } - if (listInstanceNetworkInterfaceIpsOptions.limit() != null) { - builder.query("limit", String.valueOf(listInstanceNetworkInterfaceIpsOptions.limit())); + if (listImagesOptions.limit() != null) { + builder.query("limit", String.valueOf(listImagesOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listImagesOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listImagesOptions.resourceGroupId())); + } + if (listImagesOptions.name() != null) { + builder.query("name", String.valueOf(listImagesOptions.name())); + } + if (listImagesOptions.status() != null) { + builder.query("status", RequestUtils.join(listImagesOptions.status(), ",")); + } + if (listImagesOptions.visibility() != null) { + builder.query("visibility", String.valueOf(listImagesOptions.visibility())); + } + if (listImagesOptions.userDataFormat() != null) { + builder.query("user_data_format", RequestUtils.join(listImagesOptions.userDataFormat(), ",")); + } + if (listImagesOptions.remoteAccountId() != null) { + builder.query("remote.account.id", String.valueOf(listImagesOptions.remoteAccountId())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve the primary reserved IP. + * List images. * - * This request retrieves the primary reserved IP for an instance network interface. + * This request lists images available in the region. An image provides source data for a volume. Images are either + * system-provided, or created from another source, such as importing from Cloud Object Storage. * - * @param getInstanceNetworkInterfaceIpOptions the {@link GetInstanceNetworkInterfaceIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIP} - * @deprecated this method is deprecated and may be removed in a future release + * @return a {@link ServiceCall} with a result of type {@link ImageCollection} */ - @Deprecated - public ServiceCall getInstanceNetworkInterfaceIp(GetInstanceNetworkInterfaceIpOptions getInstanceNetworkInterfaceIpOptions) { - LOGGER.warning("A deprecated operation has been invoked: getInstanceNetworkInterfaceIp"); - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceNetworkInterfaceIpOptions, - "getInstanceNetworkInterfaceIpOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", getInstanceNetworkInterfaceIpOptions.instanceId()); - pathParamsMap.put("network_interface_id", getInstanceNetworkInterfaceIpOptions.networkInterfaceId()); - pathParamsMap.put("id", getInstanceNetworkInterfaceIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceNetworkInterfaceIp"); + public ServiceCall listImages() { + return listImages(null); + } + + /** + * Create an image. + * + * This request creates a new image from an image prototype object. The prototype object is structured in the same way + * as a retrieved image, and contains the information necessary to create the new image. If an image is being + * imported, a URL to the image file on object storage must be specified. If an image is being created from an + * existing volume, that volume must be specified. + * + * @param createImageOptions the {@link CreateImageOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Image} + */ + public ServiceCall createImage(CreateImageOptions createImageOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createImageOptions, + "createImageOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createImage"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createImageOptions.imagePrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List volumes attachments on an instance. + * Delete an image. * - * This request lists volume attachments on an instance. A volume attachment connects a volume to an instance. Each - * instance may have many volume attachments but each volume attachment connects exactly one instance to exactly one - * volume. + * This request deletes an image. Any active image export jobs will be completed first. This operation cannot be + * reversed. An image with `remote.account` set is not allowed to be deleted. Additionally, an image cannot be deleted + * if it: + * - has a `status` of `deleting` + * - has a `status` of `pending` with a `status_reasons` code of + * `image_request_in_progress` + * - has `catalog_offering.managed` set to `true`. * - * @param listInstanceVolumeAttachmentsOptions the {@link ListInstanceVolumeAttachmentsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VolumeAttachmentCollection} + * @param deleteImageOptions the {@link DeleteImageOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listInstanceVolumeAttachments(ListInstanceVolumeAttachmentsOptions listInstanceVolumeAttachmentsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceVolumeAttachmentsOptions, - "listInstanceVolumeAttachmentsOptions cannot be null"); + public ServiceCall deleteImage(DeleteImageOptions deleteImageOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteImageOptions, + "deleteImageOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", listInstanceVolumeAttachmentsOptions.instanceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceVolumeAttachments"); + pathParamsMap.put("id", deleteImageOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteImage"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Create a volume attachment on an instance. + * Retrieve an image. * - * This request creates a new volume attachment from a volume attachment prototype object, connecting a volume to an - * instance. For this request to succeed, the specified volume must not be busy. The prototype object is structured in - * the same way as a retrieved volume attachment, and contains the information necessary to create the new volume - * attachment. + * This request retrieves a single image specified by the identifier in the URL. * - * @param createInstanceVolumeAttachmentOptions the {@link CreateInstanceVolumeAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VolumeAttachment} + * @param getImageOptions the {@link GetImageOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Image} */ - public ServiceCall createInstanceVolumeAttachment(CreateInstanceVolumeAttachmentOptions createInstanceVolumeAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceVolumeAttachmentOptions, - "createInstanceVolumeAttachmentOptions cannot be null"); + public ServiceCall getImage(GetImageOptions getImageOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getImageOptions, + "getImageOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", createInstanceVolumeAttachmentOptions.instanceId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceVolumeAttachment"); + pathParamsMap.put("id", getImageOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getImage"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("volume", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceVolumeAttachmentOptions.volume())); - if (createInstanceVolumeAttachmentOptions.deleteVolumeOnInstanceDelete() != null) { - contentJson.addProperty("delete_volume_on_instance_delete", createInstanceVolumeAttachmentOptions.deleteVolumeOnInstanceDelete()); - } - if (createInstanceVolumeAttachmentOptions.name() != null) { - contentJson.addProperty("name", createInstanceVolumeAttachmentOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a volume attachment. + * Update an image. * - * This request deletes a volume attachment. This operation cannot be reversed, but a new volume attachment may - * subsequently be created for the volume. For this request to succeed, the volume must not be busy. + * This request updates an image with the information in a provided image patch. The image patch object is structured + * in the same way as a retrieved image and contains only the information to be updated. An image with + * `remote.account` set is not allowed to be updated. An image with a `status` of `deleting` cannot be updated. * - * @param deleteInstanceVolumeAttachmentOptions the {@link DeleteInstanceVolumeAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param updateImageOptions the {@link UpdateImageOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Image} */ - public ServiceCall deleteInstanceVolumeAttachment(DeleteInstanceVolumeAttachmentOptions deleteInstanceVolumeAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceVolumeAttachmentOptions, - "deleteInstanceVolumeAttachmentOptions cannot be null"); + public ServiceCall updateImage(UpdateImageOptions updateImageOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateImageOptions, + "updateImageOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", deleteInstanceVolumeAttachmentOptions.instanceId()); - pathParamsMap.put("id", deleteInstanceVolumeAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceVolumeAttachment"); + pathParamsMap.put("id", updateImageOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateImage"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateImageOptions.imagePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a volume attachment. + * List bare metal server profiles compatible with an image. * - * This request retrieves a single volume attachment specified by the identifier in the URL. + * This request lists bare metal server profiles compatible with an image's + * `allowed_use.bare_metal_server`, `operating_system.architecture` and + * `user_data_format` properties, sorted by ascending `name` property values. * - * @param getInstanceVolumeAttachmentOptions the {@link GetInstanceVolumeAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VolumeAttachment} + * @param listImageBareMetalServerProfilesOptions the {@link ListImageBareMetalServerProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ImageBareMetalServerProfileCollection} */ - public ServiceCall getInstanceVolumeAttachment(GetInstanceVolumeAttachmentOptions getInstanceVolumeAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceVolumeAttachmentOptions, - "getInstanceVolumeAttachmentOptions cannot be null"); + public ServiceCall listImageBareMetalServerProfiles(ListImageBareMetalServerProfilesOptions listImageBareMetalServerProfilesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listImageBareMetalServerProfilesOptions, + "listImageBareMetalServerProfilesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", getInstanceVolumeAttachmentOptions.instanceId()); - pathParamsMap.put("id", getInstanceVolumeAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceVolumeAttachment"); + pathParamsMap.put("id", listImageBareMetalServerProfilesOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}/bare_metal_server_profiles", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listImageBareMetalServerProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listImageBareMetalServerProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listImageBareMetalServerProfilesOptions.start())); + } + if (listImageBareMetalServerProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listImageBareMetalServerProfilesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a volume attachment. + * Deprecate an image. * - * This request updates a volume attachment with the information provided in a volume attachment patch object. The - * volume attachment patch object is structured in the same way as a retrieved volume attachment and needs to contain - * only the information to be updated. + * This request deprecates an image, resulting in its `status` becoming `deprecated` and + * `deprecation_at` being set to the current date and time. * - * @param updateInstanceVolumeAttachmentOptions the {@link UpdateInstanceVolumeAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VolumeAttachment} + * The image must: + * - have a `status` of `available` + * - have `catalog_offering.managed` set to `false` + * - not have `deprecation_at` set + * + * An image with `remote.account` set is not allowed to be deprecated. + * + * @param deprecateImageOptions the {@link DeprecateImageOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updateInstanceVolumeAttachment(UpdateInstanceVolumeAttachmentOptions updateInstanceVolumeAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceVolumeAttachmentOptions, - "updateInstanceVolumeAttachmentOptions cannot be null"); + public ServiceCall deprecateImage(DeprecateImageOptions deprecateImageOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deprecateImageOptions, + "deprecateImageOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_id", updateInstanceVolumeAttachmentOptions.instanceId()); - pathParamsMap.put("id", updateInstanceVolumeAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceVolumeAttachment"); + pathParamsMap.put("id", deprecateImageOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}/deprecate", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deprecateImage"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceVolumeAttachmentOptions.volumeAttachmentPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List instance groups. + * List instance profiles compatible with an image. * - * This request lists instance groups in the region. + * This request lists instance profiles compatible with an image's + * `allowed_use.instance`, `operating_system.architecture` and + * `user_data_format` properties, sorted by ascending `name` property values. * - * @param listInstanceGroupsOptions the {@link ListInstanceGroupsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupCollection} + * @param listImageInstanceProfilesOptions the {@link ListImageInstanceProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ImageInstanceProfileCollection} */ - public ServiceCall listInstanceGroups(ListInstanceGroupsOptions listInstanceGroupsOptions) { - if (listInstanceGroupsOptions == null) { - listInstanceGroupsOptions = new ListInstanceGroupsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroups"); + public ServiceCall listImageInstanceProfiles(ListImageInstanceProfilesOptions listImageInstanceProfilesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listImageInstanceProfilesOptions, + "listImageInstanceProfilesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", listImageInstanceProfilesOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}/instance_profiles", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listImageInstanceProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listInstanceGroupsOptions.start() != null) { - builder.query("start", String.valueOf(listInstanceGroupsOptions.start())); + if (listImageInstanceProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listImageInstanceProfilesOptions.start())); } - if (listInstanceGroupsOptions.limit() != null) { - builder.query("limit", String.valueOf(listInstanceGroupsOptions.limit())); + if (listImageInstanceProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listImageInstanceProfilesOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List instance groups. + * Obsolete an image. * - * This request lists instance groups in the region. + * This request obsoletes an image, resulting in its `status` becoming `obsolete` and + * `obsolescence_at` being set to the current date and time. * - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupCollection} - */ - public ServiceCall listInstanceGroups() { - return listInstanceGroups(null); - } - - /** - * Create an instance group. + * The image must: + * - have a `status` of `available` or `deprecated` + * - have `catalog_offering.managed` set to `false` + * - not have `deprecation_at` set in the future + * - not have `obsolescence_at` set * - * This request creates a new instance group. + * An image with `remote.account` set is not allowed to be obsoleted. * - * @param createInstanceGroupOptions the {@link CreateInstanceGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroup} - */ - public ServiceCall createInstanceGroup(CreateInstanceGroupOptions createInstanceGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceGroupOptions, - "createInstanceGroupOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceGroup"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("instance_template", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.instanceTemplate())); - contentJson.add("subnets", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.subnets())); - if (createInstanceGroupOptions.applicationPort() != null) { - contentJson.addProperty("application_port", createInstanceGroupOptions.applicationPort()); - } - if (createInstanceGroupOptions.loadBalancer() != null) { - contentJson.add("load_balancer", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.loadBalancer())); - } - if (createInstanceGroupOptions.loadBalancerPool() != null) { - contentJson.add("load_balancer_pool", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.loadBalancerPool())); - } - if (createInstanceGroupOptions.membershipCount() != null) { - contentJson.addProperty("membership_count", createInstanceGroupOptions.membershipCount()); - } - if (createInstanceGroupOptions.name() != null) { - contentJson.addProperty("name", createInstanceGroupOptions.name()); - } - if (createInstanceGroupOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.resourceGroup())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete an instance group. - * - * This request deletes an instance group. This operation cannot be reversed. Any instances associated with the group - * will be deleted. - * - * @param deleteInstanceGroupOptions the {@link DeleteInstanceGroupOptions} containing the options for the call + * @param obsoleteImageOptions the {@link ObsoleteImageOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteInstanceGroup(DeleteInstanceGroupOptions deleteInstanceGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupOptions, - "deleteInstanceGroupOptions cannot be null"); + public ServiceCall obsoleteImage(ObsoleteImageOptions obsoleteImageOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(obsoleteImageOptions, + "obsoleteImageOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteInstanceGroupOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroup"); + pathParamsMap.put("id", obsoleteImageOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{id}/obsolete", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "obsoleteImage"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -4674,74 +4822,95 @@ public ServiceCall deleteInstanceGroup(DeleteInstanceGroupOptions deleteIn } /** - * Retrieve an instance group. + * List export jobs for an image. * - * This request retrieves a single instance group specified by identifier in the URL. + * This request lists export jobs for an image. Each job tracks the exporting of the image to another location, such + * as a bucket within cloud object storage. * - * @param getInstanceGroupOptions the {@link GetInstanceGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroup} + * The jobs will be sorted by their `created_at` property values, with newest jobs first. Jobs with identical + * `created_at` property values will in turn be sorted by ascending + * `name` property values. + * + * @param listImageExportJobsOptions the {@link ListImageExportJobsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ImageExportJobUnpaginatedCollection} */ - public ServiceCall getInstanceGroup(GetInstanceGroupOptions getInstanceGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupOptions, - "getInstanceGroupOptions cannot be null"); + public ServiceCall listImageExportJobs(ListImageExportJobsOptions listImageExportJobsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listImageExportJobsOptions, + "listImageExportJobsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getInstanceGroupOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroup"); + pathParamsMap.put("image_id", listImageExportJobsOptions.imageId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listImageExportJobs"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listImageExportJobsOptions.name() != null) { + builder.query("name", String.valueOf(listImageExportJobsOptions.name())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance group. + * Create an export job for an image. * - * This request updates an instance group with the information provided instance group patch. The instance group patch - * object is structured in the same way as a retrieved instance group and contains only the information to be updated. + * This request creates and queues a new export job for the image specified in the URL using the image export job + * prototype object. The image must be owned by the account and be in the `available`, `deprecated`, `obsolete`, or + * `unusable` state. The prototype object is structured in the same way as a retrieved image export job, and contains + * the information necessary to create and queue the new image export job. * - * @param updateInstanceGroupOptions the {@link UpdateInstanceGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroup} + * @param createImageExportJobOptions the {@link CreateImageExportJobOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ImageExportJob} */ - public ServiceCall updateInstanceGroup(UpdateInstanceGroupOptions updateInstanceGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupOptions, - "updateInstanceGroupOptions cannot be null"); + public ServiceCall createImageExportJob(CreateImageExportJobOptions createImageExportJobOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createImageExportJobOptions, + "createImageExportJobOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateInstanceGroupOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroup"); + pathParamsMap.put("image_id", createImageExportJobOptions.imageId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createImageExportJob"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupOptions.instanceGroupPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("storage_bucket", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createImageExportJobOptions.storageBucket())); + if (createImageExportJobOptions.format() != null) { + contentJson.addProperty("format", createImageExportJobOptions.format()); + } + if (createImageExportJobOptions.name() != null) { + contentJson.addProperty("name", createImageExportJobOptions.name()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance group load balancer. + * Delete an image export job. * - * This request unbinds the instance group from the load balancer pool, and deletes the load balancer pool members. + * This request deletes an image export job. This operation cannot be reversed. If the job has not completed, the job + * will be canceled, and the incomplete exported image object deleted. If the job has completed, the exported image + * object will not be deleted. * - * @param deleteInstanceGroupLoadBalancerOptions the {@link DeleteInstanceGroupLoadBalancerOptions} containing the options for the call + * @param deleteImageExportJobOptions the {@link DeleteImageExportJobOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteInstanceGroupLoadBalancer(DeleteInstanceGroupLoadBalancerOptions deleteInstanceGroupLoadBalancerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupLoadBalancerOptions, - "deleteInstanceGroupLoadBalancerOptions cannot be null"); + public ServiceCall deleteImageExportJob(DeleteImageExportJobOptions deleteImageExportJobOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteImageExportJobOptions, + "deleteImageExportJobOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", deleteInstanceGroupLoadBalancerOptions.instanceGroupId()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/load_balancer", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupLoadBalancer"); + pathParamsMap.put("image_id", deleteImageExportJobOptions.imageId()); + pathParamsMap.put("id", deleteImageExportJobOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteImageExportJob"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -4752,222 +4921,234 @@ public ServiceCall deleteInstanceGroupLoadBalancer(DeleteInstanceGroupLoad } /** - * List managers for an instance group. + * Retrieve an image export job. * - * This request lists managers for an instance group. + * This request retrieves a single image export job specified by the identifier in the URL. * - * @param listInstanceGroupManagersOptions the {@link ListInstanceGroupManagersOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerCollection} + * @param getImageExportJobOptions the {@link GetImageExportJobOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ImageExportJob} */ - public ServiceCall listInstanceGroupManagers(ListInstanceGroupManagersOptions listInstanceGroupManagersOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceGroupManagersOptions, - "listInstanceGroupManagersOptions cannot be null"); + public ServiceCall getImageExportJob(GetImageExportJobOptions getImageExportJobOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getImageExportJobOptions, + "getImageExportJobOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", listInstanceGroupManagersOptions.instanceGroupId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroupManagers"); + pathParamsMap.put("image_id", getImageExportJobOptions.imageId()); + pathParamsMap.put("id", getImageExportJobOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getImageExportJob"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listInstanceGroupManagersOptions.start() != null) { - builder.query("start", String.valueOf(listInstanceGroupManagersOptions.start())); - } - if (listInstanceGroupManagersOptions.limit() != null) { - builder.query("limit", String.valueOf(listInstanceGroupManagersOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a manager for an instance group. + * Update an image export job. * - * This request creates a new instance group manager. + * This request updates an image export job with the information in a provided image export job patch. The image + * export job patch object is structured in the same way as a retrieved image export job and contains only the + * information to be updated. * - * @param createInstanceGroupManagerOptions the {@link CreateInstanceGroupManagerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManager} + * @param updateImageExportJobOptions the {@link UpdateImageExportJobOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ImageExportJob} */ - public ServiceCall createInstanceGroupManager(CreateInstanceGroupManagerOptions createInstanceGroupManagerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceGroupManagerOptions, - "createInstanceGroupManagerOptions cannot be null"); + public ServiceCall updateImageExportJob(UpdateImageExportJobOptions updateImageExportJobOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateImageExportJobOptions, + "updateImageExportJobOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", createInstanceGroupManagerOptions.instanceGroupId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceGroupManager"); + pathParamsMap.put("image_id", updateImageExportJobOptions.imageId()); + pathParamsMap.put("id", updateImageExportJobOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/images/{image_id}/export_jobs/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateImageExportJob"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceGroupManagerOptions.instanceGroupManagerPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateImageExportJobOptions.imageExportJobPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance group manager. + * List operating systems. * - * This request deletes an instance group manager. This operation cannot be reversed. + * This request lists operating systems in the region. * - * @param deleteInstanceGroupManagerOptions the {@link DeleteInstanceGroupManagerOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listOperatingSystemsOptions the {@link ListOperatingSystemsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link OperatingSystemCollection} */ - public ServiceCall deleteInstanceGroupManager(DeleteInstanceGroupManagerOptions deleteInstanceGroupManagerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupManagerOptions, - "deleteInstanceGroupManagerOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", deleteInstanceGroupManagerOptions.instanceGroupId()); - pathParamsMap.put("id", deleteInstanceGroupManagerOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupManager"); + public ServiceCall listOperatingSystems(ListOperatingSystemsOptions listOperatingSystemsOptions) { + if (listOperatingSystemsOptions == null) { + listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/operating_systems")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listOperatingSystems"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listOperatingSystemsOptions.start() != null) { + builder.query("start", String.valueOf(listOperatingSystemsOptions.start())); + } + if (listOperatingSystemsOptions.limit() != null) { + builder.query("limit", String.valueOf(listOperatingSystemsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an instance group manager. + * List operating systems. * - * This request retrieves a single instance group manager specified by identifier in the URL. + * This request lists operating systems in the region. * - * @param getInstanceGroupManagerOptions the {@link GetInstanceGroupManagerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManager} + * @return a {@link ServiceCall} with a result of type {@link OperatingSystemCollection} */ - public ServiceCall getInstanceGroupManager(GetInstanceGroupManagerOptions getInstanceGroupManagerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupManagerOptions, - "getInstanceGroupManagerOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", getInstanceGroupManagerOptions.instanceGroupId()); - pathParamsMap.put("id", getInstanceGroupManagerOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroupManager"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listOperatingSystems() { + return listOperatingSystems(null); } /** - * Update an instance group manager. + * Retrieve an operating system. * - * This request updates an instance group manager with the information provided instance group manager patch. + * This request retrieves a single operating system specified by the name in the URL. * - * @param updateInstanceGroupManagerOptions the {@link UpdateInstanceGroupManagerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManager} + * @param getOperatingSystemOptions the {@link GetOperatingSystemOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link OperatingSystem} */ - public ServiceCall updateInstanceGroupManager(UpdateInstanceGroupManagerOptions updateInstanceGroupManagerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupManagerOptions, - "updateInstanceGroupManagerOptions cannot be null"); + public ServiceCall getOperatingSystem(GetOperatingSystemOptions getOperatingSystemOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getOperatingSystemOptions, + "getOperatingSystemOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", updateInstanceGroupManagerOptions.instanceGroupId()); - pathParamsMap.put("id", updateInstanceGroupManagerOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroupManager"); + pathParamsMap.put("name", getOperatingSystemOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/operating_systems/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getOperatingSystem"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupManagerOptions.instanceGroupManagerPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List actions for an instance group manager. + * List instance groups. * - * This request lists instance group actions for an instance group manager. + * This request lists instance groups in the region. * - * @param listInstanceGroupManagerActionsOptions the {@link ListInstanceGroupManagerActionsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerActionsCollection} + * @param listInstanceGroupsOptions the {@link ListInstanceGroupsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupCollection} */ - public ServiceCall listInstanceGroupManagerActions(ListInstanceGroupManagerActionsOptions listInstanceGroupManagerActionsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceGroupManagerActionsOptions, - "listInstanceGroupManagerActionsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", listInstanceGroupManagerActionsOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", listInstanceGroupManagerActionsOptions.instanceGroupManagerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroupManagerActions"); + public ServiceCall listInstanceGroups(ListInstanceGroupsOptions listInstanceGroupsOptions) { + if (listInstanceGroupsOptions == null) { + listInstanceGroupsOptions = new ListInstanceGroupsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroups"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listInstanceGroupManagerActionsOptions.start() != null) { - builder.query("start", String.valueOf(listInstanceGroupManagerActionsOptions.start())); + if (listInstanceGroupsOptions.start() != null) { + builder.query("start", String.valueOf(listInstanceGroupsOptions.start())); } - if (listInstanceGroupManagerActionsOptions.limit() != null) { - builder.query("limit", String.valueOf(listInstanceGroupManagerActionsOptions.limit())); + if (listInstanceGroupsOptions.limit() != null) { + builder.query("limit", String.valueOf(listInstanceGroupsOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create an instance group manager action. + * List instance groups. * - * This request creates a new instance group manager action. + * This request lists instance groups in the region. * - * @param createInstanceGroupManagerActionOptions the {@link CreateInstanceGroupManagerActionOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerAction} + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupCollection} */ - public ServiceCall createInstanceGroupManagerAction(CreateInstanceGroupManagerActionOptions createInstanceGroupManagerActionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceGroupManagerActionOptions, - "createInstanceGroupManagerActionOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", createInstanceGroupManagerActionOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", createInstanceGroupManagerActionOptions.instanceGroupManagerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceGroupManagerAction"); + public ServiceCall listInstanceGroups() { + return listInstanceGroups(null); + } + + /** + * Create an instance group. + * + * This request creates a new instance group. + * + * @param createInstanceGroupOptions the {@link CreateInstanceGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroup} + */ + public ServiceCall createInstanceGroup(CreateInstanceGroupOptions createInstanceGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceGroupOptions, + "createInstanceGroupOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceGroupManagerActionOptions.instanceGroupManagerActionPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("instance_template", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.instanceTemplate())); + contentJson.add("subnets", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.subnets())); + if (createInstanceGroupOptions.applicationPort() != null) { + contentJson.addProperty("application_port", createInstanceGroupOptions.applicationPort()); + } + if (createInstanceGroupOptions.loadBalancer() != null) { + contentJson.add("load_balancer", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.loadBalancer())); + } + if (createInstanceGroupOptions.loadBalancerPool() != null) { + contentJson.add("load_balancer_pool", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.loadBalancerPool())); + } + if (createInstanceGroupOptions.membershipCount() != null) { + contentJson.addProperty("membership_count", createInstanceGroupOptions.membershipCount()); + } + if (createInstanceGroupOptions.name() != null) { + contentJson.addProperty("name", createInstanceGroupOptions.name()); + } + if (createInstanceGroupOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceGroupOptions.resourceGroup())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete specified instance group manager action. + * Delete an instance group. * - * This request deletes an instance group manager action. This operation cannot be reversed. + * This request deletes an instance group. This operation cannot be reversed. Any instances associated with the group + * will be deleted. * - * @param deleteInstanceGroupManagerActionOptions the {@link DeleteInstanceGroupManagerActionOptions} containing the options for the call + * @param deleteInstanceGroupOptions the {@link DeleteInstanceGroupOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteInstanceGroupManagerAction(DeleteInstanceGroupManagerActionOptions deleteInstanceGroupManagerActionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupManagerActionOptions, - "deleteInstanceGroupManagerActionOptions cannot be null"); + public ServiceCall deleteInstanceGroup(DeleteInstanceGroupOptions deleteInstanceGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupOptions, + "deleteInstanceGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", deleteInstanceGroupManagerActionOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", deleteInstanceGroupManagerActionOptions.instanceGroupManagerId()); - pathParamsMap.put("id", deleteInstanceGroupManagerActionOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupManagerAction"); + pathParamsMap.put("id", deleteInstanceGroupOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -4978,545 +5159,526 @@ public ServiceCall deleteInstanceGroupManagerAction(DeleteInstanceGroupMan } /** - * Retrieve specified instance group manager action. + * Retrieve an instance group. * - * This request retrieves a single instance group manager action specified by identifier in the URL. + * This request retrieves a single instance group specified by identifier in the URL. * - * @param getInstanceGroupManagerActionOptions the {@link GetInstanceGroupManagerActionOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerAction} + * @param getInstanceGroupOptions the {@link GetInstanceGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroup} */ - public ServiceCall getInstanceGroupManagerAction(GetInstanceGroupManagerActionOptions getInstanceGroupManagerActionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupManagerActionOptions, - "getInstanceGroupManagerActionOptions cannot be null"); + public ServiceCall getInstanceGroup(GetInstanceGroupOptions getInstanceGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupOptions, + "getInstanceGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", getInstanceGroupManagerActionOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", getInstanceGroupManagerActionOptions.instanceGroupManagerId()); - pathParamsMap.put("id", getInstanceGroupManagerActionOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroupManagerAction"); + pathParamsMap.put("id", getInstanceGroupOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update specified instance group manager action. + * Update an instance group. * - * This request updates an instance group manager action. + * This request updates an instance group with the information provided instance group patch. The instance group patch + * object is structured in the same way as a retrieved instance group and contains only the information to be updated. * - * @param updateInstanceGroupManagerActionOptions the {@link UpdateInstanceGroupManagerActionOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerAction} + * @param updateInstanceGroupOptions the {@link UpdateInstanceGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroup} */ - public ServiceCall updateInstanceGroupManagerAction(UpdateInstanceGroupManagerActionOptions updateInstanceGroupManagerActionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupManagerActionOptions, - "updateInstanceGroupManagerActionOptions cannot be null"); + public ServiceCall updateInstanceGroup(UpdateInstanceGroupOptions updateInstanceGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupOptions, + "updateInstanceGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", updateInstanceGroupManagerActionOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", updateInstanceGroupManagerActionOptions.instanceGroupManagerId()); - pathParamsMap.put("id", updateInstanceGroupManagerActionOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroupManagerAction"); + pathParamsMap.put("id", updateInstanceGroupOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupManagerActionOptions.instanceGroupManagerActionPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupOptions.instanceGroupPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List policies for an instance group manager. + * Delete an instance group load balancer. * - * This request lists policies for an instance group manager. + * This request unbinds the instance group from the load balancer pool, and deletes the load balancer pool members. * - * @param listInstanceGroupManagerPoliciesOptions the {@link ListInstanceGroupManagerPoliciesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerPolicyCollection} + * @param deleteInstanceGroupLoadBalancerOptions the {@link DeleteInstanceGroupLoadBalancerOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listInstanceGroupManagerPolicies(ListInstanceGroupManagerPoliciesOptions listInstanceGroupManagerPoliciesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceGroupManagerPoliciesOptions, - "listInstanceGroupManagerPoliciesOptions cannot be null"); + public ServiceCall deleteInstanceGroupLoadBalancer(DeleteInstanceGroupLoadBalancerOptions deleteInstanceGroupLoadBalancerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupLoadBalancerOptions, + "deleteInstanceGroupLoadBalancerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", listInstanceGroupManagerPoliciesOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", listInstanceGroupManagerPoliciesOptions.instanceGroupManagerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroupManagerPolicies"); + pathParamsMap.put("instance_group_id", deleteInstanceGroupLoadBalancerOptions.instanceGroupId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/load_balancer", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupLoadBalancer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listInstanceGroupManagerPoliciesOptions.start() != null) { - builder.query("start", String.valueOf(listInstanceGroupManagerPoliciesOptions.start())); - } - if (listInstanceGroupManagerPoliciesOptions.limit() != null) { - builder.query("limit", String.valueOf(listInstanceGroupManagerPoliciesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Create a policy for an instance group manager. + * List managers for an instance group. * - * This request creates a new instance group manager policy. + * This request lists managers for an instance group. * - * @param createInstanceGroupManagerPolicyOptions the {@link CreateInstanceGroupManagerPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerPolicy} + * @param listInstanceGroupManagersOptions the {@link ListInstanceGroupManagersOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerCollection} */ - public ServiceCall createInstanceGroupManagerPolicy(CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceGroupManagerPolicyOptions, - "createInstanceGroupManagerPolicyOptions cannot be null"); + public ServiceCall listInstanceGroupManagers(ListInstanceGroupManagersOptions listInstanceGroupManagersOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceGroupManagersOptions, + "listInstanceGroupManagersOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", createInstanceGroupManagerPolicyOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", createInstanceGroupManagerPolicyOptions.instanceGroupManagerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceGroupManagerPolicy"); - for (Entry header : sdkHeaders.entrySet()) { + pathParamsMap.put("instance_group_id", listInstanceGroupManagersOptions.instanceGroupId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroupManagers"); + for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceGroupManagerPolicyOptions.instanceGroupManagerPolicyPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listInstanceGroupManagersOptions.start() != null) { + builder.query("start", String.valueOf(listInstanceGroupManagersOptions.start())); + } + if (listInstanceGroupManagersOptions.limit() != null) { + builder.query("limit", String.valueOf(listInstanceGroupManagersOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance group manager policy. + * Create a manager for an instance group. * - * This request deletes an instance group manager policy. This operation cannot be reversed. + * This request creates a new instance group manager. * - * @param deleteInstanceGroupManagerPolicyOptions the {@link DeleteInstanceGroupManagerPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param createInstanceGroupManagerOptions the {@link CreateInstanceGroupManagerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManager} */ - public ServiceCall deleteInstanceGroupManagerPolicy(DeleteInstanceGroupManagerPolicyOptions deleteInstanceGroupManagerPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupManagerPolicyOptions, - "deleteInstanceGroupManagerPolicyOptions cannot be null"); + public ServiceCall createInstanceGroupManager(CreateInstanceGroupManagerOptions createInstanceGroupManagerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceGroupManagerOptions, + "createInstanceGroupManagerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", deleteInstanceGroupManagerPolicyOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", deleteInstanceGroupManagerPolicyOptions.instanceGroupManagerId()); - pathParamsMap.put("id", deleteInstanceGroupManagerPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupManagerPolicy"); + pathParamsMap.put("instance_group_id", createInstanceGroupManagerOptions.instanceGroupId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceGroupManager"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceGroupManagerOptions.instanceGroupManagerPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an instance group manager policy. + * Delete an instance group manager. * - * This request retrieves a single instance group manager policy specified by identifier in the URL. + * This request deletes an instance group manager. This operation cannot be reversed. * - * @param getInstanceGroupManagerPolicyOptions the {@link GetInstanceGroupManagerPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerPolicy} + * @param deleteInstanceGroupManagerOptions the {@link DeleteInstanceGroupManagerOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getInstanceGroupManagerPolicy(GetInstanceGroupManagerPolicyOptions getInstanceGroupManagerPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupManagerPolicyOptions, - "getInstanceGroupManagerPolicyOptions cannot be null"); + public ServiceCall deleteInstanceGroupManager(DeleteInstanceGroupManagerOptions deleteInstanceGroupManagerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupManagerOptions, + "deleteInstanceGroupManagerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", getInstanceGroupManagerPolicyOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", getInstanceGroupManagerPolicyOptions.instanceGroupManagerId()); - pathParamsMap.put("id", getInstanceGroupManagerPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroupManagerPolicy"); + pathParamsMap.put("instance_group_id", deleteInstanceGroupManagerOptions.instanceGroupId()); + pathParamsMap.put("id", deleteInstanceGroupManagerOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupManager"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance group manager policy. + * Retrieve an instance group manager. * - * This request updates an instance group manager policy. + * This request retrieves a single instance group manager specified by identifier in the URL. * - * @param updateInstanceGroupManagerPolicyOptions the {@link UpdateInstanceGroupManagerPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerPolicy} + * @param getInstanceGroupManagerOptions the {@link GetInstanceGroupManagerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManager} */ - public ServiceCall updateInstanceGroupManagerPolicy(UpdateInstanceGroupManagerPolicyOptions updateInstanceGroupManagerPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupManagerPolicyOptions, - "updateInstanceGroupManagerPolicyOptions cannot be null"); + public ServiceCall getInstanceGroupManager(GetInstanceGroupManagerOptions getInstanceGroupManagerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupManagerOptions, + "getInstanceGroupManagerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", updateInstanceGroupManagerPolicyOptions.instanceGroupId()); - pathParamsMap.put("instance_group_manager_id", updateInstanceGroupManagerPolicyOptions.instanceGroupManagerId()); - pathParamsMap.put("id", updateInstanceGroupManagerPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroupManagerPolicy"); + pathParamsMap.put("instance_group_id", getInstanceGroupManagerOptions.instanceGroupId()); + pathParamsMap.put("id", getInstanceGroupManagerOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroupManager"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupManagerPolicyOptions.instanceGroupManagerPolicyPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete memberships from an instance group. + * Update an instance group manager. * - * This request deletes memberships of an instance group. This operation cannot be reversed. Memberships that have - * `delete_instance_on_membership_delete` set to `true` will also have their instances deleted. + * This request updates an instance group manager with the information provided instance group manager patch. * - * @param deleteInstanceGroupMembershipsOptions the {@link DeleteInstanceGroupMembershipsOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param updateInstanceGroupManagerOptions the {@link UpdateInstanceGroupManagerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManager} */ - public ServiceCall deleteInstanceGroupMemberships(DeleteInstanceGroupMembershipsOptions deleteInstanceGroupMembershipsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupMembershipsOptions, - "deleteInstanceGroupMembershipsOptions cannot be null"); + public ServiceCall updateInstanceGroupManager(UpdateInstanceGroupManagerOptions updateInstanceGroupManagerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupManagerOptions, + "updateInstanceGroupManagerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", deleteInstanceGroupMembershipsOptions.instanceGroupId()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupMemberships"); + pathParamsMap.put("instance_group_id", updateInstanceGroupManagerOptions.instanceGroupId()); + pathParamsMap.put("id", updateInstanceGroupManagerOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroupManager"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupManagerOptions.instanceGroupManagerPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List memberships for an instance group. + * List actions for an instance group manager. * - * This request lists instance group memberships for an instance group. + * This request lists instance group actions for an instance group manager. * - * @param listInstanceGroupMembershipsOptions the {@link ListInstanceGroupMembershipsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupMembershipCollection} + * @param listInstanceGroupManagerActionsOptions the {@link ListInstanceGroupManagerActionsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerActionsCollection} */ - public ServiceCall listInstanceGroupMemberships(ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceGroupMembershipsOptions, - "listInstanceGroupMembershipsOptions cannot be null"); + public ServiceCall listInstanceGroupManagerActions(ListInstanceGroupManagerActionsOptions listInstanceGroupManagerActionsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceGroupManagerActionsOptions, + "listInstanceGroupManagerActionsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", listInstanceGroupMembershipsOptions.instanceGroupId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroupMemberships"); + pathParamsMap.put("instance_group_id", listInstanceGroupManagerActionsOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", listInstanceGroupManagerActionsOptions.instanceGroupManagerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroupManagerActions"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listInstanceGroupMembershipsOptions.start() != null) { - builder.query("start", String.valueOf(listInstanceGroupMembershipsOptions.start())); + if (listInstanceGroupManagerActionsOptions.start() != null) { + builder.query("start", String.valueOf(listInstanceGroupManagerActionsOptions.start())); } - if (listInstanceGroupMembershipsOptions.limit() != null) { - builder.query("limit", String.valueOf(listInstanceGroupMembershipsOptions.limit())); + if (listInstanceGroupManagerActionsOptions.limit() != null) { + builder.query("limit", String.valueOf(listInstanceGroupManagerActionsOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an instance group membership. + * Create an instance group manager action. * - * This request deletes a memberships of an instance group. This operation cannot be reversed. reversed. If the - * membership has `delete_instance_on_membership_delete` set to `true`, the instance will also be deleted. + * This request creates a new instance group manager action. * - * @param deleteInstanceGroupMembershipOptions the {@link DeleteInstanceGroupMembershipOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param createInstanceGroupManagerActionOptions the {@link CreateInstanceGroupManagerActionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerAction} */ - public ServiceCall deleteInstanceGroupMembership(DeleteInstanceGroupMembershipOptions deleteInstanceGroupMembershipOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupMembershipOptions, - "deleteInstanceGroupMembershipOptions cannot be null"); + public ServiceCall createInstanceGroupManagerAction(CreateInstanceGroupManagerActionOptions createInstanceGroupManagerActionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceGroupManagerActionOptions, + "createInstanceGroupManagerActionOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", deleteInstanceGroupMembershipOptions.instanceGroupId()); - pathParamsMap.put("id", deleteInstanceGroupMembershipOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupMembership"); + pathParamsMap.put("instance_group_id", createInstanceGroupManagerActionOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", createInstanceGroupManagerActionOptions.instanceGroupManagerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceGroupManagerAction"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceGroupManagerActionOptions.instanceGroupManagerActionPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an instance group membership. + * Delete specified instance group manager action. * - * This request retrieves a single instance group membership specified by identifier in the URL. + * This request deletes an instance group manager action. This operation cannot be reversed. * - * @param getInstanceGroupMembershipOptions the {@link GetInstanceGroupMembershipOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupMembership} + * @param deleteInstanceGroupManagerActionOptions the {@link DeleteInstanceGroupManagerActionOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getInstanceGroupMembership(GetInstanceGroupMembershipOptions getInstanceGroupMembershipOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupMembershipOptions, - "getInstanceGroupMembershipOptions cannot be null"); + public ServiceCall deleteInstanceGroupManagerAction(DeleteInstanceGroupManagerActionOptions deleteInstanceGroupManagerActionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupManagerActionOptions, + "deleteInstanceGroupManagerActionOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", getInstanceGroupMembershipOptions.instanceGroupId()); - pathParamsMap.put("id", getInstanceGroupMembershipOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroupMembership"); + pathParamsMap.put("instance_group_id", deleteInstanceGroupManagerActionOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", deleteInstanceGroupManagerActionOptions.instanceGroupManagerId()); + pathParamsMap.put("id", deleteInstanceGroupManagerActionOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupManagerAction"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update an instance group membership. + * Retrieve specified instance group manager action. * - * This request updates an instance group membership with the information provided instance group membership patch. + * This request retrieves a single instance group manager action specified by identifier in the URL. * - * @param updateInstanceGroupMembershipOptions the {@link UpdateInstanceGroupMembershipOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link InstanceGroupMembership} + * @param getInstanceGroupManagerActionOptions the {@link GetInstanceGroupManagerActionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerAction} */ - public ServiceCall updateInstanceGroupMembership(UpdateInstanceGroupMembershipOptions updateInstanceGroupMembershipOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupMembershipOptions, - "updateInstanceGroupMembershipOptions cannot be null"); + public ServiceCall getInstanceGroupManagerAction(GetInstanceGroupManagerActionOptions getInstanceGroupManagerActionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupManagerActionOptions, + "getInstanceGroupManagerActionOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("instance_group_id", updateInstanceGroupMembershipOptions.instanceGroupId()); - pathParamsMap.put("id", updateInstanceGroupMembershipOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroupMembership"); + pathParamsMap.put("instance_group_id", getInstanceGroupManagerActionOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", getInstanceGroupManagerActionOptions.instanceGroupManagerId()); + pathParamsMap.put("id", getInstanceGroupManagerActionOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroupManagerAction"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupMembershipOptions.instanceGroupMembershipPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List reservations. - * - * This request lists reservations in the region. A reservation provides reserved capacity for a specified profile in - * a specified zone. A reservation can also include a long-term committed use discount. + * Update specified instance group manager action. * - * The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations - * with identical `created_at` property values will in turn be sorted by ascending `name` property values. + * This request updates an instance group manager action. * - * @param listReservationsOptions the {@link ListReservationsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservationCollection} + * @param updateInstanceGroupManagerActionOptions the {@link UpdateInstanceGroupManagerActionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerAction} */ - public ServiceCall listReservations(ListReservationsOptions listReservationsOptions) { - if (listReservationsOptions == null) { - listReservationsOptions = new ListReservationsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listReservations"); + public ServiceCall updateInstanceGroupManagerAction(UpdateInstanceGroupManagerActionOptions updateInstanceGroupManagerActionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupManagerActionOptions, + "updateInstanceGroupManagerActionOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_group_id", updateInstanceGroupManagerActionOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", updateInstanceGroupManagerActionOptions.instanceGroupManagerId()); + pathParamsMap.put("id", updateInstanceGroupManagerActionOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/actions/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroupManagerAction"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listReservationsOptions.start() != null) { - builder.query("start", String.valueOf(listReservationsOptions.start())); - } - if (listReservationsOptions.limit() != null) { - builder.query("limit", String.valueOf(listReservationsOptions.limit())); - } - if (listReservationsOptions.name() != null) { - builder.query("name", String.valueOf(listReservationsOptions.name())); - } - if (listReservationsOptions.profileResourceType() != null) { - builder.query("profile.resource_type", String.valueOf(listReservationsOptions.profileResourceType())); - } - if (listReservationsOptions.affinityPolicy() != null) { - builder.query("affinity_policy", String.valueOf(listReservationsOptions.affinityPolicy())); - } - if (listReservationsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listReservationsOptions.resourceGroupId())); - } - if (listReservationsOptions.zoneName() != null) { - builder.query("zone.name", String.valueOf(listReservationsOptions.zoneName())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupManagerActionOptions.instanceGroupManagerActionPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List reservations. - * - * This request lists reservations in the region. A reservation provides reserved capacity for a specified profile in - * a specified zone. A reservation can also include a long-term committed use discount. + * List policies for an instance group manager. * - * The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations - * with identical `created_at` property values will in turn be sorted by ascending `name` property values. + * This request lists policies for an instance group manager. * - * @return a {@link ServiceCall} with a result of type {@link ReservationCollection} + * @param listInstanceGroupManagerPoliciesOptions the {@link ListInstanceGroupManagerPoliciesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerPolicyCollection} */ - public ServiceCall listReservations() { - return listReservations(null); + public ServiceCall listInstanceGroupManagerPolicies(ListInstanceGroupManagerPoliciesOptions listInstanceGroupManagerPoliciesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceGroupManagerPoliciesOptions, + "listInstanceGroupManagerPoliciesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_group_id", listInstanceGroupManagerPoliciesOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", listInstanceGroupManagerPoliciesOptions.instanceGroupManagerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroupManagerPolicies"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + if (listInstanceGroupManagerPoliciesOptions.start() != null) { + builder.query("start", String.valueOf(listInstanceGroupManagerPoliciesOptions.start())); + } + if (listInstanceGroupManagerPoliciesOptions.limit() != null) { + builder.query("limit", String.valueOf(listInstanceGroupManagerPoliciesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); } /** - * Create a reservation. + * Create a policy for an instance group manager. * - * This request creates a new reservation from a reservation prototype object. The prototype object is structured in - * the same way as a retrieved reservation, and contains the information necessary to create the new reservation. + * This request creates a new instance group manager policy. * - * @param createReservationOptions the {@link CreateReservationOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Reservation} + * @param createInstanceGroupManagerPolicyOptions the {@link CreateInstanceGroupManagerPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerPolicy} */ - public ServiceCall createReservation(CreateReservationOptions createReservationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createReservationOptions, - "createReservationOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createReservation"); + public ServiceCall createInstanceGroupManagerPolicy(CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceGroupManagerPolicyOptions, + "createInstanceGroupManagerPolicyOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_group_id", createInstanceGroupManagerPolicyOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", createInstanceGroupManagerPolicyOptions.instanceGroupManagerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceGroupManagerPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("capacity", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.capacity())); - contentJson.add("committed_use", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.committedUse())); - contentJson.add("profile", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.profile())); - contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.zone())); - if (createReservationOptions.affinityPolicy() != null) { - contentJson.addProperty("affinity_policy", createReservationOptions.affinityPolicy()); - } - if (createReservationOptions.name() != null) { - contentJson.addProperty("name", createReservationOptions.name()); - } - if (createReservationOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.resourceGroup())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceGroupManagerPolicyOptions.instanceGroupManagerPolicyPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a reservation. + * Delete an instance group manager policy. * - * This request deletes a reservation. This operation cannot be reversed. Reservations with a `status` of `active` are - * not allowed to be deleted. + * This request deletes an instance group manager policy. This operation cannot be reversed. * - * @param deleteReservationOptions the {@link DeleteReservationOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Reservation} + * @param deleteInstanceGroupManagerPolicyOptions the {@link DeleteInstanceGroupManagerPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteReservation(DeleteReservationOptions deleteReservationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteReservationOptions, - "deleteReservationOptions cannot be null"); + public ServiceCall deleteInstanceGroupManagerPolicy(DeleteInstanceGroupManagerPolicyOptions deleteInstanceGroupManagerPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupManagerPolicyOptions, + "deleteInstanceGroupManagerPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteReservationOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteReservation"); + pathParamsMap.put("instance_group_id", deleteInstanceGroupManagerPolicyOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", deleteInstanceGroupManagerPolicyOptions.instanceGroupManagerId()); + pathParamsMap.put("id", deleteInstanceGroupManagerPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupManagerPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a reservation. + * Retrieve an instance group manager policy. * - * This request retrieves a single reservation specified by identifier in the URL. + * This request retrieves a single instance group manager policy specified by identifier in the URL. * - * @param getReservationOptions the {@link GetReservationOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Reservation} + * @param getInstanceGroupManagerPolicyOptions the {@link GetInstanceGroupManagerPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerPolicy} */ - public ServiceCall getReservation(GetReservationOptions getReservationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getReservationOptions, - "getReservationOptions cannot be null"); + public ServiceCall getInstanceGroupManagerPolicy(GetInstanceGroupManagerPolicyOptions getInstanceGroupManagerPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupManagerPolicyOptions, + "getInstanceGroupManagerPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getReservationOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getReservation"); + pathParamsMap.put("instance_group_id", getInstanceGroupManagerPolicyOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", getInstanceGroupManagerPolicyOptions.instanceGroupManagerId()); + pathParamsMap.put("id", getInstanceGroupManagerPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroupManagerPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a reservation. + * Update an instance group manager policy. * - * This request updates a reservation with the information provided in a reservation patch object. The patch object is - * structured in the same way as a retrieved reservation and needs to contain only the information to be updated. + * This request updates an instance group manager policy. * - * @param updateReservationOptions the {@link UpdateReservationOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Reservation} + * @param updateInstanceGroupManagerPolicyOptions the {@link UpdateInstanceGroupManagerPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupManagerPolicy} */ - public ServiceCall updateReservation(UpdateReservationOptions updateReservationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateReservationOptions, - "updateReservationOptions cannot be null"); + public ServiceCall updateInstanceGroupManagerPolicy(UpdateInstanceGroupManagerPolicyOptions updateInstanceGroupManagerPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupManagerPolicyOptions, + "updateInstanceGroupManagerPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateReservationOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateReservation"); + pathParamsMap.put("instance_group_id", updateInstanceGroupManagerPolicyOptions.instanceGroupId()); + pathParamsMap.put("instance_group_manager_id", updateInstanceGroupManagerPolicyOptions.instanceGroupManagerId()); + pathParamsMap.put("id", updateInstanceGroupManagerPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/managers/{instance_group_manager_id}/policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroupManagerPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateReservationOptions.reservationPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupManagerPolicyOptions.instanceGroupManagerPolicyPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Activate a reservation. + * Delete memberships from an instance group. * - * This request activates a reservation. For this request to succeed, the reservation status must be `inactive`. + * This request deletes memberships of an instance group. This operation cannot be reversed. Memberships that have + * `delete_instance_on_membership_delete` set to `true` will also have their instances deleted. * - * @param activateReservationOptions the {@link ActivateReservationOptions} containing the options for the call + * @param deleteInstanceGroupMembershipsOptions the {@link DeleteInstanceGroupMembershipsOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall activateReservation(ActivateReservationOptions activateReservationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(activateReservationOptions, - "activateReservationOptions cannot be null"); + public ServiceCall deleteInstanceGroupMemberships(DeleteInstanceGroupMembershipsOptions deleteInstanceGroupMembershipsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupMembershipsOptions, + "deleteInstanceGroupMembershipsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", activateReservationOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations/{id}/activate", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "activateReservation"); + pathParamsMap.put("instance_group_id", deleteInstanceGroupMembershipsOptions.instanceGroupId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupMemberships"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -5527,423 +5689,477 @@ public ServiceCall activateReservation(ActivateReservationOptions activate } /** - * List dedicated host groups. + * List memberships for an instance group. * - * This request lists dedicated host groups in the region. Each dedicated host must belong to exactly one group, which - * controls placement of instances. Dedicated host groups do not span zones. + * This request lists instance group memberships for an instance group. * - * @param listDedicatedHostGroupsOptions the {@link ListDedicatedHostGroupsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroupCollection} + * @param listInstanceGroupMembershipsOptions the {@link ListInstanceGroupMembershipsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupMembershipCollection} */ - public ServiceCall listDedicatedHostGroups(ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions) { - if (listDedicatedHostGroupsOptions == null) { - listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listDedicatedHostGroups"); + public ServiceCall listInstanceGroupMemberships(ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceGroupMembershipsOptions, + "listInstanceGroupMembershipsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_group_id", listInstanceGroupMembershipsOptions.instanceGroupId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceGroupMemberships"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listDedicatedHostGroupsOptions.start() != null) { - builder.query("start", String.valueOf(listDedicatedHostGroupsOptions.start())); - } - if (listDedicatedHostGroupsOptions.limit() != null) { - builder.query("limit", String.valueOf(listDedicatedHostGroupsOptions.limit())); - } - if (listDedicatedHostGroupsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listDedicatedHostGroupsOptions.resourceGroupId())); - } - if (listDedicatedHostGroupsOptions.zoneName() != null) { - builder.query("zone.name", String.valueOf(listDedicatedHostGroupsOptions.zoneName())); + if (listInstanceGroupMembershipsOptions.start() != null) { + builder.query("start", String.valueOf(listInstanceGroupMembershipsOptions.start())); } - if (listDedicatedHostGroupsOptions.name() != null) { - builder.query("name", String.valueOf(listDedicatedHostGroupsOptions.name())); + if (listInstanceGroupMembershipsOptions.limit() != null) { + builder.query("limit", String.valueOf(listInstanceGroupMembershipsOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List dedicated host groups. - * - * This request lists dedicated host groups in the region. Each dedicated host must belong to exactly one group, which - * controls placement of instances. Dedicated host groups do not span zones. - * - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroupCollection} - */ - public ServiceCall listDedicatedHostGroups() { - return listDedicatedHostGroups(null); - } - - /** - * Create a dedicated host group. + * Delete an instance group membership. * - * This request creates a new dedicated host group. + * This request deletes a memberships of an instance group. This operation cannot be reversed. reversed. If the + * membership has `delete_instance_on_membership_delete` set to `true`, the instance will also be deleted. * - * @param createDedicatedHostGroupOptions the {@link CreateDedicatedHostGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroup} + * @param deleteInstanceGroupMembershipOptions the {@link DeleteInstanceGroupMembershipOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createDedicatedHostGroup(CreateDedicatedHostGroupOptions createDedicatedHostGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createDedicatedHostGroupOptions, - "createDedicatedHostGroupOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createDedicatedHostGroup"); + public ServiceCall deleteInstanceGroupMembership(DeleteInstanceGroupMembershipOptions deleteInstanceGroupMembershipOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceGroupMembershipOptions, + "deleteInstanceGroupMembershipOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_group_id", deleteInstanceGroupMembershipOptions.instanceGroupId()); + pathParamsMap.put("id", deleteInstanceGroupMembershipOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceGroupMembership"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("class", createDedicatedHostGroupOptions.xClass()); - contentJson.addProperty("family", createDedicatedHostGroupOptions.family()); - contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createDedicatedHostGroupOptions.zone())); - if (createDedicatedHostGroupOptions.name() != null) { - contentJson.addProperty("name", createDedicatedHostGroupOptions.name()); - } - if (createDedicatedHostGroupOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createDedicatedHostGroupOptions.resourceGroup())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a dedicated host group. + * Retrieve an instance group membership. * - * This request deletes a dedicated host group. + * This request retrieves a single instance group membership specified by identifier in the URL. * - * @param deleteDedicatedHostGroupOptions the {@link DeleteDedicatedHostGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getInstanceGroupMembershipOptions the {@link GetInstanceGroupMembershipOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupMembership} */ - public ServiceCall deleteDedicatedHostGroup(DeleteDedicatedHostGroupOptions deleteDedicatedHostGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteDedicatedHostGroupOptions, - "deleteDedicatedHostGroupOptions cannot be null"); + public ServiceCall getInstanceGroupMembership(GetInstanceGroupMembershipOptions getInstanceGroupMembershipOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceGroupMembershipOptions, + "getInstanceGroupMembershipOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteDedicatedHostGroupOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteDedicatedHostGroup"); + pathParamsMap.put("instance_group_id", getInstanceGroupMembershipOptions.instanceGroupId()); + pathParamsMap.put("id", getInstanceGroupMembershipOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceGroupMembership"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a dedicated host group. + * Update an instance group membership. * - * This request retrieves a single dedicated host group specified by the identifier in the URL. + * This request updates an instance group membership with the information provided instance group membership patch. * - * @param getDedicatedHostGroupOptions the {@link GetDedicatedHostGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroup} + * @param updateInstanceGroupMembershipOptions the {@link UpdateInstanceGroupMembershipOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceGroupMembership} */ - public ServiceCall getDedicatedHostGroup(GetDedicatedHostGroupOptions getDedicatedHostGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getDedicatedHostGroupOptions, - "getDedicatedHostGroupOptions cannot be null"); + public ServiceCall updateInstanceGroupMembership(UpdateInstanceGroupMembershipOptions updateInstanceGroupMembershipOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceGroupMembershipOptions, + "updateInstanceGroupMembershipOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getDedicatedHostGroupOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getDedicatedHostGroup"); + pathParamsMap.put("instance_group_id", updateInstanceGroupMembershipOptions.instanceGroupId()); + pathParamsMap.put("id", updateInstanceGroupMembershipOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance_groups/{instance_group_id}/memberships/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceGroupMembership"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceGroupMembershipOptions.instanceGroupMembershipPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a dedicated host group. + * List instance templates. * - * This request updates a dedicated host group with the information in a provided dedicated host group patch. The - * dedicated host group patch object is structured in the same way as a retrieved dedicated host group and contains - * only the information to be updated. + * This request lists instance templates in the region. * - * @param updateDedicatedHostGroupOptions the {@link UpdateDedicatedHostGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostGroup} + * @param listInstanceTemplatesOptions the {@link ListInstanceTemplatesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceTemplateCollection} */ - public ServiceCall updateDedicatedHostGroup(UpdateDedicatedHostGroupOptions updateDedicatedHostGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateDedicatedHostGroupOptions, - "updateDedicatedHostGroupOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateDedicatedHostGroupOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateDedicatedHostGroup"); + public ServiceCall listInstanceTemplates(ListInstanceTemplatesOptions listInstanceTemplatesOptions) { + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceTemplates"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateDedicatedHostGroupOptions.dedicatedHostGroupPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List dedicated host profiles. + * List instance templates. * - * This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in - * the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. + * This request lists instance templates in the region. * - * @param listDedicatedHostProfilesOptions the {@link ListDedicatedHostProfilesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostProfileCollection} + * @return a {@link ServiceCall} with a result of type {@link InstanceTemplateCollection} */ - public ServiceCall listDedicatedHostProfiles(ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions) { - if (listDedicatedHostProfilesOptions == null) { - listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/profiles")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listDedicatedHostProfiles"); + public ServiceCall listInstanceTemplates() { + return listInstanceTemplates(null); + } + + /** + * Create an instance template. + * + * This request creates a new instance template. The prototype object is structured in the same way as a retrieved + * instance template, and contains the information necessary to provision a new instance from the template. + * + * If a `source_template` is specified in the prototype object, its contents are copied into the new template prior to + * copying any other properties provided in the prototype object. + * + * @param createInstanceTemplateOptions the {@link CreateInstanceTemplateOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceTemplate} + */ + public ServiceCall createInstanceTemplate(CreateInstanceTemplateOptions createInstanceTemplateOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceTemplateOptions, + "createInstanceTemplateOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceTemplate"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listDedicatedHostProfilesOptions.start() != null) { - builder.query("start", String.valueOf(listDedicatedHostProfilesOptions.start())); - } - if (listDedicatedHostProfilesOptions.limit() != null) { - builder.query("limit", String.valueOf(listDedicatedHostProfilesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceTemplateOptions.instanceTemplatePrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List dedicated host profiles. + * Delete an instance template. * - * This request lists provisionable [dedicated host profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-dh-profiles) in - * the region. A dedicated host profile specifies the hardware characteristics for a dedicated host. + * This request deletes the instance template. This operation cannot be reversed. * - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostProfileCollection} + * @param deleteInstanceTemplateOptions the {@link DeleteInstanceTemplateOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listDedicatedHostProfiles() { - return listDedicatedHostProfiles(null); + public ServiceCall deleteInstanceTemplate(DeleteInstanceTemplateOptions deleteInstanceTemplateOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceTemplateOptions, + "deleteInstanceTemplateOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", deleteInstanceTemplateOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceTemplate"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a dedicated host profile. + * Retrieve an instance template. * - * This request retrieves a single dedicated host profile specified by the name in the URL. + * This request retrieves a single instance template specified by the identifier in the URL. * - * @param getDedicatedHostProfileOptions the {@link GetDedicatedHostProfileOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostProfile} + * @param getInstanceTemplateOptions the {@link GetInstanceTemplateOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceTemplate} */ - public ServiceCall getDedicatedHostProfile(GetDedicatedHostProfileOptions getDedicatedHostProfileOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getDedicatedHostProfileOptions, - "getDedicatedHostProfileOptions cannot be null"); + public ServiceCall getInstanceTemplate(GetInstanceTemplateOptions getInstanceTemplateOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceTemplateOptions, + "getInstanceTemplateOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getDedicatedHostProfileOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_host/profiles/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getDedicatedHostProfile"); + pathParamsMap.put("id", getInstanceTemplateOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceTemplate"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List dedicated hosts. + * Update an instance template. * - * This request lists dedicated hosts in the region. + * This request updates an instance template with the information provided in the instance template patch. The + * instance template patch object is structured in the same way as a retrieved instance template and contains only the + * information to be updated. * - * @param listDedicatedHostsOptions the {@link ListDedicatedHostsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostCollection} + * @param updateInstanceTemplateOptions the {@link UpdateInstanceTemplateOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceTemplate} */ - public ServiceCall listDedicatedHosts(ListDedicatedHostsOptions listDedicatedHostsOptions) { - if (listDedicatedHostsOptions == null) { - listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listDedicatedHosts"); + public ServiceCall updateInstanceTemplate(UpdateInstanceTemplateOptions updateInstanceTemplateOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceTemplateOptions, + "updateInstanceTemplateOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", updateInstanceTemplateOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/templates/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceTemplate"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listDedicatedHostsOptions.dedicatedHostGroupId() != null) { - builder.query("dedicated_host_group.id", String.valueOf(listDedicatedHostsOptions.dedicatedHostGroupId())); - } - if (listDedicatedHostsOptions.start() != null) { - builder.query("start", String.valueOf(listDedicatedHostsOptions.start())); - } - if (listDedicatedHostsOptions.limit() != null) { - builder.query("limit", String.valueOf(listDedicatedHostsOptions.limit())); - } - if (listDedicatedHostsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listDedicatedHostsOptions.resourceGroupId())); - } - if (listDedicatedHostsOptions.zoneName() != null) { - builder.query("zone.name", String.valueOf(listDedicatedHostsOptions.zoneName())); - } - if (listDedicatedHostsOptions.name() != null) { - builder.query("name", String.valueOf(listDedicatedHostsOptions.name())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceTemplateOptions.instanceTemplatePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List dedicated hosts. - * - * This request lists dedicated hosts in the region. - * - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostCollection} - */ - public ServiceCall listDedicatedHosts() { - return listDedicatedHosts(null); - } - - /** - * Create a dedicated host. + * List instance profiles. * - * This request creates a new dedicated host. + * This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the + * region. An instance profile specifies the performance characteristics and pricing model for an instance. * - * @param createDedicatedHostOptions the {@link CreateDedicatedHostOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHost} + * @param listInstanceProfilesOptions the {@link ListInstanceProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceProfileCollection} */ - public ServiceCall createDedicatedHost(CreateDedicatedHostOptions createDedicatedHostOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createDedicatedHostOptions, - "createDedicatedHostOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createDedicatedHost"); + public ServiceCall listInstanceProfiles(ListInstanceProfilesOptions listInstanceProfilesOptions) { + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createDedicatedHostOptions.dedicatedHostPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List disks on a dedicated host. + * List instance profiles. * - * This request lists disks on a dedicated host. A disk is a physical device that is locally attached to the compute - * node. By default, the listed disks are sorted by their - * `created_at` property values, with the newest disk first. + * This request lists provisionable [instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) in the + * region. An instance profile specifies the performance characteristics and pricing model for an instance. * - * @param listDedicatedHostDisksOptions the {@link ListDedicatedHostDisksOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostDiskCollection} + * @return a {@link ServiceCall} with a result of type {@link InstanceProfileCollection} */ - public ServiceCall listDedicatedHostDisks(ListDedicatedHostDisksOptions listDedicatedHostDisksOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listDedicatedHostDisksOptions, - "listDedicatedHostDisksOptions cannot be null"); + public ServiceCall listInstanceProfiles() { + return listInstanceProfiles(null); + } + + /** + * Retrieve an instance profile. + * + * This request retrieves a single instance profile specified by the name in the URL. + * + * @param getInstanceProfileOptions the {@link GetInstanceProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceProfile} + */ + public ServiceCall getInstanceProfile(GetInstanceProfileOptions getInstanceProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceProfileOptions, + "getInstanceProfileOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("dedicated_host_id", listDedicatedHostDisksOptions.dedicatedHostId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{dedicated_host_id}/disks", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listDedicatedHostDisks"); + pathParamsMap.put("name", getInstanceProfileOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instance/profiles/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceProfile"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a dedicated host disk. + * List instances. * - * This request retrieves a single dedicated host disk specified by the identifier in the URL. + * This request lists instances in the region. * - * @param getDedicatedHostDiskOptions the {@link GetDedicatedHostDiskOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostDisk} + * @param listInstancesOptions the {@link ListInstancesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceCollection} */ - public ServiceCall getDedicatedHostDisk(GetDedicatedHostDiskOptions getDedicatedHostDiskOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getDedicatedHostDiskOptions, - "getDedicatedHostDiskOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("dedicated_host_id", getDedicatedHostDiskOptions.dedicatedHostId()); - pathParamsMap.put("id", getDedicatedHostDiskOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{dedicated_host_id}/disks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getDedicatedHostDisk"); + public ServiceCall listInstances(ListInstancesOptions listInstancesOptions) { + if (listInstancesOptions == null) { + listInstancesOptions = new ListInstancesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstances"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listInstancesOptions.start() != null) { + builder.query("start", String.valueOf(listInstancesOptions.start())); + } + if (listInstancesOptions.limit() != null) { + builder.query("limit", String.valueOf(listInstancesOptions.limit())); + } + if (listInstancesOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listInstancesOptions.resourceGroupId())); + } + if (listInstancesOptions.name() != null) { + builder.query("name", String.valueOf(listInstancesOptions.name())); + } + if (listInstancesOptions.clusterNetworkId() != null) { + builder.query("cluster_network.id", String.valueOf(listInstancesOptions.clusterNetworkId())); + } + if (listInstancesOptions.clusterNetworkCrn() != null) { + builder.query("cluster_network.crn", String.valueOf(listInstancesOptions.clusterNetworkCrn())); + } + if (listInstancesOptions.clusterNetworkName() != null) { + builder.query("cluster_network.name", String.valueOf(listInstancesOptions.clusterNetworkName())); + } + if (listInstancesOptions.dedicatedHostId() != null) { + builder.query("dedicated_host.id", String.valueOf(listInstancesOptions.dedicatedHostId())); + } + if (listInstancesOptions.dedicatedHostCrn() != null) { + builder.query("dedicated_host.crn", String.valueOf(listInstancesOptions.dedicatedHostCrn())); + } + if (listInstancesOptions.dedicatedHostName() != null) { + builder.query("dedicated_host.name", String.valueOf(listInstancesOptions.dedicatedHostName())); + } + if (listInstancesOptions.instanceGroupMembershipInstanceGroupId() != null) { + builder.query("instance_group_membership.instance_group.id", String.valueOf(listInstancesOptions.instanceGroupMembershipInstanceGroupId())); + } + if (listInstancesOptions.instanceGroupMembershipInstanceGroupCrn() != null) { + builder.query("instance_group_membership.instance_group.crn", String.valueOf(listInstancesOptions.instanceGroupMembershipInstanceGroupCrn())); + } + if (listInstancesOptions.placementGroupId() != null) { + builder.query("placement_group.id", String.valueOf(listInstancesOptions.placementGroupId())); + } + if (listInstancesOptions.placementGroupCrn() != null) { + builder.query("placement_group.crn", String.valueOf(listInstancesOptions.placementGroupCrn())); + } + if (listInstancesOptions.placementGroupName() != null) { + builder.query("placement_group.name", String.valueOf(listInstancesOptions.placementGroupName())); + } + if (listInstancesOptions.reservationAffinityPolicy() != null) { + builder.query("reservation_affinity.policy", String.valueOf(listInstancesOptions.reservationAffinityPolicy())); + } + if (listInstancesOptions.reservationId() != null) { + builder.query("reservation.id", String.valueOf(listInstancesOptions.reservationId())); + } + if (listInstancesOptions.reservationCrn() != null) { + builder.query("reservation.crn", String.valueOf(listInstancesOptions.reservationCrn())); + } + if (listInstancesOptions.reservationName() != null) { + builder.query("reservation.name", String.valueOf(listInstancesOptions.reservationName())); + } + if (listInstancesOptions.vpcId() != null) { + builder.query("vpc.id", String.valueOf(listInstancesOptions.vpcId())); + } + if (listInstancesOptions.vpcCrn() != null) { + builder.query("vpc.crn", String.valueOf(listInstancesOptions.vpcCrn())); + } + if (listInstancesOptions.vpcName() != null) { + builder.query("vpc.name", String.valueOf(listInstancesOptions.vpcName())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a dedicated host disk. + * List instances. * - * This request updates the dedicated host disk with the information in a provided patch. + * This request lists instances in the region. * - * @param updateDedicatedHostDiskOptions the {@link UpdateDedicatedHostDiskOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHostDisk} + * @return a {@link ServiceCall} with a result of type {@link InstanceCollection} */ - public ServiceCall updateDedicatedHostDisk(UpdateDedicatedHostDiskOptions updateDedicatedHostDiskOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateDedicatedHostDiskOptions, - "updateDedicatedHostDiskOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("dedicated_host_id", updateDedicatedHostDiskOptions.dedicatedHostId()); - pathParamsMap.put("id", updateDedicatedHostDiskOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{dedicated_host_id}/disks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateDedicatedHostDisk"); + public ServiceCall listInstances() { + return listInstances(null); + } + + /** + * Create an instance. + * + * This request provisions a new instance from an instance prototype object. The prototype object is structured in the + * same way as a retrieved instance, and contains the information necessary to provision the new instance. The + * instance is automatically started. + * + * For this request to succeed, the properties in the request must adhere to the source's + * `allowed_use` property. + * + * @param createInstanceOptions the {@link CreateInstanceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Instance} + */ + public ServiceCall createInstance(CreateInstanceOptions createInstanceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceOptions, + "createInstanceOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstance"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateDedicatedHostDiskOptions.dedicatedHostDiskPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createInstanceOptions.instancePrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a dedicated host. + * Delete an instance. * - * This request deletes a dedicated host. This operation cannot be reversed. For this request to succeed, `instances` - * must be empty and `instance_placement_enabled` must be `false`. + * This request deletes an instance. This operation cannot be reversed. Any floating IPs associated with instance + * network interfaces are implicitly disassociated. All virtual network interfaces with `auto_delete` set to `true` + * targeting instance network attachments on the instance are automatically deleted. All flow log collectors with + * `auto_delete` set to `true` targeting the instance, the instance network attachments, the instance network + * interfaces, or the automatically deleted virtual network interfaces are automatically deleted. * - * @param deleteDedicatedHostOptions the {@link DeleteDedicatedHostOptions} containing the options for the call + * @param deleteInstanceOptions the {@link DeleteInstanceOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteDedicatedHost(DeleteDedicatedHostOptions deleteDedicatedHostOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteDedicatedHostOptions, - "deleteDedicatedHostOptions cannot be null"); + public ServiceCall deleteInstance(DeleteInstanceOptions deleteInstanceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceOptions, + "deleteInstanceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteDedicatedHostOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteDedicatedHost"); + pathParamsMap.put("id", deleteInstanceOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstance"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + if (deleteInstanceOptions.ifMatch() != null) { + builder.header("If-Match", deleteInstanceOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); @@ -5951,115 +6167,108 @@ public ServiceCall deleteDedicatedHost(DeleteDedicatedHostOptions deleteDe } /** - * Retrieve a dedicated host. + * Retrieve an instance. * - * This request retrieves a single dedicated host specified by the identifiers in the URL. + * This request retrieves a single instance specified by the identifier in the URL. * - * @param getDedicatedHostOptions the {@link GetDedicatedHostOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHost} + * @param getInstanceOptions the {@link GetInstanceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Instance} */ - public ServiceCall getDedicatedHost(GetDedicatedHostOptions getDedicatedHostOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getDedicatedHostOptions, - "getDedicatedHostOptions cannot be null"); + public ServiceCall getInstance(GetInstanceOptions getInstanceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceOptions, + "getInstanceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getDedicatedHostOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getDedicatedHost"); - for (Entry header : sdkHeaders.entrySet()) { + pathParamsMap.put("id", getInstanceOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstance"); + for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a dedicated host. + * Update an instance. * - * This request updates a dedicated host with the information in a provided dedicated host patch. The dedicated host - * patch object is structured in the same way as a retrieved dedicated host and contains only the information to be - * updated. + * This request updates an instance with the information in a provided instance patch. The instance patch object is + * structured in the same way as a retrieved instance and contains only the information to be updated. * - * @param updateDedicatedHostOptions the {@link UpdateDedicatedHostOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DedicatedHost} + * For this request to succeed, the properties in the request must adhere to the + * `allowed_use` property in the volume referenced by `boot_volume_attachment.volume`. + * + * @param updateInstanceOptions the {@link UpdateInstanceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Instance} */ - public ServiceCall updateDedicatedHost(UpdateDedicatedHostOptions updateDedicatedHostOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateDedicatedHostOptions, - "updateDedicatedHostOptions cannot be null"); + public ServiceCall updateInstance(UpdateInstanceOptions updateInstanceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceOptions, + "updateInstanceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateDedicatedHostOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/dedicated_hosts/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateDedicatedHost"); + pathParamsMap.put("id", updateInstanceOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstance"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateInstanceOptions.ifMatch() != null) { + builder.header("If-Match", updateInstanceOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateDedicatedHostOptions.dedicatedHostPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceOptions.instancePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List placement groups. + * Retrieve initialization configuration for an instance. * - * This request lists placement groups in the region. + * This request retrieves configuration used to initialize the instance, such as SSH keys and the Windows + * administrator password. These can subsequently be changed on the instance and therefore may not be current. * - * @param listPlacementGroupsOptions the {@link ListPlacementGroupsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PlacementGroupCollection} + * @param getInstanceInitializationOptions the {@link GetInstanceInitializationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceInitialization} */ - public ServiceCall listPlacementGroups(ListPlacementGroupsOptions listPlacementGroupsOptions) { - if (listPlacementGroupsOptions == null) { - listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPlacementGroups"); + public ServiceCall getInstanceInitialization(GetInstanceInitializationOptions getInstanceInitializationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceInitializationOptions, + "getInstanceInitializationOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getInstanceInitializationOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{id}/initialization", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceInitialization"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listPlacementGroupsOptions.start() != null) { - builder.query("start", String.valueOf(listPlacementGroupsOptions.start())); - } - if (listPlacementGroupsOptions.limit() != null) { - builder.query("limit", String.valueOf(listPlacementGroupsOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List placement groups. - * - * This request lists placement groups in the region. - * - * @return a {@link ServiceCall} with a result of type {@link PlacementGroupCollection} - */ - public ServiceCall listPlacementGroups() { - return listPlacementGroups(null); - } - - /** - * Create a placement group. + * Create an instance action. * - * This request creates a new placement group. + * This request creates a new action which will be queued up to run as soon as any pending or running actions have + * completed. * - * @param createPlacementGroupOptions the {@link CreatePlacementGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PlacementGroup} + * @param createInstanceActionOptions the {@link CreateInstanceActionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceAction} */ - public ServiceCall createPlacementGroup(CreatePlacementGroupOptions createPlacementGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createPlacementGroupOptions, - "createPlacementGroupOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPlacementGroup"); + public ServiceCall createInstanceAction(CreateInstanceActionOptions createInstanceActionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceActionOptions, + "createInstanceActionOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_id", createInstanceActionOptions.instanceId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/actions", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceAction"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -6067,723 +6276,638 @@ public ServiceCall createPlacementGroup(CreatePlacementGroupOpti builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("strategy", createPlacementGroupOptions.strategy()); - if (createPlacementGroupOptions.name() != null) { - contentJson.addProperty("name", createPlacementGroupOptions.name()); - } - if (createPlacementGroupOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPlacementGroupOptions.resourceGroup())); + contentJson.addProperty("type", createInstanceActionOptions.type()); + if (createInstanceActionOptions.force() != null) { + contentJson.addProperty("force", createInstanceActionOptions.force()); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a placement group. + * List cluster network attachments on an instance. * - * This request deletes a placement group. This operation cannot be reversed. For this request to succeed, the - * placement group must not be associated with an instance. + * This request lists cluster network attachments on an instance. A cluster network attachment represents a device on + * the instance to which a cluster network interface is attached. * - * @param deletePlacementGroupOptions the {@link DeletePlacementGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listInstanceClusterNetworkAttachmentsOptions the {@link ListInstanceClusterNetworkAttachmentsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachmentCollection} */ - public ServiceCall deletePlacementGroup(DeletePlacementGroupOptions deletePlacementGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deletePlacementGroupOptions, - "deletePlacementGroupOptions cannot be null"); + public ServiceCall listInstanceClusterNetworkAttachments(ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceClusterNetworkAttachmentsOptions, + "listInstanceClusterNetworkAttachmentsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deletePlacementGroupOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePlacementGroup"); + pathParamsMap.put("instance_id", listInstanceClusterNetworkAttachmentsOptions.instanceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceClusterNetworkAttachments"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listInstanceClusterNetworkAttachmentsOptions.start() != null) { + builder.query("start", String.valueOf(listInstanceClusterNetworkAttachmentsOptions.start())); + } + if (listInstanceClusterNetworkAttachmentsOptions.limit() != null) { + builder.query("limit", String.valueOf(listInstanceClusterNetworkAttachmentsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a placement group. + * Create a cluster network attachment. * - * This request retrieves a single placement group specified by identifier in the URL. + * This request creates a cluster network attachment from an instance cluster network attachment prototype object. A + * cluster network attachment will attach the instance to a cluster network. The cluster network attachment prototype + * must specify a cluster network interface identity or a cluster network interface prototype. * - * @param getPlacementGroupOptions the {@link GetPlacementGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PlacementGroup} + * The instance must be in a `stopped` or `stopping` state to create an instance cluster network attachment. + * + * @param createClusterNetworkAttachmentOptions the {@link CreateClusterNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachment} */ - public ServiceCall getPlacementGroup(GetPlacementGroupOptions getPlacementGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getPlacementGroupOptions, - "getPlacementGroupOptions cannot be null"); + public ServiceCall createClusterNetworkAttachment(CreateClusterNetworkAttachmentOptions createClusterNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkAttachmentOptions, + "createClusterNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getPlacementGroupOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPlacementGroup"); + pathParamsMap.put("instance_id", createClusterNetworkAttachmentOptions.instanceId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("cluster_network_interface", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkAttachmentOptions.clusterNetworkInterface())); + if (createClusterNetworkAttachmentOptions.before() != null) { + contentJson.add("before", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkAttachmentOptions.before())); + } + if (createClusterNetworkAttachmentOptions.name() != null) { + contentJson.addProperty("name", createClusterNetworkAttachmentOptions.name()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a placement group. + * Delete an instance cluster network attachment. * - * This request updates a placement group with the information provided placement group patch. The placement group - * patch object is structured in the same way as a retrieved placement group and contains only the information to be - * updated. + * This request deletes an instance cluster network attachment. The instance must be in a + * `stopped` or `stopping` state to delete an instance cluster network attachment. * - * @param updatePlacementGroupOptions the {@link UpdatePlacementGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PlacementGroup} + * This operation cannot be reversed. + * + * @param deleteInstanceClusterNetworkAttachmentOptions the {@link DeleteInstanceClusterNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachment} */ - public ServiceCall updatePlacementGroup(UpdatePlacementGroupOptions updatePlacementGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updatePlacementGroupOptions, - "updatePlacementGroupOptions cannot be null"); + public ServiceCall deleteInstanceClusterNetworkAttachment(DeleteInstanceClusterNetworkAttachmentOptions deleteInstanceClusterNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceClusterNetworkAttachmentOptions, + "deleteInstanceClusterNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updatePlacementGroupOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePlacementGroup"); + pathParamsMap.put("instance_id", deleteInstanceClusterNetworkAttachmentOptions.instanceId()); + pathParamsMap.put("id", deleteInstanceClusterNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceClusterNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePlacementGroupOptions.placementGroupPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List bare metal server profiles. + * Retrieve an instance cluster network attachment. * - * This request lists [bare metal server - * profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare - * metal server profile specifies the performance characteristics and pricing model for a bare metal server. + * This request retrieves a single instance cluster network attachment specified by the identifier in the URL. * - * @param listBareMetalServerProfilesOptions the {@link ListBareMetalServerProfilesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerProfileCollection} + * @param getInstanceClusterNetworkAttachmentOptions the {@link GetInstanceClusterNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachment} */ - public ServiceCall listBareMetalServerProfiles(ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions) { - if (listBareMetalServerProfilesOptions == null) { - listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_server/profiles")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerProfiles"); + public ServiceCall getInstanceClusterNetworkAttachment(GetInstanceClusterNetworkAttachmentOptions getInstanceClusterNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceClusterNetworkAttachmentOptions, + "getInstanceClusterNetworkAttachmentOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_id", getInstanceClusterNetworkAttachmentOptions.instanceId()); + pathParamsMap.put("id", getInstanceClusterNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceClusterNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listBareMetalServerProfilesOptions.start() != null) { - builder.query("start", String.valueOf(listBareMetalServerProfilesOptions.start())); - } - if (listBareMetalServerProfilesOptions.limit() != null) { - builder.query("limit", String.valueOf(listBareMetalServerProfilesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List bare metal server profiles. + * Update an instance cluster network attachment. * - * This request lists [bare metal server - * profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bare-metal-servers-profile) available in the region. A bare - * metal server profile specifies the performance characteristics and pricing model for a bare metal server. - * - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerProfileCollection} - */ - public ServiceCall listBareMetalServerProfiles() { - return listBareMetalServerProfiles(null); - } - - /** - * Retrieve a bare metal server profile. - * - * This request retrieves a single bare metal server profile specified by the name in the URL. + * This request updates an instance cluster network attachment with the information provided in an instance network + * interface patch object. The instance cluster network attachment patch object is structured in the same way as a + * retrieved instance cluster network attachment and needs to contain only the information to be updated. * - * @param getBareMetalServerProfileOptions the {@link GetBareMetalServerProfileOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerProfile} + * @param updateInstanceClusterNetworkAttachmentOptions the {@link UpdateInstanceClusterNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceClusterNetworkAttachment} */ - public ServiceCall getBareMetalServerProfile(GetBareMetalServerProfileOptions getBareMetalServerProfileOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerProfileOptions, - "getBareMetalServerProfileOptions cannot be null"); + public ServiceCall updateInstanceClusterNetworkAttachment(UpdateInstanceClusterNetworkAttachmentOptions updateInstanceClusterNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceClusterNetworkAttachmentOptions, + "updateInstanceClusterNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getBareMetalServerProfileOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_server/profiles/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerProfile"); + pathParamsMap.put("instance_id", updateInstanceClusterNetworkAttachmentOptions.instanceId()); + pathParamsMap.put("id", updateInstanceClusterNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/cluster_network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceClusterNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceClusterNetworkAttachmentOptions.instanceClusterNetworkAttachmentPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List bare metal servers. + * Create a console access token for an instance. * - * This request lists bare metal servers in the region. + * This request creates a new single-use console access token for an instance. All console configuration is provided + * at token create time, and the token is subsequently used in the `access_token` query parameter for the WebSocket + * request. The access token is only valid for a short period of time, and a maximum of one token is valid for a + * given instance at a time. * - * @param listBareMetalServersOptions the {@link ListBareMetalServersOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerCollection} + * @param createInstanceConsoleAccessTokenOptions the {@link CreateInstanceConsoleAccessTokenOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceConsoleAccessToken} */ - public ServiceCall listBareMetalServers(ListBareMetalServersOptions listBareMetalServersOptions) { - if (listBareMetalServersOptions == null) { - listBareMetalServersOptions = new ListBareMetalServersOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServers"); + public ServiceCall createInstanceConsoleAccessToken(CreateInstanceConsoleAccessTokenOptions createInstanceConsoleAccessTokenOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceConsoleAccessTokenOptions, + "createInstanceConsoleAccessTokenOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_id", createInstanceConsoleAccessTokenOptions.instanceId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/console_access_token", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceConsoleAccessToken"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listBareMetalServersOptions.start() != null) { - builder.query("start", String.valueOf(listBareMetalServersOptions.start())); - } - if (listBareMetalServersOptions.limit() != null) { - builder.query("limit", String.valueOf(listBareMetalServersOptions.limit())); - } - if (listBareMetalServersOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listBareMetalServersOptions.resourceGroupId())); - } - if (listBareMetalServersOptions.name() != null) { - builder.query("name", String.valueOf(listBareMetalServersOptions.name())); - } - if (listBareMetalServersOptions.reservationId() != null) { - builder.query("reservation.id", String.valueOf(listBareMetalServersOptions.reservationId())); - } - if (listBareMetalServersOptions.reservationCrn() != null) { - builder.query("reservation.crn", String.valueOf(listBareMetalServersOptions.reservationCrn())); - } - if (listBareMetalServersOptions.reservationName() != null) { - builder.query("reservation.name", String.valueOf(listBareMetalServersOptions.reservationName())); - } - if (listBareMetalServersOptions.vpcId() != null) { - builder.query("vpc.id", String.valueOf(listBareMetalServersOptions.vpcId())); - } - if (listBareMetalServersOptions.vpcCrn() != null) { - builder.query("vpc.crn", String.valueOf(listBareMetalServersOptions.vpcCrn())); - } - if (listBareMetalServersOptions.vpcName() != null) { - builder.query("vpc.name", String.valueOf(listBareMetalServersOptions.vpcName())); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("console_type", createInstanceConsoleAccessTokenOptions.consoleType()); + if (createInstanceConsoleAccessTokenOptions.force() != null) { + contentJson.addProperty("force", createInstanceConsoleAccessTokenOptions.force()); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List bare metal servers. - * - * This request lists bare metal servers in the region. - * - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerCollection} - */ - public ServiceCall listBareMetalServers() { - return listBareMetalServers(null); - } - - /** - * Create a bare metal server. + * List disks on an instance. * - * This request provisions a new bare metal server from a prototype object. The prototype object is structured in the - * same way as a retrieved bare metal server, and contains the information necessary to provision the new bare metal - * server. The bare metal server is automatically started. + * This request lists disks on an instance. A disk is a block device that is locally attached to the instance's + * physical host and is also referred to as instance storage. By default, the listed disks are sorted by their + * `created_at` property values, with the newest disk first. * - * @param createBareMetalServerOptions the {@link CreateBareMetalServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServer} + * @param listInstanceDisksOptions the {@link ListInstanceDisksOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceDiskCollection} */ - public ServiceCall createBareMetalServer(CreateBareMetalServerOptions createBareMetalServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createBareMetalServerOptions, - "createBareMetalServerOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBareMetalServer"); + public ServiceCall listInstanceDisks(ListInstanceDisksOptions listInstanceDisksOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceDisksOptions, + "listInstanceDisksOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("instance_id", listInstanceDisksOptions.instanceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/disks", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceDisks"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createBareMetalServerOptions.bareMetalServerPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a console access token for a bare metal server. + * Retrieve an instance disk. * - * This request creates a new single-use console access token for a bare metal server. All console configuration is - * provided at token create time, and the token is subsequently used in the `access_token` query parameter for the - * WebSocket request. The access token is only valid for a short period of time, and a maximum of one token is valid - * for a given bare metal server at a time. For this request to succeed, the server must have a `status` of - * `stopped`, `starting`, or `running`. + * This request retrieves a single instance disk specified by the identifier in the URL. * - * @param createBareMetalServerConsoleAccessTokenOptions the {@link CreateBareMetalServerConsoleAccessTokenOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerConsoleAccessToken} + * @param getInstanceDiskOptions the {@link GetInstanceDiskOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceDisk} */ - public ServiceCall createBareMetalServerConsoleAccessToken(CreateBareMetalServerConsoleAccessTokenOptions createBareMetalServerConsoleAccessTokenOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createBareMetalServerConsoleAccessTokenOptions, - "createBareMetalServerConsoleAccessTokenOptions cannot be null"); + public ServiceCall getInstanceDisk(GetInstanceDiskOptions getInstanceDiskOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceDiskOptions, + "getInstanceDiskOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", createBareMetalServerConsoleAccessTokenOptions.bareMetalServerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/console_access_token", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBareMetalServerConsoleAccessToken"); + pathParamsMap.put("instance_id", getInstanceDiskOptions.instanceId()); + pathParamsMap.put("id", getInstanceDiskOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/disks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceDisk"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("console_type", createBareMetalServerConsoleAccessTokenOptions.consoleType()); - if (createBareMetalServerConsoleAccessTokenOptions.force() != null) { - contentJson.addProperty("force", createBareMetalServerConsoleAccessTokenOptions.force()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List disks on a bare metal server. + * Update an instance disk. * - * This request lists disks on a bare metal server. A disk is a block device that is locally attached to the - * physical server. By default, the listed disks are sorted by their `created_at` property values, with the newest - * disk first. + * This request updates the instance disk with the information in a provided patch. * - * @param listBareMetalServerDisksOptions the {@link ListBareMetalServerDisksOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerDiskCollection} + * @param updateInstanceDiskOptions the {@link UpdateInstanceDiskOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceDisk} */ - public ServiceCall listBareMetalServerDisks(ListBareMetalServerDisksOptions listBareMetalServerDisksOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerDisksOptions, - "listBareMetalServerDisksOptions cannot be null"); + public ServiceCall updateInstanceDisk(UpdateInstanceDiskOptions updateInstanceDiskOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceDiskOptions, + "updateInstanceDiskOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", listBareMetalServerDisksOptions.bareMetalServerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/disks", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerDisks"); + pathParamsMap.put("instance_id", updateInstanceDiskOptions.instanceId()); + pathParamsMap.put("id", updateInstanceDiskOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/disks/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceDisk"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceDiskOptions.instanceDiskPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a bare metal server disk. + * List network attachments on an instance. * - * This request retrieves a single disk specified by the identifier in the URL. + * This request lists network attachments on an instance. A network attachment represents a device on the instance to + * which a virtual network interface is attached. * - * @param getBareMetalServerDiskOptions the {@link GetBareMetalServerDiskOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerDisk} + * The network attachments will be sorted by their `created_at` property values, with newest network attachments + * first. Network attachments with identical `created_at` property values will in turn be sorted by ascending `name` + * property values. + * + * @param listInstanceNetworkAttachmentsOptions the {@link ListInstanceNetworkAttachmentsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceNetworkAttachmentCollection} */ - public ServiceCall getBareMetalServerDisk(GetBareMetalServerDiskOptions getBareMetalServerDiskOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerDiskOptions, - "getBareMetalServerDiskOptions cannot be null"); + public ServiceCall listInstanceNetworkAttachments(ListInstanceNetworkAttachmentsOptions listInstanceNetworkAttachmentsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceNetworkAttachmentsOptions, + "listInstanceNetworkAttachmentsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", getBareMetalServerDiskOptions.bareMetalServerId()); - pathParamsMap.put("id", getBareMetalServerDiskOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/disks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerDisk"); + pathParamsMap.put("instance_id", listInstanceNetworkAttachmentsOptions.instanceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceNetworkAttachments"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a bare metal server disk. + * Create a network attachment on an instance. * - * This request updates the bare metal server disk with the information in a provided patch. + * This request creates a new instance network attachment from an instance network attachment prototype object. The + * prototype object is structured in the same way as a retrieved instance network attachment, and contains the + * information necessary to create the new instance network attachment. * - * @param updateBareMetalServerDiskOptions the {@link UpdateBareMetalServerDiskOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerDisk} + * @param createInstanceNetworkAttachmentOptions the {@link CreateInstanceNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceNetworkAttachment} */ - public ServiceCall updateBareMetalServerDisk(UpdateBareMetalServerDiskOptions updateBareMetalServerDiskOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateBareMetalServerDiskOptions, - "updateBareMetalServerDiskOptions cannot be null"); + public ServiceCall createInstanceNetworkAttachment(CreateInstanceNetworkAttachmentOptions createInstanceNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceNetworkAttachmentOptions, + "createInstanceNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", updateBareMetalServerDiskOptions.bareMetalServerId()); - pathParamsMap.put("id", updateBareMetalServerDiskOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/disks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBareMetalServerDisk"); + pathParamsMap.put("instance_id", createInstanceNetworkAttachmentOptions.instanceId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBareMetalServerDiskOptions.bareMetalServerDiskPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("virtual_network_interface", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceNetworkAttachmentOptions.virtualNetworkInterface())); + if (createInstanceNetworkAttachmentOptions.name() != null) { + contentJson.addProperty("name", createInstanceNetworkAttachmentOptions.name()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List network attachments on a bare metal server. - * - * This request lists network attachments on a bare metal server. A bare metal server network attachment is an - * abstract representation of a network device and attaches a bare metal server to a single subnet. Each network - * interface on a bare metal server can attach to any subnet in the zone, including subnets that are already attached - * to the bare metal server. + * Delete an instance network attachment. * - * The network attachments will be sorted by their `created_at` property values, with newest network attachments - * first. Network attachments with identical `created_at` property values will in turn be sorted by ascending `name` - * property values. + * This request deletes an instance network attachment. This operation cannot be reversed. Any floating IPs associated + * with the instance network attachment are implicitly disassociated. All flow log collectors with `auto_delete` set + * to `true` targeting the instance network attachment are automatically deleted. The primary instance network + * attachment is not allowed to be deleted. * - * @param listBareMetalServerNetworkAttachmentsOptions the {@link ListBareMetalServerNetworkAttachmentsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkAttachmentCollection} + * @param deleteInstanceNetworkAttachmentOptions the {@link DeleteInstanceNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listBareMetalServerNetworkAttachments(ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkAttachmentsOptions, - "listBareMetalServerNetworkAttachmentsOptions cannot be null"); + public ServiceCall deleteInstanceNetworkAttachment(DeleteInstanceNetworkAttachmentOptions deleteInstanceNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceNetworkAttachmentOptions, + "deleteInstanceNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkAttachmentsOptions.bareMetalServerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkAttachments"); + pathParamsMap.put("instance_id", deleteInstanceNetworkAttachmentOptions.instanceId()); + pathParamsMap.put("id", deleteInstanceNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listBareMetalServerNetworkAttachmentsOptions.start() != null) { - builder.query("start", String.valueOf(listBareMetalServerNetworkAttachmentsOptions.start())); - } - if (listBareMetalServerNetworkAttachmentsOptions.limit() != null) { - builder.query("limit", String.valueOf(listBareMetalServerNetworkAttachmentsOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Create a network attachment on a bare metal server. + * Retrieve an instance network attachment. * - * This request creates a new bare metal server network attachment from a bare metal server network attachment - * prototype object. The prototype object is structured in the same way as a retrieved bare metal server network - * attachment, and contains the information necessary to create the new bare metal server network attachment. + * This request retrieves a single instance network attachment specified by the identifier in the URL. * - * @param createBareMetalServerNetworkAttachmentOptions the {@link CreateBareMetalServerNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkAttachment} + * @param getInstanceNetworkAttachmentOptions the {@link GetInstanceNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceNetworkAttachment} */ - public ServiceCall createBareMetalServerNetworkAttachment(CreateBareMetalServerNetworkAttachmentOptions createBareMetalServerNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createBareMetalServerNetworkAttachmentOptions, - "createBareMetalServerNetworkAttachmentOptions cannot be null"); + public ServiceCall getInstanceNetworkAttachment(GetInstanceNetworkAttachmentOptions getInstanceNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceNetworkAttachmentOptions, + "getInstanceNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", createBareMetalServerNetworkAttachmentOptions.bareMetalServerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBareMetalServerNetworkAttachment"); + pathParamsMap.put("instance_id", getInstanceNetworkAttachmentOptions.instanceId()); + pathParamsMap.put("id", getInstanceNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createBareMetalServerNetworkAttachmentOptions.bareMetalServerNetworkAttachmentPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a bare metal server network attachment. - * - * This request deletes a bare metal server network attachment. This operation cannot be reversed. Any floating IPs - * associated with the bare metal server network attachment are implicitly disassociated. + * Update an instance network attachment. * - * The bare metal server's primary network attachment cannot be deleted. + * This request updates an instance network attachment with the information provided in an instance network interface + * patch object. The instance network attachment patch object is structured in the same way as a retrieved instance + * network attachment and needs to contain only the information to be updated. * - * @param deleteBareMetalServerNetworkAttachmentOptions the {@link DeleteBareMetalServerNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param updateInstanceNetworkAttachmentOptions the {@link UpdateInstanceNetworkAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link InstanceNetworkAttachment} */ - public ServiceCall deleteBareMetalServerNetworkAttachment(DeleteBareMetalServerNetworkAttachmentOptions deleteBareMetalServerNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBareMetalServerNetworkAttachmentOptions, - "deleteBareMetalServerNetworkAttachmentOptions cannot be null"); + public ServiceCall updateInstanceNetworkAttachment(UpdateInstanceNetworkAttachmentOptions updateInstanceNetworkAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceNetworkAttachmentOptions, + "updateInstanceNetworkAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", deleteBareMetalServerNetworkAttachmentOptions.bareMetalServerId()); - pathParamsMap.put("id", deleteBareMetalServerNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBareMetalServerNetworkAttachment"); + pathParamsMap.put("instance_id", updateInstanceNetworkAttachmentOptions.instanceId()); + pathParamsMap.put("id", updateInstanceNetworkAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceNetworkAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceNetworkAttachmentOptions.instanceNetworkAttachmentPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a bare metal server network attachment. + * List network interfaces on an instance. * - * This request retrieves a single bare metal server network attachment specified by the identifier in the URL. + * This request lists network interfaces on an instance. An instance network interface is an abstract representation + * of a network device and attaches an instance to a single subnet. Each network interface on an instance can attach + * to any subnet in the zone, including subnets that are already attached to the instance. Multiple network interfaces + * on the instance may also attach to the same subnet. * - * @param getBareMetalServerNetworkAttachmentOptions the {@link GetBareMetalServerNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkAttachment} + * If this instance has network attachments, each returned network interface is a [read-only + * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding + * network attachment and its attached virtual network interface. + * + * @param listInstanceNetworkInterfacesOptions the {@link ListInstanceNetworkInterfacesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkInterfaceUnpaginatedCollection} */ - public ServiceCall getBareMetalServerNetworkAttachment(GetBareMetalServerNetworkAttachmentOptions getBareMetalServerNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkAttachmentOptions, - "getBareMetalServerNetworkAttachmentOptions cannot be null"); + public ServiceCall listInstanceNetworkInterfaces(ListInstanceNetworkInterfacesOptions listInstanceNetworkInterfacesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceNetworkInterfacesOptions, + "listInstanceNetworkInterfacesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkAttachmentOptions.bareMetalServerId()); - pathParamsMap.put("id", getBareMetalServerNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkAttachment"); + pathParamsMap.put("instance_id", listInstanceNetworkInterfacesOptions.instanceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceNetworkInterfaces"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a bare metal server network attachment. + * Create a network interface on an instance. * - * This request updates a bare metal server network attachment with the information provided in a bare metal server - * network attachment patch object. The bare metal server network attachment patch object is structured in the same - * way as a retrieved bare metal server network attachment and contains only the information to be updated. + * This request creates a new instance network interface from an instance network interface prototype object. The + * prototype object is structured in the same way as a retrieved instance network interface, and contains the + * information necessary to create the new instance network interface. Any subnet in the instance's VPC may be + * specified. Addresses on the instance network interface must be within the specified subnet's CIDR blocks. * - * @param updateBareMetalServerNetworkAttachmentOptions the {@link UpdateBareMetalServerNetworkAttachmentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkAttachment} + * If this instance has network attachments, each network interface is a [read-only + * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding + * network attachment and its attached virtual network interface, and new network interfaces are not allowed to be + * created. + * + * @param createInstanceNetworkInterfaceOptions the {@link CreateInstanceNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkInterface} */ - public ServiceCall updateBareMetalServerNetworkAttachment(UpdateBareMetalServerNetworkAttachmentOptions updateBareMetalServerNetworkAttachmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateBareMetalServerNetworkAttachmentOptions, - "updateBareMetalServerNetworkAttachmentOptions cannot be null"); + public ServiceCall createInstanceNetworkInterface(CreateInstanceNetworkInterfaceOptions createInstanceNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceNetworkInterfaceOptions, + "createInstanceNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", updateBareMetalServerNetworkAttachmentOptions.bareMetalServerId()); - pathParamsMap.put("id", updateBareMetalServerNetworkAttachmentOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_attachments/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBareMetalServerNetworkAttachment"); + pathParamsMap.put("instance_id", createInstanceNetworkInterfaceOptions.instanceId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBareMetalServerNetworkAttachmentOptions.bareMetalServerNetworkAttachmentPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("subnet", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceNetworkInterfaceOptions.subnet())); + if (createInstanceNetworkInterfaceOptions.allowIpSpoofing() != null) { + contentJson.addProperty("allow_ip_spoofing", createInstanceNetworkInterfaceOptions.allowIpSpoofing()); + } + if (createInstanceNetworkInterfaceOptions.name() != null) { + contentJson.addProperty("name", createInstanceNetworkInterfaceOptions.name()); + } + if (createInstanceNetworkInterfaceOptions.primaryIp() != null) { + contentJson.add("primary_ip", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceNetworkInterfaceOptions.primaryIp())); + } + if (createInstanceNetworkInterfaceOptions.securityGroups() != null) { + contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceNetworkInterfaceOptions.securityGroups())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List network interfaces on a bare metal server. + * Delete an instance network interface. * - * This request lists network interfaces on a bare metal server. A bare metal server network interface is an abstract - * representation of a network device and attaches a bare metal server to a single subnet. Each network interface on a - * bare metal server can attach to any subnet in the zone, including subnets that are already attached to the bare - * metal server. + * This request deletes an instance network interface. This operation cannot be reversed. Any floating IPs associated + * with the instance network interface are implicitly disassociated. All flow log collectors with `auto_delete` set to + * `true` targeting the instance network interface are automatically deleted. The primary instance network interface + * is not allowed to be deleted. * - * If this bare metal server has network attachments, each returned network interface is a [read-only + * If this instance has network attachments, this network interface is a [read-only * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding - * network attachment and its attached virtual network interface. + * network attachment and its attached virtual network interface, and is not allowed to be deleted. * - * @param listBareMetalServerNetworkInterfacesOptions the {@link ListBareMetalServerNetworkInterfacesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkInterfaceCollection} + * @param deleteInstanceNetworkInterfaceOptions the {@link DeleteInstanceNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listBareMetalServerNetworkInterfaces(ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkInterfacesOptions, - "listBareMetalServerNetworkInterfacesOptions cannot be null"); + public ServiceCall deleteInstanceNetworkInterface(DeleteInstanceNetworkInterfaceOptions deleteInstanceNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceNetworkInterfaceOptions, + "deleteInstanceNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkInterfacesOptions.bareMetalServerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkInterfaces"); + pathParamsMap.put("instance_id", deleteInstanceNetworkInterfaceOptions.instanceId()); + pathParamsMap.put("id", deleteInstanceNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listBareMetalServerNetworkInterfacesOptions.start() != null) { - builder.query("start", String.valueOf(listBareMetalServerNetworkInterfacesOptions.start())); - } - if (listBareMetalServerNetworkInterfacesOptions.limit() != null) { - builder.query("limit", String.valueOf(listBareMetalServerNetworkInterfacesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Create a network interface on a bare metal server. + * Retrieve an instance network interface. * - * This request creates a new bare metal server network interface from a bare metal server network interface prototype - * object. The prototype object is structured in the same way as a retrieved bare metal server network interface, and - * contains the information necessary to create the new bare metal server network interface. Any subnet in the bare - * metal server's VPC may be specified, even if it is already attached to another bare metal server network interface. - * Addresses on the bare metal server network interface must be within the specified subnet's CIDR blocks. + * This request retrieves a single instance network interface specified by the identifier in the URL. * - * If this bare metal server has network attachments, each network interface is a [read-only - * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding - * network attachment and its attached virtual network interface, and new network interfaces are not allowed to be - * created. + * If this instance has network attachments, the retrieved network interface is a + * [read-only representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its + * corresponding network attachment and its attached virtual network interface. * - * @param createBareMetalServerNetworkInterfaceOptions the {@link CreateBareMetalServerNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkInterface} + * @param getInstanceNetworkInterfaceOptions the {@link GetInstanceNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkInterface} */ - public ServiceCall createBareMetalServerNetworkInterface(CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createBareMetalServerNetworkInterfaceOptions, - "createBareMetalServerNetworkInterfaceOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", createBareMetalServerNetworkInterfaceOptions.bareMetalServerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBareMetalServerNetworkInterface"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createBareMetalServerNetworkInterfaceOptions.bareMetalServerNetworkInterfacePrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete a bare metal server network interface. - * - * This request deletes a bare metal server network interface. This operation cannot be reversed. Any floating IPs - * associated with the bare metal server network interface are implicitly disassociated. The primary bare metal - * server network interface is not allowed to be deleted. - * - * If this bare metal server has network attachments, this network interface is a [read-only - * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding - * network attachment and its attached virtual network interface, and is not allowed to be deleted. - * - * @param deleteBareMetalServerNetworkInterfaceOptions the {@link DeleteBareMetalServerNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteBareMetalServerNetworkInterface(DeleteBareMetalServerNetworkInterfaceOptions deleteBareMetalServerNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBareMetalServerNetworkInterfaceOptions, - "deleteBareMetalServerNetworkInterfaceOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", deleteBareMetalServerNetworkInterfaceOptions.bareMetalServerId()); - pathParamsMap.put("id", deleteBareMetalServerNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBareMetalServerNetworkInterface"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Retrieve a bare metal server network interface. - * - * This request retrieves a single bare metal server network interface specified by the identifier in the URL. - * - * If this bare metal server has network attachments, the retrieved network interface is a [read-only - * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding - * network attachment and its attached virtual network interface. - * - * @param getBareMetalServerNetworkInterfaceOptions the {@link GetBareMetalServerNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkInterface} - */ - public ServiceCall getBareMetalServerNetworkInterface(GetBareMetalServerNetworkInterfaceOptions getBareMetalServerNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkInterfaceOptions, - "getBareMetalServerNetworkInterfaceOptions cannot be null"); + public ServiceCall getInstanceNetworkInterface(GetInstanceNetworkInterfaceOptions getInstanceNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceNetworkInterfaceOptions, + "getInstanceNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkInterfaceOptions.bareMetalServerId()); - pathParamsMap.put("id", getBareMetalServerNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkInterface"); + pathParamsMap.put("instance_id", getInstanceNetworkInterfaceOptions.instanceId()); + pathParamsMap.put("id", getInstanceNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a bare metal server network interface. + * Update an instance network interface. * - * This request updates a bare metal server network interface with the information provided in a bare metal server - * network interface patch object. The bare metal server network interface patch object is structured in the same way - * as a retrieved bare metal server network interface and needs to contain only the information to be updated. + * This request updates an instance network interface with the information provided in an instance network interface + * patch object. The instance network interface patch object is structured in the same way as a retrieved instance + * network interface and needs to contain only the information to be updated. * - * If this bare metal server has network attachments, this network interface is a [read-only + * If this instance has network attachments, this network interface is a [read-only * representation](https://cloud.ibm.com/docs/vpc?topic=vpc-vni-about#vni-old-api-clients) of its corresponding * network attachment and its attached virtual network interface, and is not allowed to be updated. * - * @param updateBareMetalServerNetworkInterfaceOptions the {@link UpdateBareMetalServerNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerNetworkInterface} + * @param updateInstanceNetworkInterfaceOptions the {@link UpdateInstanceNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkInterface} */ - public ServiceCall updateBareMetalServerNetworkInterface(UpdateBareMetalServerNetworkInterfaceOptions updateBareMetalServerNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateBareMetalServerNetworkInterfaceOptions, - "updateBareMetalServerNetworkInterfaceOptions cannot be null"); + public ServiceCall updateInstanceNetworkInterface(UpdateInstanceNetworkInterfaceOptions updateInstanceNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceNetworkInterfaceOptions, + "updateInstanceNetworkInterfaceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", updateBareMetalServerNetworkInterfaceOptions.bareMetalServerId()); - pathParamsMap.put("id", updateBareMetalServerNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBareMetalServerNetworkInterface"); + pathParamsMap.put("instance_id", updateInstanceNetworkInterfaceOptions.instanceId()); + pathParamsMap.put("id", updateInstanceNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceNetworkInterface"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBareMetalServerNetworkInterfaceOptions.bareMetalServerNetworkInterfacePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceNetworkInterfaceOptions.networkInterfacePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List floating IPs associated with a bare metal server network interface. + * List floating IPs associated with an instance network interface. * - * This request lists floating IPs associated with a bare metal server network interface. + * This request lists floating IPs associated with an instance network interface. * - * @param listBareMetalServerNetworkInterfaceFloatingIpsOptions the {@link ListBareMetalServerNetworkInterfaceFloatingIpsOptions} containing the options for the call + * @param listInstanceNetworkInterfaceFloatingIpsOptions the {@link ListInstanceNetworkInterfaceFloatingIpsOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link FloatingIPUnpaginatedCollection} */ - public ServiceCall listBareMetalServerNetworkInterfaceFloatingIps(ListBareMetalServerNetworkInterfaceFloatingIpsOptions listBareMetalServerNetworkInterfaceFloatingIpsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkInterfaceFloatingIpsOptions, - "listBareMetalServerNetworkInterfaceFloatingIpsOptions cannot be null"); + public ServiceCall listInstanceNetworkInterfaceFloatingIps(ListInstanceNetworkInterfaceFloatingIpsOptions listInstanceNetworkInterfaceFloatingIpsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceNetworkInterfaceFloatingIpsOptions, + "listInstanceNetworkInterfaceFloatingIpsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkInterfaceFloatingIpsOptions.bareMetalServerId()); - pathParamsMap.put("network_interface_id", listBareMetalServerNetworkInterfaceFloatingIpsOptions.networkInterfaceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkInterfaceFloatingIps"); + pathParamsMap.put("instance_id", listInstanceNetworkInterfaceFloatingIpsOptions.instanceId()); + pathParamsMap.put("network_interface_id", listInstanceNetworkInterfaceFloatingIpsOptions.networkInterfaceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceNetworkInterfaceFloatingIps"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -6796,22 +6920,22 @@ public ServiceCall listBareMetalServerNetworkIn } /** - * Disassociate a floating IP from a bare metal server network interface. + * Disassociate a floating IP from an instance network interface. * - * This request disassociates the specified floating IP from the specified bare metal server network interface. + * This request disassociates the specified floating IP from the specified instance network interface. * - * @param removeBareMetalServerNetworkInterfaceFloatingIpOptions the {@link RemoveBareMetalServerNetworkInterfaceFloatingIpOptions} containing the options for the call + * @param removeInstanceNetworkInterfaceFloatingIpOptions the {@link RemoveInstanceNetworkInterfaceFloatingIpOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall removeBareMetalServerNetworkInterfaceFloatingIp(RemoveBareMetalServerNetworkInterfaceFloatingIpOptions removeBareMetalServerNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(removeBareMetalServerNetworkInterfaceFloatingIpOptions, - "removeBareMetalServerNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall removeInstanceNetworkInterfaceFloatingIp(RemoveInstanceNetworkInterfaceFloatingIpOptions removeInstanceNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(removeInstanceNetworkInterfaceFloatingIpOptions, + "removeInstanceNetworkInterfaceFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", removeBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId()); - pathParamsMap.put("network_interface_id", removeBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId()); - pathParamsMap.put("id", removeBareMetalServerNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeBareMetalServerNetworkInterfaceFloatingIp"); + pathParamsMap.put("instance_id", removeInstanceNetworkInterfaceFloatingIpOptions.instanceId()); + pathParamsMap.put("network_interface_id", removeInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId()); + pathParamsMap.put("id", removeInstanceNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeInstanceNetworkInterfaceFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -6824,21 +6948,21 @@ public ServiceCall removeBareMetalServerNetworkInterfaceFloatingIp(RemoveB /** * Retrieve associated floating IP. * - * This request retrieves a specified floating IP if it is associated with the bare metal server network interface - * specified in the URL. + * This request retrieves a specified floating IP address if it is associated with the instance network interface and + * instance specified in the URL. * - * @param getBareMetalServerNetworkInterfaceFloatingIpOptions the {@link GetBareMetalServerNetworkInterfaceFloatingIpOptions} containing the options for the call + * @param getInstanceNetworkInterfaceFloatingIpOptions the {@link GetInstanceNetworkInterfaceFloatingIpOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link FloatingIP} */ - public ServiceCall getBareMetalServerNetworkInterfaceFloatingIp(GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkInterfaceFloatingIpOptions, - "getBareMetalServerNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall getInstanceNetworkInterfaceFloatingIp(GetInstanceNetworkInterfaceFloatingIpOptions getInstanceNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceNetworkInterfaceFloatingIpOptions, + "getInstanceNetworkInterfaceFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId()); - pathParamsMap.put("network_interface_id", getBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId()); - pathParamsMap.put("id", getBareMetalServerNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkInterfaceFloatingIp"); + pathParamsMap.put("instance_id", getInstanceNetworkInterfaceFloatingIpOptions.instanceId()); + pathParamsMap.put("network_interface_id", getInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId()); + pathParamsMap.put("id", getInstanceNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceNetworkInterfaceFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -6851,30 +6975,29 @@ public ServiceCall getBareMetalServerNetworkInterfaceFloatingIp(GetB } /** - * Associate a floating IP with a bare metal server network interface. + * Associate a floating IP with an instance network interface. * - * This request associates the specified floating IP with the specified bare metal server network interface. If - * `enable_infrastructure_nat` is `false`, this adds the IP to any existing associations. If - * `enable_infrastructure_nat` is `true`, this replaces any existing association. + * This request associates the specified floating IP with the specified instance network interface, replacing any + * existing association. * * The existing floating IP must: * - not be required by another resource, such as a public gateway - * - be in the same `zone` as the bare metal server + * - be in the same `zone` as the instance * * A request body is not required, and if provided, is ignored. * - * @param addBareMetalServerNetworkInterfaceFloatingIpOptions the {@link AddBareMetalServerNetworkInterfaceFloatingIpOptions} containing the options for the call + * @param addInstanceNetworkInterfaceFloatingIpOptions the {@link AddInstanceNetworkInterfaceFloatingIpOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link FloatingIP} */ - public ServiceCall addBareMetalServerNetworkInterfaceFloatingIp(AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(addBareMetalServerNetworkInterfaceFloatingIpOptions, - "addBareMetalServerNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall addInstanceNetworkInterfaceFloatingIp(AddInstanceNetworkInterfaceFloatingIpOptions addInstanceNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(addInstanceNetworkInterfaceFloatingIpOptions, + "addInstanceNetworkInterfaceFloatingIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", addBareMetalServerNetworkInterfaceFloatingIpOptions.bareMetalServerId()); - pathParamsMap.put("network_interface_id", addBareMetalServerNetworkInterfaceFloatingIpOptions.networkInterfaceId()); - pathParamsMap.put("id", addBareMetalServerNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addBareMetalServerNetworkInterfaceFloatingIp"); + pathParamsMap.put("instance_id", addInstanceNetworkInterfaceFloatingIpOptions.instanceId()); + pathParamsMap.put("network_interface_id", addInstanceNetworkInterfaceFloatingIpOptions.networkInterfaceId()); + pathParamsMap.put("id", addInstanceNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addInstanceNetworkInterfaceFloatingIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -6887,57 +7010,63 @@ public ServiceCall addBareMetalServerNetworkInterfaceFloatingIp(AddB } /** - * List the primary reserved IP for a bare metal server network interface. + * List the primary reserved IP for an instance network interface. * - * This request lists the primary reserved IP for a bare metal server network interface. + * This request lists the primary reserved IP for an instance network interface. * - * @param listBareMetalServerNetworkInterfaceIpsOptions the {@link ListBareMetalServerNetworkInterfaceIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionBareMetalServerNetworkInterfaceContext} + * @param listInstanceNetworkInterfaceIpsOptions the {@link ListInstanceNetworkInterfaceIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionInstanceNetworkInterfaceContext} * @deprecated this method is deprecated and may be removed in a future release */ @Deprecated - public ServiceCall listBareMetalServerNetworkInterfaceIps(ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptions) { - LOGGER.warning("A deprecated operation has been invoked: listBareMetalServerNetworkInterfaceIps"); - com.ibm.cloud.sdk.core.util.Validator.notNull(listBareMetalServerNetworkInterfaceIpsOptions, - "listBareMetalServerNetworkInterfaceIpsOptions cannot be null"); + public ServiceCall listInstanceNetworkInterfaceIps(ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions) { + LOGGER.warning("A deprecated operation has been invoked: listInstanceNetworkInterfaceIps"); + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceNetworkInterfaceIpsOptions, + "listInstanceNetworkInterfaceIpsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", listBareMetalServerNetworkInterfaceIpsOptions.bareMetalServerId()); - pathParamsMap.put("network_interface_id", listBareMetalServerNetworkInterfaceIpsOptions.networkInterfaceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBareMetalServerNetworkInterfaceIps"); + pathParamsMap.put("instance_id", listInstanceNetworkInterfaceIpsOptions.instanceId()); + pathParamsMap.put("network_interface_id", listInstanceNetworkInterfaceIpsOptions.networkInterfaceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceNetworkInterfaceIps"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listInstanceNetworkInterfaceIpsOptions.start() != null) { + builder.query("start", String.valueOf(listInstanceNetworkInterfaceIpsOptions.start())); + } + if (listInstanceNetworkInterfaceIpsOptions.limit() != null) { + builder.query("limit", String.valueOf(listInstanceNetworkInterfaceIpsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** * Retrieve the primary reserved IP. * - * This request retrieves the primary reserved IP for a bare metal server network interface. + * This request retrieves the primary reserved IP for an instance network interface. * - * @param getBareMetalServerNetworkInterfaceIpOptions the {@link GetBareMetalServerNetworkInterfaceIpOptions} containing the options for the call + * @param getInstanceNetworkInterfaceIpOptions the {@link GetInstanceNetworkInterfaceIpOptions} containing the options for the call * @return a {@link ServiceCall} with a result of type {@link ReservedIP} * @deprecated this method is deprecated and may be removed in a future release */ @Deprecated - public ServiceCall getBareMetalServerNetworkInterfaceIp(GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptions) { - LOGGER.warning("A deprecated operation has been invoked: getBareMetalServerNetworkInterfaceIp"); - com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerNetworkInterfaceIpOptions, - "getBareMetalServerNetworkInterfaceIpOptions cannot be null"); + public ServiceCall getInstanceNetworkInterfaceIp(GetInstanceNetworkInterfaceIpOptions getInstanceNetworkInterfaceIpOptions) { + LOGGER.warning("A deprecated operation has been invoked: getInstanceNetworkInterfaceIp"); + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceNetworkInterfaceIpOptions, + "getInstanceNetworkInterfaceIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("bare_metal_server_id", getBareMetalServerNetworkInterfaceIpOptions.bareMetalServerId()); - pathParamsMap.put("network_interface_id", getBareMetalServerNetworkInterfaceIpOptions.networkInterfaceId()); - pathParamsMap.put("id", getBareMetalServerNetworkInterfaceIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerNetworkInterfaceIp"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); + pathParamsMap.put("instance_id", getInstanceNetworkInterfaceIpOptions.instanceId()); + pathParamsMap.put("network_interface_id", getInstanceNetworkInterfaceIpOptions.networkInterfaceId()); + pathParamsMap.put("id", getInstanceNetworkInterfaceIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/network_interfaces/{network_interface_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceNetworkInterfaceIp"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); @@ -6948,947 +7077,851 @@ public ServiceCall getBareMetalServerNetworkInterfaceIp(GetBareMetal } /** - * Delete a bare metal server. + * List volumes attachments on an instance. * - * This request deletes a bare metal server. This operation cannot be reversed. Any floating IPs associated with the - * bare metal server network interfaces are implicitly disassociated. + * This request lists volume attachments on an instance. A volume attachment connects a volume to an instance. Each + * instance may have many volume attachments but each volume attachment connects exactly one instance to exactly one + * volume. * - * @param deleteBareMetalServerOptions the {@link DeleteBareMetalServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listInstanceVolumeAttachmentsOptions the {@link ListInstanceVolumeAttachmentsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VolumeAttachmentCollection} */ - public ServiceCall deleteBareMetalServer(DeleteBareMetalServerOptions deleteBareMetalServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBareMetalServerOptions, - "deleteBareMetalServerOptions cannot be null"); + public ServiceCall listInstanceVolumeAttachments(ListInstanceVolumeAttachmentsOptions listInstanceVolumeAttachmentsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listInstanceVolumeAttachmentsOptions, + "listInstanceVolumeAttachmentsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteBareMetalServerOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBareMetalServer"); + pathParamsMap.put("instance_id", listInstanceVolumeAttachmentsOptions.instanceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listInstanceVolumeAttachments"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a bare metal server. + * Create a volume attachment on an instance. * - * This request retrieves a single bare metal server specified by the identifier in the URL. + * This request creates a new volume attachment from a volume attachment prototype object, connecting a volume to an + * instance. For this request to succeed, the specified volume must not be busy. The prototype object is structured in + * the same way as a retrieved volume attachment, and contains the information necessary to create the new volume + * attachment. * - * @param getBareMetalServerOptions the {@link GetBareMetalServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServer} + * @param createInstanceVolumeAttachmentOptions the {@link CreateInstanceVolumeAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VolumeAttachment} */ - public ServiceCall getBareMetalServer(GetBareMetalServerOptions getBareMetalServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerOptions, - "getBareMetalServerOptions cannot be null"); + public ServiceCall createInstanceVolumeAttachment(CreateInstanceVolumeAttachmentOptions createInstanceVolumeAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createInstanceVolumeAttachmentOptions, + "createInstanceVolumeAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getBareMetalServerOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServer"); + pathParamsMap.put("instance_id", createInstanceVolumeAttachmentOptions.instanceId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createInstanceVolumeAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("volume", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createInstanceVolumeAttachmentOptions.volume())); + if (createInstanceVolumeAttachmentOptions.deleteVolumeOnInstanceDelete() != null) { + contentJson.addProperty("delete_volume_on_instance_delete", createInstanceVolumeAttachmentOptions.deleteVolumeOnInstanceDelete()); + } + if (createInstanceVolumeAttachmentOptions.name() != null) { + contentJson.addProperty("name", createInstanceVolumeAttachmentOptions.name()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a bare metal server. + * Delete a volume attachment. * - * This request updates a bare metal server with the information in a provided patch. The bare metal server patch - * object is structured in the same way as a retrieved bare metal server and contains only the information to be - * updated. + * This request deletes a volume attachment. This operation cannot be reversed, but a new volume attachment may + * subsequently be created for the volume. For this request to succeed, the volume must not be busy. * - * @param updateBareMetalServerOptions the {@link UpdateBareMetalServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServer} + * @param deleteInstanceVolumeAttachmentOptions the {@link DeleteInstanceVolumeAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updateBareMetalServer(UpdateBareMetalServerOptions updateBareMetalServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateBareMetalServerOptions, - "updateBareMetalServerOptions cannot be null"); + public ServiceCall deleteInstanceVolumeAttachment(DeleteInstanceVolumeAttachmentOptions deleteInstanceVolumeAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteInstanceVolumeAttachmentOptions, + "deleteInstanceVolumeAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateBareMetalServerOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBareMetalServer"); + pathParamsMap.put("instance_id", deleteInstanceVolumeAttachmentOptions.instanceId()); + pathParamsMap.put("id", deleteInstanceVolumeAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteInstanceVolumeAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBareMetalServerOptions.bareMetalServerPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update firmware for a bare metal server. + * Retrieve a volume attachment. * - * This request updates a bare metal server to the latest available firmware. The server must be stopped. + * This request retrieves a single volume attachment specified by the identifier in the URL. * - * @param updateFirmwareForBareMetalServerOptions the {@link UpdateFirmwareForBareMetalServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getInstanceVolumeAttachmentOptions the {@link GetInstanceVolumeAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VolumeAttachment} */ - public ServiceCall updateFirmwareForBareMetalServer(UpdateFirmwareForBareMetalServerOptions updateFirmwareForBareMetalServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateFirmwareForBareMetalServerOptions, - "updateFirmwareForBareMetalServerOptions cannot be null"); + public ServiceCall getInstanceVolumeAttachment(GetInstanceVolumeAttachmentOptions getInstanceVolumeAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getInstanceVolumeAttachmentOptions, + "getInstanceVolumeAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateFirmwareForBareMetalServerOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/firmware/update", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateFirmwareForBareMetalServer"); + pathParamsMap.put("instance_id", getInstanceVolumeAttachmentOptions.instanceId()); + pathParamsMap.put("id", getInstanceVolumeAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getInstanceVolumeAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - if (updateFirmwareForBareMetalServerOptions.autoStart() != null) { - contentJson.addProperty("auto_start", updateFirmwareForBareMetalServerOptions.autoStart()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve initialization configuration for a bare metal server. + * Update a volume attachment. * - * This request retrieves configuration used to initialize the bare metal server, such as the image used, SSH keys, - * and any configured usernames and passwords. These can subsequently be changed on the server and therefore may not - * be current. + * This request updates a volume attachment with the information provided in a volume attachment patch object. The + * volume attachment patch object is structured in the same way as a retrieved volume attachment and needs to contain + * only the information to be updated. * - * @param getBareMetalServerInitializationOptions the {@link GetBareMetalServerInitializationOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerInitialization} + * @param updateInstanceVolumeAttachmentOptions the {@link UpdateInstanceVolumeAttachmentOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VolumeAttachment} */ - public ServiceCall getBareMetalServerInitialization(GetBareMetalServerInitializationOptions getBareMetalServerInitializationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBareMetalServerInitializationOptions, - "getBareMetalServerInitializationOptions cannot be null"); + public ServiceCall updateInstanceVolumeAttachment(UpdateInstanceVolumeAttachmentOptions updateInstanceVolumeAttachmentOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateInstanceVolumeAttachmentOptions, + "updateInstanceVolumeAttachmentOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getBareMetalServerInitializationOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/initialization", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBareMetalServerInitialization"); + pathParamsMap.put("instance_id", updateInstanceVolumeAttachmentOptions.instanceId()); + pathParamsMap.put("id", updateInstanceVolumeAttachmentOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/instances/{instance_id}/volume_attachments/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateInstanceVolumeAttachment"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateInstanceVolumeAttachmentOptions.volumeAttachmentPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Reinitialize a bare metal server. + * List keys. * - * This request reinitializes a bare metal server with the specified image and SSH keys. The server must be stopped. - * Upon successful reinitiatilization, the bare metal server will be started automatically. + * This request lists keys in the region. A key contains a public SSH key which may be installed on instances when + * they are created. Private keys are not stored. * - * @param replaceBareMetalServerInitializationOptions the {@link ReplaceBareMetalServerInitializationOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BareMetalServerInitialization} + * @param listKeysOptions the {@link ListKeysOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link KeyCollection} */ - public ServiceCall replaceBareMetalServerInitialization(ReplaceBareMetalServerInitializationOptions replaceBareMetalServerInitializationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(replaceBareMetalServerInitializationOptions, - "replaceBareMetalServerInitializationOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", replaceBareMetalServerInitializationOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/initialization", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "replaceBareMetalServerInitialization"); + public ServiceCall listKeys(ListKeysOptions listKeysOptions) { + if (listKeysOptions == null) { + listKeysOptions = new ListKeysOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listKeys"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("image", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceBareMetalServerInitializationOptions.image())); - contentJson.add("keys", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceBareMetalServerInitializationOptions.keys())); - if (replaceBareMetalServerInitializationOptions.userData() != null) { - contentJson.addProperty("user_data", replaceBareMetalServerInitializationOptions.userData()); + if (listKeysOptions.start() != null) { + builder.query("start", String.valueOf(listKeysOptions.start())); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listKeysOptions.limit() != null) { + builder.query("limit", String.valueOf(listKeysOptions.limit())); + } + if (listKeysOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listKeysOptions.resourceGroupId())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Restart a bare metal server. + * List keys. * - * This request immediately restarts a bare metal server. For this request to succeed, the server must have a - * `status` of `running`. + * This request lists keys in the region. A key contains a public SSH key which may be installed on instances when + * they are created. Private keys are not stored. * - * @param restartBareMetalServerOptions the {@link RestartBareMetalServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @return a {@link ServiceCall} with a result of type {@link KeyCollection} */ - public ServiceCall restartBareMetalServer(RestartBareMetalServerOptions restartBareMetalServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(restartBareMetalServerOptions, - "restartBareMetalServerOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", restartBareMetalServerOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/restart", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "restartBareMetalServer"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listKeys() { + return listKeys(null); } /** - * Start a bare metal server. + * Create a key. * - * This request starts a bare metal server. It will run immediately provided the server is stopped. + * This request creates a new SSH key from an key prototype object. The prototype object is structured in the same way + * as a retrieved key, and contains the information necessary to create the new key. The public key value must be + * provided. * - * @param startBareMetalServerOptions the {@link StartBareMetalServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param createKeyOptions the {@link CreateKeyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Key} */ - public ServiceCall startBareMetalServer(StartBareMetalServerOptions startBareMetalServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(startBareMetalServerOptions, - "startBareMetalServerOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", startBareMetalServerOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/start", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "startBareMetalServer"); + public ServiceCall createKey(CreateKeyOptions createKeyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createKeyOptions, + "createKeyOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createKey"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Stop a bare metal server. - * - * This request stops a bare metal server. It will run immediately provided the server is running. Note: A soft stop - * may not complete as it relies on the operating system to perform the operation. + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("public_key", createKeyOptions.publicKey()); + if (createKeyOptions.name() != null) { + contentJson.addProperty("name", createKeyOptions.name()); + } + if (createKeyOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createKeyOptions.resourceGroup())); + } + if (createKeyOptions.type() != null) { + contentJson.addProperty("type", createKeyOptions.type()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Delete a key. * - * @param stopBareMetalServerOptions the {@link StopBareMetalServerOptions} containing the options for the call + * This request deletes a key. This operation cannot be reversed. + * + * @param deleteKeyOptions the {@link DeleteKeyOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall stopBareMetalServer(StopBareMetalServerOptions stopBareMetalServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(stopBareMetalServerOptions, - "stopBareMetalServerOptions cannot be null"); + public ServiceCall deleteKey(DeleteKeyOptions deleteKeyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteKeyOptions, + "deleteKeyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", stopBareMetalServerOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/bare_metal_servers/{id}/stop", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "stopBareMetalServer"); + pathParamsMap.put("id", deleteKeyOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteKey"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("type", stopBareMetalServerOptions.type()); - builder.bodyJson(contentJson); ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List volume profiles. + * Retrieve a key. * - * This request lists [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available in - * the region. A volume profile specifies the performance characteristics and pricing model for a volume. + * This request retrieves a single key specified by the identifier in the URL. * - * @param listVolumeProfilesOptions the {@link ListVolumeProfilesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VolumeProfileCollection} + * @param getKeyOptions the {@link GetKeyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Key} */ - public ServiceCall listVolumeProfiles(ListVolumeProfilesOptions listVolumeProfilesOptions) { - if (listVolumeProfilesOptions == null) { - listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volume/profiles")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVolumeProfiles"); + public ServiceCall getKey(GetKeyOptions getKeyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getKeyOptions, + "getKeyOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getKeyOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getKey"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVolumeProfilesOptions.start() != null) { - builder.query("start", String.valueOf(listVolumeProfilesOptions.start())); - } - if (listVolumeProfilesOptions.limit() != null) { - builder.query("limit", String.valueOf(listVolumeProfilesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List volume profiles. - * - * This request lists [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available in - * the region. A volume profile specifies the performance characteristics and pricing model for a volume. - * - * @return a {@link ServiceCall} with a result of type {@link VolumeProfileCollection} - */ - public ServiceCall listVolumeProfiles() { - return listVolumeProfiles(null); - } - - /** - * Retrieve a volume profile. + * Update a key. * - * This request retrieves a single volume profile specified by the name in the URL. + * This request updates a key's name. * - * @param getVolumeProfileOptions the {@link GetVolumeProfileOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VolumeProfile} + * @param updateKeyOptions the {@link UpdateKeyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Key} */ - public ServiceCall getVolumeProfile(GetVolumeProfileOptions getVolumeProfileOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVolumeProfileOptions, - "getVolumeProfileOptions cannot be null"); + public ServiceCall updateKey(UpdateKeyOptions updateKeyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateKeyOptions, + "updateKeyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getVolumeProfileOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volume/profiles/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVolumeProfile"); + pathParamsMap.put("id", updateKeyOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/keys/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateKey"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateKeyOptions.keyPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List volumes. + * List load balancer profiles. * - * This request lists volumes in the region. Volumes are network-connected block storage devices that may be attached - * to one or more instances in the same region. + * This request lists load balancer profiles available in the region. A load balancer profile specifies the + * performance characteristics and pricing model for a load balancer. * - * @param listVolumesOptions the {@link ListVolumesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VolumeCollection} + * @param listLoadBalancerProfilesOptions the {@link ListLoadBalancerProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerProfileCollection} */ - public ServiceCall listVolumes(ListVolumesOptions listVolumesOptions) { - if (listVolumesOptions == null) { - listVolumesOptions = new ListVolumesOptions.Builder().build(); + public ServiceCall listLoadBalancerProfiles(ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions) { + if (listLoadBalancerProfilesOptions == null) { + listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder().build(); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVolumes"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancer/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVolumesOptions.start() != null) { - builder.query("start", String.valueOf(listVolumesOptions.start())); - } - if (listVolumesOptions.limit() != null) { - builder.query("limit", String.valueOf(listVolumesOptions.limit())); - } - 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.tag() != null) { - builder.query("tag", String.valueOf(listVolumesOptions.tag())); + if (listLoadBalancerProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listLoadBalancerProfilesOptions.start())); } - if (listVolumesOptions.zoneName() != null) { - builder.query("zone.name", String.valueOf(listVolumesOptions.zoneName())); + if (listLoadBalancerProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listLoadBalancerProfilesOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List volumes. + * List load balancer profiles. * - * This request lists volumes in the region. Volumes are network-connected block storage devices that may be attached - * to one or more instances in the same region. + * This request lists load balancer profiles available in the region. A load balancer profile specifies the + * performance characteristics and pricing model for a load balancer. * - * @return a {@link ServiceCall} with a result of type {@link VolumeCollection} + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerProfileCollection} */ - public ServiceCall listVolumes() { - return listVolumes(null); + public ServiceCall listLoadBalancerProfiles() { + return listLoadBalancerProfiles(null); } /** - * Create a volume. + * Retrieve a load balancer profile. * - * This request creates a new volume from a volume prototype object. The prototype object is structured in the same - * way as a retrieved volume, and contains the information necessary to create the new volume. + * This request retrieves a load balancer profile specified by the name in the URL. * - * @param createVolumeOptions the {@link CreateVolumeOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Volume} + * @param getLoadBalancerProfileOptions the {@link GetLoadBalancerProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerProfile} */ - public ServiceCall createVolume(CreateVolumeOptions createVolumeOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVolumeOptions, - "createVolumeOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVolume"); + public ServiceCall getLoadBalancerProfile(GetLoadBalancerProfileOptions getLoadBalancerProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerProfileOptions, + "getLoadBalancerProfileOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("name", getLoadBalancerProfileOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancer/profiles/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerProfile"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createVolumeOptions.volumePrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a volume. + * List load balancers. * - * This request deletes a volume. This operation cannot be reversed. For this request to succeed, the volume must not - * be attached to any instances. + * This request lists load balancers in the region. * - * @param deleteVolumeOptions the {@link DeleteVolumeOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listLoadBalancersOptions the {@link ListLoadBalancersOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerCollection} */ - public ServiceCall deleteVolume(DeleteVolumeOptions deleteVolumeOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVolumeOptions, - "deleteVolumeOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteVolumeOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVolume"); + public ServiceCall listLoadBalancers(ListLoadBalancersOptions listLoadBalancersOptions) { + if (listLoadBalancersOptions == null) { + listLoadBalancersOptions = new ListLoadBalancersOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancers"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - if (deleteVolumeOptions.ifMatch() != null) { - builder.header("If-Match", deleteVolumeOptions.ifMatch()); - } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listLoadBalancersOptions.start() != null) { + builder.query("start", String.valueOf(listLoadBalancersOptions.start())); + } + if (listLoadBalancersOptions.limit() != null) { + builder.query("limit", String.valueOf(listLoadBalancersOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a volume. + * List load balancers. * - * This request retrieves a single volume specified by the identifier in the URL. + * This request lists load balancers in the region. * - * @param getVolumeOptions the {@link GetVolumeOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Volume} + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerCollection} */ - public ServiceCall getVolume(GetVolumeOptions getVolumeOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVolumeOptions, - "getVolumeOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVolumeOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVolume"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listLoadBalancers() { + return listLoadBalancers(null); } /** - * Update a volume. + * Create a load balancer. * - * This request updates a volume with the information in a provided volume patch. The volume patch object is - * structured in the same way as a retrieved volume and contains only the information to be updated. + * This request creates and provisions a new load balancer. * - * @param updateVolumeOptions the {@link UpdateVolumeOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Volume} + * @param createLoadBalancerOptions the {@link CreateLoadBalancerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancer} */ - public ServiceCall updateVolume(UpdateVolumeOptions updateVolumeOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVolumeOptions, - "updateVolumeOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateVolumeOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVolume"); + public ServiceCall createLoadBalancer(CreateLoadBalancerOptions createLoadBalancerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerOptions, + "createLoadBalancerOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateVolumeOptions.ifMatch() != null) { - builder.header("If-Match", updateVolumeOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVolumeOptions.volumePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List snapshot consistency groups. - * - * This request lists snapshot consistency groups in the region. A snapshot consistency group is a collection of - * individual snapshots taken at the same time. - * - * @param listSnapshotConsistencyGroupsOptions the {@link ListSnapshotConsistencyGroupsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroupCollection} - */ - public ServiceCall listSnapshotConsistencyGroups(ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptions) { - if (listSnapshotConsistencyGroupsOptions == null) { - listSnapshotConsistencyGroupsOptions = new ListSnapshotConsistencyGroupsOptions.Builder().build(); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("is_public", createLoadBalancerOptions.isPublic()); + contentJson.add("subnets", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.subnets())); + if (createLoadBalancerOptions.dns() != null) { + contentJson.add("dns", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.dns())); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSnapshotConsistencyGroups"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); + if (createLoadBalancerOptions.isPrivatePath() != null) { + contentJson.addProperty("is_private_path", createLoadBalancerOptions.isPrivatePath()); } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - if (listSnapshotConsistencyGroupsOptions.start() != null) { - builder.query("start", String.valueOf(listSnapshotConsistencyGroupsOptions.start())); + if (createLoadBalancerOptions.listeners() != null) { + contentJson.add("listeners", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.listeners())); } - if (listSnapshotConsistencyGroupsOptions.limit() != null) { - builder.query("limit", String.valueOf(listSnapshotConsistencyGroupsOptions.limit())); + if (createLoadBalancerOptions.logging() != null) { + contentJson.add("logging", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.logging())); } - if (listSnapshotConsistencyGroupsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listSnapshotConsistencyGroupsOptions.resourceGroupId())); + if (createLoadBalancerOptions.name() != null) { + contentJson.addProperty("name", createLoadBalancerOptions.name()); } - if (listSnapshotConsistencyGroupsOptions.name() != null) { - builder.query("name", String.valueOf(listSnapshotConsistencyGroupsOptions.name())); + if (createLoadBalancerOptions.pools() != null) { + contentJson.add("pools", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.pools())); } - if (listSnapshotConsistencyGroupsOptions.sort() != null) { - builder.query("sort", String.valueOf(listSnapshotConsistencyGroupsOptions.sort())); + if (createLoadBalancerOptions.profile() != null) { + contentJson.add("profile", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.profile())); } - if (listSnapshotConsistencyGroupsOptions.backupPolicyPlanId() != null) { - builder.query("backup_policy_plan.id", String.valueOf(listSnapshotConsistencyGroupsOptions.backupPolicyPlanId())); + if (createLoadBalancerOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.resourceGroup())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (createLoadBalancerOptions.routeMode() != null) { + contentJson.addProperty("route_mode", createLoadBalancerOptions.routeMode()); + } + if (createLoadBalancerOptions.securityGroups() != null) { + contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.securityGroups())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List snapshot consistency groups. - * - * This request lists snapshot consistency groups in the region. A snapshot consistency group is a collection of - * individual snapshots taken at the same time. - * - * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroupCollection} - */ - public ServiceCall listSnapshotConsistencyGroups() { - return listSnapshotConsistencyGroups(null); - } - - /** - * Create a snapshot consistency group. + * Delete a load balancer. * - * This request creates a new snapshot consistency group from a snapshot consistency group object. The prototype - * object is structured in the same way as a retrieved consistency group, and contains the information necessary to - * provision the new snapshot consistency group. + * This request deletes a load balancer. This operation cannot be reversed. A load balancer cannot be deleted if its + * `provisioning_status` is `delete_pending` or it is referenced by a resource. * - * @param createSnapshotConsistencyGroupOptions the {@link CreateSnapshotConsistencyGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroup} + * @param deleteLoadBalancerOptions the {@link DeleteLoadBalancerOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createSnapshotConsistencyGroup(CreateSnapshotConsistencyGroupOptions createSnapshotConsistencyGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createSnapshotConsistencyGroupOptions, - "createSnapshotConsistencyGroupOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSnapshotConsistencyGroup"); + public ServiceCall deleteLoadBalancer(DeleteLoadBalancerOptions deleteLoadBalancerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerOptions, + "deleteLoadBalancerOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", deleteLoadBalancerOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); + if (deleteLoadBalancerOptions.ifMatch() != null) { + builder.header("If-Match", deleteLoadBalancerOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createSnapshotConsistencyGroupOptions.snapshotConsistencyGroupPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a snapshot consistency group. + * Retrieve a load balancer. * - * This request deletes snapshot consistency group. This operation cannot be reversed. If the - * `delete_snapshots_on_delete` property is `true`, all snapshots in the consistency group will also be deleted. + * This request retrieves a single load balancer specified by the identifier in the URL path. * - * @param deleteSnapshotConsistencyGroupOptions the {@link DeleteSnapshotConsistencyGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroup} + * @param getLoadBalancerOptions the {@link GetLoadBalancerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancer} */ - public ServiceCall deleteSnapshotConsistencyGroup(DeleteSnapshotConsistencyGroupOptions deleteSnapshotConsistencyGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotConsistencyGroupOptions, - "deleteSnapshotConsistencyGroupOptions cannot be null"); + public ServiceCall getLoadBalancer(GetLoadBalancerOptions getLoadBalancerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerOptions, + "getLoadBalancerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteSnapshotConsistencyGroupOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSnapshotConsistencyGroup"); + pathParamsMap.put("id", getLoadBalancerOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a snapshot consistency group. + * Update a load balancer. * - * This request retrieves a single snapshot consistency group specified by the identifier in the URL. + * This request updates a load balancer with the information in a provided load balancer patch. The load balancer + * patch object is structured in the same way as a retrieved load balancer and contains only the information to be + * updated. A load balancer can only be updated if its `provisioning_status` is `active`. * - * @param getSnapshotConsistencyGroupOptions the {@link GetSnapshotConsistencyGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroup} + * @param updateLoadBalancerOptions the {@link UpdateLoadBalancerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancer} */ - public ServiceCall getSnapshotConsistencyGroup(GetSnapshotConsistencyGroupOptions getSnapshotConsistencyGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSnapshotConsistencyGroupOptions, - "getSnapshotConsistencyGroupOptions cannot be null"); + public ServiceCall updateLoadBalancer(UpdateLoadBalancerOptions updateLoadBalancerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerOptions, + "updateLoadBalancerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getSnapshotConsistencyGroupOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSnapshotConsistencyGroup"); + pathParamsMap.put("id", updateLoadBalancerOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateLoadBalancerOptions.ifMatch() != null) { + builder.header("If-Match", updateLoadBalancerOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerOptions.loadBalancerPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a snapshot consistency group. + * List statistics of a load balancer. * - * This request updates a snapshot consistency group with the information in a provided snapshot consistency group - * patch. The snapshot consistency group patch object is structured in the same way as a retrieved snapshot - * consistency group and contains only the information to be updated. + * This request lists statistics of a load balancer. * - * @param updateSnapshotConsistencyGroupOptions the {@link UpdateSnapshotConsistencyGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroup} + * @param getLoadBalancerStatisticsOptions the {@link GetLoadBalancerStatisticsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerStatistics} */ - public ServiceCall updateSnapshotConsistencyGroup(UpdateSnapshotConsistencyGroupOptions updateSnapshotConsistencyGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateSnapshotConsistencyGroupOptions, - "updateSnapshotConsistencyGroupOptions cannot be null"); + public ServiceCall getLoadBalancerStatistics(GetLoadBalancerStatisticsOptions getLoadBalancerStatisticsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerStatisticsOptions, + "getLoadBalancerStatisticsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateSnapshotConsistencyGroupOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSnapshotConsistencyGroup"); + pathParamsMap.put("id", getLoadBalancerStatisticsOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{id}/statistics", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerStatistics"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateSnapshotConsistencyGroupOptions.ifMatch() != null) { - builder.header("If-Match", updateSnapshotConsistencyGroupOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSnapshotConsistencyGroupOptions.snapshotConsistencyGroupPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a filtered collection of snapshots. + * List listeners for a load balancer. * - * This request deletes snapshots that match the specified filter. This operation cannot be reversed. + * This request lists listeners for a load balancer. * - * @param deleteSnapshotsOptions the {@link DeleteSnapshotsOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listLoadBalancerListenersOptions the {@link ListLoadBalancerListenersOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerCollection} */ - public ServiceCall deleteSnapshots(DeleteSnapshotsOptions deleteSnapshotsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotsOptions, - "deleteSnapshotsOptions cannot be null"); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSnapshots"); + public ServiceCall listLoadBalancerListeners(ListLoadBalancerListenersOptions listLoadBalancerListenersOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerListenersOptions, + "listLoadBalancerListenersOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("load_balancer_id", listLoadBalancerListenersOptions.loadBalancerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerListeners"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.query("source_volume.id", String.valueOf(deleteSnapshotsOptions.sourceVolumeId())); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List snapshots. + * Create a listener for a load balancer. * - * This request lists snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is - * created. + * This request creates a new listener for a load balancer. * - * @param listSnapshotsOptions the {@link ListSnapshotsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotCollection} + * @param createLoadBalancerListenerOptions the {@link CreateLoadBalancerListenerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListener} */ - public ServiceCall listSnapshots(ListSnapshotsOptions listSnapshotsOptions) { - if (listSnapshotsOptions == null) { - listSnapshotsOptions = new ListSnapshotsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSnapshots"); + public ServiceCall createLoadBalancerListener(CreateLoadBalancerListenerOptions createLoadBalancerListenerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerListenerOptions, + "createLoadBalancerListenerOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("load_balancer_id", createLoadBalancerListenerOptions.loadBalancerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerListener"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listSnapshotsOptions.start() != null) { - builder.query("start", String.valueOf(listSnapshotsOptions.start())); - } - if (listSnapshotsOptions.limit() != null) { - builder.query("limit", String.valueOf(listSnapshotsOptions.limit())); - } - if (listSnapshotsOptions.tag() != null) { - builder.query("tag", String.valueOf(listSnapshotsOptions.tag())); - } - if (listSnapshotsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listSnapshotsOptions.resourceGroupId())); - } - if (listSnapshotsOptions.name() != null) { - builder.query("name", String.valueOf(listSnapshotsOptions.name())); - } - if (listSnapshotsOptions.sourceVolumeId() != null) { - builder.query("source_volume.id", String.valueOf(listSnapshotsOptions.sourceVolumeId())); - } - if (listSnapshotsOptions.sourceVolumeCrn() != null) { - builder.query("source_volume.crn", String.valueOf(listSnapshotsOptions.sourceVolumeCrn())); - } - if (listSnapshotsOptions.sourceImageId() != null) { - builder.query("source_image.id", String.valueOf(listSnapshotsOptions.sourceImageId())); - } - if (listSnapshotsOptions.sourceImageCrn() != null) { - builder.query("source_image.crn", String.valueOf(listSnapshotsOptions.sourceImageCrn())); - } - if (listSnapshotsOptions.sort() != null) { - builder.query("sort", String.valueOf(listSnapshotsOptions.sort())); - } - if (listSnapshotsOptions.backupPolicyPlanId() != null) { - builder.query("backup_policy_plan.id", String.valueOf(listSnapshotsOptions.backupPolicyPlanId())); - } - if (listSnapshotsOptions.copiesId() != null) { - builder.query("copies[].id", String.valueOf(listSnapshotsOptions.copiesId())); - } - if (listSnapshotsOptions.copiesName() != null) { - builder.query("copies[].name", String.valueOf(listSnapshotsOptions.copiesName())); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("protocol", createLoadBalancerListenerOptions.protocol()); + if (createLoadBalancerListenerOptions.acceptProxyProtocol() != null) { + contentJson.addProperty("accept_proxy_protocol", createLoadBalancerListenerOptions.acceptProxyProtocol()); } - if (listSnapshotsOptions.copiesCrn() != null) { - builder.query("copies[].crn", String.valueOf(listSnapshotsOptions.copiesCrn())); + if (createLoadBalancerListenerOptions.certificateInstance() != null) { + contentJson.add("certificate_instance", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerOptions.certificateInstance())); } - if (listSnapshotsOptions.copiesRemoteRegionName() != null) { - builder.query("copies[].remote.region.name", String.valueOf(listSnapshotsOptions.copiesRemoteRegionName())); + if (createLoadBalancerListenerOptions.connectionLimit() != null) { + contentJson.addProperty("connection_limit", createLoadBalancerListenerOptions.connectionLimit()); } - if (listSnapshotsOptions.sourceSnapshotId() != null) { - builder.query("source_snapshot.id", String.valueOf(listSnapshotsOptions.sourceSnapshotId())); + if (createLoadBalancerListenerOptions.defaultPool() != null) { + contentJson.add("default_pool", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerOptions.defaultPool())); } - if (listSnapshotsOptions.sourceSnapshotRemoteRegionName() != null) { - builder.query("source_snapshot.remote.region.name", String.valueOf(listSnapshotsOptions.sourceSnapshotRemoteRegionName())); + if (createLoadBalancerListenerOptions.httpsRedirect() != null) { + contentJson.add("https_redirect", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerOptions.httpsRedirect())); } - if (listSnapshotsOptions.sourceVolumeRemoteRegionName() != null) { - builder.query("source_volume.remote.region.name", String.valueOf(listSnapshotsOptions.sourceVolumeRemoteRegionName())); + if (createLoadBalancerListenerOptions.idleConnectionTimeout() != null) { + contentJson.addProperty("idle_connection_timeout", createLoadBalancerListenerOptions.idleConnectionTimeout()); } - if (listSnapshotsOptions.sourceImageRemoteRegionName() != null) { - builder.query("source_image.remote.region.name", String.valueOf(listSnapshotsOptions.sourceImageRemoteRegionName())); + if (createLoadBalancerListenerOptions.policies() != null) { + contentJson.add("policies", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerOptions.policies())); } - if (listSnapshotsOptions.clonesZoneName() != null) { - builder.query("clones[].zone.name", String.valueOf(listSnapshotsOptions.clonesZoneName())); + if (createLoadBalancerListenerOptions.port() != null) { + contentJson.addProperty("port", createLoadBalancerListenerOptions.port()); } - if (listSnapshotsOptions.snapshotConsistencyGroupId() != null) { - builder.query("snapshot_consistency_group.id", String.valueOf(listSnapshotsOptions.snapshotConsistencyGroupId())); + if (createLoadBalancerListenerOptions.portMax() != null) { + contentJson.addProperty("port_max", createLoadBalancerListenerOptions.portMax()); } - if (listSnapshotsOptions.snapshotConsistencyGroupCrn() != null) { - builder.query("snapshot_consistency_group.crn", String.valueOf(listSnapshotsOptions.snapshotConsistencyGroupCrn())); + if (createLoadBalancerListenerOptions.portMin() != null) { + contentJson.addProperty("port_min", createLoadBalancerListenerOptions.portMin()); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List snapshots. - * - * This request lists snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is - * created. - * - * @return a {@link ServiceCall} with a result of type {@link SnapshotCollection} - */ - public ServiceCall listSnapshots() { - return listSnapshots(null); - } - - /** - * Create a snapshot. + * Delete a load balancer listener. * - * This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the - * same way as a retrieved snapshot, and contains the information necessary to provision the new snapshot. + * This request deletes a load balancer listener. This operation cannot be reversed. For this operation to succeed, + * the listener must not be the target of another load balancer listener. * - * @param createSnapshotOptions the {@link CreateSnapshotOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Snapshot} + * @param deleteLoadBalancerListenerOptions the {@link DeleteLoadBalancerListenerOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createSnapshot(CreateSnapshotOptions createSnapshotOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createSnapshotOptions, - "createSnapshotOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSnapshot"); + public ServiceCall deleteLoadBalancerListener(DeleteLoadBalancerListenerOptions deleteLoadBalancerListenerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerListenerOptions, + "deleteLoadBalancerListenerOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("load_balancer_id", deleteLoadBalancerListenerOptions.loadBalancerId()); + pathParamsMap.put("id", deleteLoadBalancerListenerOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerListener"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createSnapshotOptions.snapshotPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a snapshot. + * Retrieve a load balancer listener. * - * This request deletes a snapshot. This operation cannot be reversed. + * This request retrieves a single listener specified by the identifier in the URL path. * - * @param deleteSnapshotOptions the {@link DeleteSnapshotOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getLoadBalancerListenerOptions the {@link GetLoadBalancerListenerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListener} */ - public ServiceCall deleteSnapshot(DeleteSnapshotOptions deleteSnapshotOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotOptions, - "deleteSnapshotOptions cannot be null"); + public ServiceCall getLoadBalancerListener(GetLoadBalancerListenerOptions getLoadBalancerListenerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerListenerOptions, + "getLoadBalancerListenerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteSnapshotOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSnapshot"); + pathParamsMap.put("load_balancer_id", getLoadBalancerListenerOptions.loadBalancerId()); + pathParamsMap.put("id", getLoadBalancerListenerOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerListener"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - if (deleteSnapshotOptions.ifMatch() != null) { - builder.header("If-Match", deleteSnapshotOptions.ifMatch()); - } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a snapshot. + * Update a load balancer listener. * - * This request retrieves a single snapshot specified by the identifier in the URL. + * This request updates a load balancer listener from a listener patch. * - * @param getSnapshotOptions the {@link GetSnapshotOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Snapshot} + * @param updateLoadBalancerListenerOptions the {@link UpdateLoadBalancerListenerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListener} */ - public ServiceCall getSnapshot(GetSnapshotOptions getSnapshotOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSnapshotOptions, - "getSnapshotOptions cannot be null"); + public ServiceCall updateLoadBalancerListener(UpdateLoadBalancerListenerOptions updateLoadBalancerListenerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerListenerOptions, + "updateLoadBalancerListenerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getSnapshotOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSnapshot"); + pathParamsMap.put("load_balancer_id", updateLoadBalancerListenerOptions.loadBalancerId()); + pathParamsMap.put("id", updateLoadBalancerListenerOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerListener"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerListenerOptions.loadBalancerListenerPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a snapshot. + * List policies for a load balancer listener. * - * This request updates a snapshot with the information in a provided snapshot patch. The snapshot consistency group - * patch object is structured in the same way as a retrieved snapshot and contains only the information to be updated. + * This request lists policies for a load balancer listener. A policy consists of rules to match against each incoming + * request, and an action to apply to the request if a rule matches. * - * @param updateSnapshotOptions the {@link UpdateSnapshotOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Snapshot} + * @param listLoadBalancerListenerPoliciesOptions the {@link ListLoadBalancerListenerPoliciesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyCollection} */ - public ServiceCall updateSnapshot(UpdateSnapshotOptions updateSnapshotOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateSnapshotOptions, - "updateSnapshotOptions cannot be null"); + public ServiceCall listLoadBalancerListenerPolicies(ListLoadBalancerListenerPoliciesOptions listLoadBalancerListenerPoliciesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerListenerPoliciesOptions, + "listLoadBalancerListenerPoliciesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateSnapshotOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSnapshot"); + pathParamsMap.put("load_balancer_id", listLoadBalancerListenerPoliciesOptions.loadBalancerId()); + pathParamsMap.put("listener_id", listLoadBalancerListenerPoliciesOptions.listenerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerListenerPolicies"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateSnapshotOptions.ifMatch() != null) { - builder.header("If-Match", updateSnapshotOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSnapshotOptions.snapshotPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List clones for a snapshot. + * Create a policy for a load balancer listener. * - * This request lists clones for a snapshot. Use a clone to quickly restore a snapshot within the clone's zone. + * 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 load balancer must be in the `application` family. * - * @param listSnapshotClonesOptions the {@link ListSnapshotClonesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotCloneCollection} + * @param createLoadBalancerListenerPolicyOptions the {@link CreateLoadBalancerListenerPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy} */ - public ServiceCall listSnapshotClones(ListSnapshotClonesOptions listSnapshotClonesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listSnapshotClonesOptions, - "listSnapshotClonesOptions cannot be null"); + public ServiceCall createLoadBalancerListenerPolicy(CreateLoadBalancerListenerPolicyOptions createLoadBalancerListenerPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerListenerPolicyOptions, + "createLoadBalancerListenerPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", listSnapshotClonesOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/clones", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSnapshotClones"); + pathParamsMap.put("load_balancer_id", createLoadBalancerListenerPolicyOptions.loadBalancerId()); + pathParamsMap.put("listener_id", createLoadBalancerListenerPolicyOptions.listenerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerListenerPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete a snapshot clone. - * - * This request deletes a snapshot clone. This operation cannot be reversed, but an equivalent clone may be recreated - * from the snapshot. - * - * @param deleteSnapshotCloneOptions the {@link DeleteSnapshotCloneOptions} containing the options for the call + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("action", createLoadBalancerListenerPolicyOptions.action()); + contentJson.addProperty("priority", createLoadBalancerListenerPolicyOptions.priority()); + if (createLoadBalancerListenerPolicyOptions.name() != null) { + contentJson.addProperty("name", createLoadBalancerListenerPolicyOptions.name()); + } + if (createLoadBalancerListenerPolicyOptions.rules() != null) { + contentJson.add("rules", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerPolicyOptions.rules())); + } + if (createLoadBalancerListenerPolicyOptions.target() != null) { + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerPolicyOptions.target())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Delete a load balancer listener policy. + * + * Deletes a policy of the load balancer listener. This operation cannot be reversed. + * + * @param deleteLoadBalancerListenerPolicyOptions the {@link DeleteLoadBalancerListenerPolicyOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteSnapshotClone(DeleteSnapshotCloneOptions deleteSnapshotCloneOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotCloneOptions, - "deleteSnapshotCloneOptions cannot be null"); + public ServiceCall deleteLoadBalancerListenerPolicy(DeleteLoadBalancerListenerPolicyOptions deleteLoadBalancerListenerPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerListenerPolicyOptions, + "deleteLoadBalancerListenerPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteSnapshotCloneOptions.id()); - pathParamsMap.put("zone_name", deleteSnapshotCloneOptions.zoneName()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/clones/{zone_name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSnapshotClone"); + pathParamsMap.put("load_balancer_id", deleteLoadBalancerListenerPolicyOptions.loadBalancerId()); + pathParamsMap.put("listener_id", deleteLoadBalancerListenerPolicyOptions.listenerId()); + pathParamsMap.put("id", deleteLoadBalancerListenerPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerListenerPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -7899,793 +7932,780 @@ public ServiceCall deleteSnapshotClone(DeleteSnapshotCloneOptions deleteSn } /** - * Retrieve a snapshot clone. + * Retrieve a load balancer listener policy. * - * This request retrieves a single clone specified by the snapshot identifier and zone name in the URL. + * Retrieve a single policy specified by the identifier in the URL path. * - * @param getSnapshotCloneOptions the {@link GetSnapshotCloneOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotClone} + * @param getLoadBalancerListenerPolicyOptions the {@link GetLoadBalancerListenerPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy} */ - public ServiceCall getSnapshotClone(GetSnapshotCloneOptions getSnapshotCloneOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSnapshotCloneOptions, - "getSnapshotCloneOptions cannot be null"); + public ServiceCall getLoadBalancerListenerPolicy(GetLoadBalancerListenerPolicyOptions getLoadBalancerListenerPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerListenerPolicyOptions, + "getLoadBalancerListenerPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getSnapshotCloneOptions.id()); - pathParamsMap.put("zone_name", getSnapshotCloneOptions.zoneName()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/clones/{zone_name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSnapshotClone"); + pathParamsMap.put("load_balancer_id", getLoadBalancerListenerPolicyOptions.loadBalancerId()); + pathParamsMap.put("listener_id", getLoadBalancerListenerPolicyOptions.listenerId()); + pathParamsMap.put("id", getLoadBalancerListenerPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerListenerPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a clone for a snapshot. + * Update a load balancer listener policy. * - * This request creates a new clone for a snapshot in the specified zone. A request body is not required, and if - * provided, is ignored. If the snapshot already has a clone in the zone, it is returned. + * This request updates a load balancer listener policy with the information in a provided policy patch. The policy + * patch object is structured in the same way as a retrieved policy and contains only the information to be updated. * - * @param createSnapshotCloneOptions the {@link CreateSnapshotCloneOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SnapshotClone} + * @param updateLoadBalancerListenerPolicyOptions the {@link UpdateLoadBalancerListenerPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy} */ - public ServiceCall createSnapshotClone(CreateSnapshotCloneOptions createSnapshotCloneOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createSnapshotCloneOptions, - "createSnapshotCloneOptions cannot be null"); + public ServiceCall updateLoadBalancerListenerPolicy(UpdateLoadBalancerListenerPolicyOptions updateLoadBalancerListenerPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerListenerPolicyOptions, + "updateLoadBalancerListenerPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", createSnapshotCloneOptions.id()); - pathParamsMap.put("zone_name", createSnapshotCloneOptions.zoneName()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/clones/{zone_name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSnapshotClone"); + pathParamsMap.put("load_balancer_id", updateLoadBalancerListenerPolicyOptions.loadBalancerId()); + pathParamsMap.put("listener_id", updateLoadBalancerListenerPolicyOptions.listenerId()); + pathParamsMap.put("id", updateLoadBalancerListenerPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerListenerPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerListenerPolicyOptions.loadBalancerListenerPolicyPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List file share profiles. + * List rules of a load balancer listener policy. * - * This request lists [file share profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) available - * in the region. A file share profile specifies the performance characteristics and pricing model for a file share. + * This request lists rules of a load balancer listener policy. * - * @param listShareProfilesOptions the {@link ListShareProfilesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareProfileCollection} + * @param listLoadBalancerListenerPolicyRulesOptions the {@link ListLoadBalancerListenerPolicyRulesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyRuleCollection} */ - public ServiceCall listShareProfiles(ListShareProfilesOptions listShareProfilesOptions) { - if (listShareProfilesOptions == null) { - listShareProfilesOptions = new ListShareProfilesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/share/profiles")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShareProfiles"); + public ServiceCall listLoadBalancerListenerPolicyRules(ListLoadBalancerListenerPolicyRulesOptions listLoadBalancerListenerPolicyRulesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerListenerPolicyRulesOptions, + "listLoadBalancerListenerPolicyRulesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("load_balancer_id", listLoadBalancerListenerPolicyRulesOptions.loadBalancerId()); + pathParamsMap.put("listener_id", listLoadBalancerListenerPolicyRulesOptions.listenerId()); + pathParamsMap.put("policy_id", listLoadBalancerListenerPolicyRulesOptions.policyId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerListenerPolicyRules"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listShareProfilesOptions.start() != null) { - builder.query("start", String.valueOf(listShareProfilesOptions.start())); - } - if (listShareProfilesOptions.limit() != null) { - builder.query("limit", String.valueOf(listShareProfilesOptions.limit())); - } - if (listShareProfilesOptions.sort() != null) { - builder.query("sort", String.valueOf(listShareProfilesOptions.sort())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List file share profiles. + * Create a rule for a load balancer listener policy. * - * This request lists [file share profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) available - * in the region. A file share profile specifies the performance characteristics and pricing model for a file share. + * Creates a new rule for the load balancer listener policy. * - * @return a {@link ServiceCall} with a result of type {@link ShareProfileCollection} + * @param createLoadBalancerListenerPolicyRuleOptions the {@link CreateLoadBalancerListenerPolicyRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyRule} */ - public ServiceCall listShareProfiles() { - return listShareProfiles(null); + public ServiceCall createLoadBalancerListenerPolicyRule(CreateLoadBalancerListenerPolicyRuleOptions createLoadBalancerListenerPolicyRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerListenerPolicyRuleOptions, + "createLoadBalancerListenerPolicyRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("load_balancer_id", createLoadBalancerListenerPolicyRuleOptions.loadBalancerId()); + pathParamsMap.put("listener_id", createLoadBalancerListenerPolicyRuleOptions.listenerId()); + pathParamsMap.put("policy_id", createLoadBalancerListenerPolicyRuleOptions.policyId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerListenerPolicyRule"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("condition", createLoadBalancerListenerPolicyRuleOptions.condition()); + contentJson.addProperty("type", createLoadBalancerListenerPolicyRuleOptions.type()); + contentJson.addProperty("value", createLoadBalancerListenerPolicyRuleOptions.value()); + if (createLoadBalancerListenerPolicyRuleOptions.field() != null) { + contentJson.addProperty("field", createLoadBalancerListenerPolicyRuleOptions.field()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a file share profile. + * Delete a load balancer listener policy rule. * - * This request retrieves a single file share profile specified by the name in the URL. + * Deletes a rule from the load balancer listener policy. This operation cannot be reversed. * - * @param getShareProfileOptions the {@link GetShareProfileOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareProfile} + * @param deleteLoadBalancerListenerPolicyRuleOptions the {@link DeleteLoadBalancerListenerPolicyRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getShareProfile(GetShareProfileOptions getShareProfileOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getShareProfileOptions, - "getShareProfileOptions cannot be null"); + public ServiceCall deleteLoadBalancerListenerPolicyRule(DeleteLoadBalancerListenerPolicyRuleOptions deleteLoadBalancerListenerPolicyRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerListenerPolicyRuleOptions, + "deleteLoadBalancerListenerPolicyRuleOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getShareProfileOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/share/profiles/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareProfile"); + pathParamsMap.put("load_balancer_id", deleteLoadBalancerListenerPolicyRuleOptions.loadBalancerId()); + pathParamsMap.put("listener_id", deleteLoadBalancerListenerPolicyRuleOptions.listenerId()); + pathParamsMap.put("policy_id", deleteLoadBalancerListenerPolicyRuleOptions.policyId()); + pathParamsMap.put("id", deleteLoadBalancerListenerPolicyRuleOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerListenerPolicyRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List file shares. + * Retrieve a load balancer listener policy rule. * - * This request lists file shares in the region. + * Retrieves a single rule specified by the identifier in the URL path. * - * @param listSharesOptions the {@link ListSharesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareCollection} + * @param getLoadBalancerListenerPolicyRuleOptions the {@link GetLoadBalancerListenerPolicyRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyRule} */ - public ServiceCall listShares(ListSharesOptions listSharesOptions) { - if (listSharesOptions == null) { - listSharesOptions = new ListSharesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShares"); + public ServiceCall getLoadBalancerListenerPolicyRule(GetLoadBalancerListenerPolicyRuleOptions getLoadBalancerListenerPolicyRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerListenerPolicyRuleOptions, + "getLoadBalancerListenerPolicyRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("load_balancer_id", getLoadBalancerListenerPolicyRuleOptions.loadBalancerId()); + pathParamsMap.put("listener_id", getLoadBalancerListenerPolicyRuleOptions.listenerId()); + pathParamsMap.put("policy_id", getLoadBalancerListenerPolicyRuleOptions.policyId()); + pathParamsMap.put("id", getLoadBalancerListenerPolicyRuleOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerListenerPolicyRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listSharesOptions.start() != null) { - builder.query("start", String.valueOf(listSharesOptions.start())); - } - if (listSharesOptions.limit() != null) { - builder.query("limit", String.valueOf(listSharesOptions.limit())); - } - if (listSharesOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listSharesOptions.resourceGroupId())); - } - if (listSharesOptions.name() != null) { - builder.query("name", String.valueOf(listSharesOptions.name())); - } - if (listSharesOptions.sort() != null) { - builder.query("sort", String.valueOf(listSharesOptions.sort())); - } - if (listSharesOptions.replicationRole() != null) { - builder.query("replication_role", String.valueOf(listSharesOptions.replicationRole())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List file shares. + * Update a load balancer listener policy rule. * - * This request lists file shares in the region. + * Updates a rule of the load balancer listener policy. * - * @return a {@link ServiceCall} with a result of type {@link ShareCollection} + * @param updateLoadBalancerListenerPolicyRuleOptions the {@link UpdateLoadBalancerListenerPolicyRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyRule} */ - public ServiceCall listShares() { - return listShares(null); - } - - /** - * Create a file share. - * - * This request provisions new file shares from a share prototype object. The new file shares can be a standalone - * share, a replica share, or both a source and replica share. - * - * The prototype object is structured in the same way as a retrieved share, and contains the information necessary to - * provision the new file shares. - * - * @param createShareOptions the {@link CreateShareOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Share} - */ - public ServiceCall createShare(CreateShareOptions createShareOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createShareOptions, - "createShareOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createShare"); + public ServiceCall updateLoadBalancerListenerPolicyRule(UpdateLoadBalancerListenerPolicyRuleOptions updateLoadBalancerListenerPolicyRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerListenerPolicyRuleOptions, + "updateLoadBalancerListenerPolicyRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("load_balancer_id", updateLoadBalancerListenerPolicyRuleOptions.loadBalancerId()); + pathParamsMap.put("listener_id", updateLoadBalancerListenerPolicyRuleOptions.listenerId()); + pathParamsMap.put("policy_id", updateLoadBalancerListenerPolicyRuleOptions.policyId()); + pathParamsMap.put("id", updateLoadBalancerListenerPolicyRuleOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerListenerPolicyRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createShareOptions.sharePrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerListenerPolicyRuleOptions.loadBalancerListenerPolicyRulePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a file share. - * - * This request deletes a share. This operation cannot be reversed. A share cannot be deleted if it: - * - has share mount targets - * - has a `lifecycle_state` of `updating` - * - has a replication operation in progress + * List pools of a load balancer. * - * If the request is accepted, the share `lifecycle_state` will be set to `deleting`. Once deletion processing - * completes, it will no longer be retrievable. + * This request lists pools of a load balancer. * - * @param deleteShareOptions the {@link DeleteShareOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Share} + * @param listLoadBalancerPoolsOptions the {@link ListLoadBalancerPoolsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolCollection} */ - public ServiceCall deleteShare(DeleteShareOptions deleteShareOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareOptions, - "deleteShareOptions cannot be null"); + public ServiceCall listLoadBalancerPools(ListLoadBalancerPoolsOptions listLoadBalancerPoolsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerPoolsOptions, + "listLoadBalancerPoolsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteShareOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShare"); + pathParamsMap.put("load_balancer_id", listLoadBalancerPoolsOptions.loadBalancerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerPools"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (deleteShareOptions.ifMatch() != null) { - builder.header("If-Match", deleteShareOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a file share. + * Create a load balancer pool. * - * This request retrieves a single file share specified by the identifier in the URL. + * This request creates a new pool from a pool prototype object. * - * @param getShareOptions the {@link GetShareOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Share} + * @param createLoadBalancerPoolOptions the {@link CreateLoadBalancerPoolOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPool} */ - public ServiceCall getShare(GetShareOptions getShareOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getShareOptions, - "getShareOptions cannot be null"); + public ServiceCall createLoadBalancerPool(CreateLoadBalancerPoolOptions createLoadBalancerPoolOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerPoolOptions, + "createLoadBalancerPoolOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getShareOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShare"); + pathParamsMap.put("load_balancer_id", createLoadBalancerPoolOptions.loadBalancerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerPool"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("algorithm", createLoadBalancerPoolOptions.algorithm()); + contentJson.add("health_monitor", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolOptions.healthMonitor())); + contentJson.addProperty("protocol", createLoadBalancerPoolOptions.protocol()); + if (createLoadBalancerPoolOptions.failsafePolicy() != null) { + contentJson.add("failsafe_policy", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolOptions.failsafePolicy())); + } + if (createLoadBalancerPoolOptions.members() != null) { + contentJson.add("members", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolOptions.members())); + } + if (createLoadBalancerPoolOptions.name() != null) { + contentJson.addProperty("name", createLoadBalancerPoolOptions.name()); + } + if (createLoadBalancerPoolOptions.proxyProtocol() != null) { + contentJson.addProperty("proxy_protocol", createLoadBalancerPoolOptions.proxyProtocol()); + } + if (createLoadBalancerPoolOptions.sessionPersistence() != null) { + contentJson.add("session_persistence", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolOptions.sessionPersistence())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a file share. + * Delete a load balancer pool. * - * This request updates a share with the information in a provided share patch. The share patch object is structured - * in the same way as a retrieved share and contains only the information to be updated. + * This request deletes a load balancer pool. This operation cannot be reversed. The pool must not currently be the + * default pool for any listener in the load balancer, nor be the target pool in the failsafe policy for any other + * pool. * - * @param updateShareOptions the {@link UpdateShareOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Share} + * @param deleteLoadBalancerPoolOptions the {@link DeleteLoadBalancerPoolOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updateShare(UpdateShareOptions updateShareOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateShareOptions, - "updateShareOptions cannot be null"); + public ServiceCall deleteLoadBalancerPool(DeleteLoadBalancerPoolOptions deleteLoadBalancerPoolOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerPoolOptions, + "deleteLoadBalancerPoolOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateShareOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateShare"); + pathParamsMap.put("load_balancer_id", deleteLoadBalancerPoolOptions.loadBalancerId()); + pathParamsMap.put("id", deleteLoadBalancerPoolOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerPool"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); - if (updateShareOptions.ifMatch() != null) { - builder.header("If-Match", updateShareOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateShareOptions.sharePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List accessor bindings for a file share. - * - * This request lists accessor bindings for a share. Each accessor binding identifies a resource (possibly in another - * account) with access to this file share including its snapshots. + * Retrieve a load balancer pool. * - * The share accessor bindings will be sorted by their `created_at` property values, with newest bindings first. + * This request retrieves a single pool specified by the identifier in the URL path. * - * @param listShareAccessorBindingsOptions the {@link ListShareAccessorBindingsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareAccessorBindingCollection} + * @param getLoadBalancerPoolOptions the {@link GetLoadBalancerPoolOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPool} */ - public ServiceCall listShareAccessorBindings(ListShareAccessorBindingsOptions listShareAccessorBindingsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listShareAccessorBindingsOptions, - "listShareAccessorBindingsOptions cannot be null"); + public ServiceCall getLoadBalancerPool(GetLoadBalancerPoolOptions getLoadBalancerPoolOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerPoolOptions, + "getLoadBalancerPoolOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", listShareAccessorBindingsOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{id}/accessor_bindings", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShareAccessorBindings"); + pathParamsMap.put("load_balancer_id", getLoadBalancerPoolOptions.loadBalancerId()); + pathParamsMap.put("id", getLoadBalancerPoolOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerPool"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listShareAccessorBindingsOptions.start() != null) { - builder.query("start", String.valueOf(listShareAccessorBindingsOptions.start())); - } - if (listShareAccessorBindingsOptions.limit() != null) { - builder.query("limit", String.valueOf(listShareAccessorBindingsOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a file share accessor binding. + * Update a load balancer pool. * - * This request deletes a share accessor binding. This operation cannot be reversed. + * This request updates a load balancer pool from a pool patch. * - * @param deleteShareAccessorBindingOptions the {@link DeleteShareAccessorBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param updateLoadBalancerPoolOptions the {@link UpdateLoadBalancerPoolOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPool} */ - public ServiceCall deleteShareAccessorBinding(DeleteShareAccessorBindingOptions deleteShareAccessorBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareAccessorBindingOptions, - "deleteShareAccessorBindingOptions cannot be null"); + public ServiceCall updateLoadBalancerPool(UpdateLoadBalancerPoolOptions updateLoadBalancerPoolOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerPoolOptions, + "updateLoadBalancerPoolOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", deleteShareAccessorBindingOptions.shareId()); - pathParamsMap.put("id", deleteShareAccessorBindingOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/accessor_bindings/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShareAccessorBinding"); + pathParamsMap.put("load_balancer_id", updateLoadBalancerPoolOptions.loadBalancerId()); + pathParamsMap.put("id", updateLoadBalancerPoolOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerPool"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerPoolOptions.loadBalancerPoolPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a file share accessor binding. + * List members of a load balancer pool. * - * This request retrieves a single accessor binding specified by the identifier in the URL. + * This request lists members of a load balancer pool. * - * @param getShareAccessorBindingOptions the {@link GetShareAccessorBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareAccessorBinding} + * @param listLoadBalancerPoolMembersOptions the {@link ListLoadBalancerPoolMembersOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMemberCollection} */ - public ServiceCall getShareAccessorBinding(GetShareAccessorBindingOptions getShareAccessorBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getShareAccessorBindingOptions, - "getShareAccessorBindingOptions cannot be null"); + public ServiceCall listLoadBalancerPoolMembers(ListLoadBalancerPoolMembersOptions listLoadBalancerPoolMembersOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerPoolMembersOptions, + "listLoadBalancerPoolMembersOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", getShareAccessorBindingOptions.shareId()); - pathParamsMap.put("id", getShareAccessorBindingOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/accessor_bindings/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareAccessorBinding"); + pathParamsMap.put("load_balancer_id", listLoadBalancerPoolMembersOptions.loadBalancerId()); + pathParamsMap.put("pool_id", listLoadBalancerPoolMembersOptions.poolId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerPoolMembers"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Failover to replica file share. + * Create a member in a load balancer pool. * - * This request triggers a failover to the replica file share specified by the identifier in the URL. The failover - * cannot be started if a source share or the replica share has a `lifecycle_state` of `updating`, or has a - * replication operation in progress. + * This request creates a new member and adds the member to the pool. * - * If `fallback_policy` is specified as `split`, and the request is accepted but the failover operation cannot be - * performed, a split will be triggered. + * The pool must not already have a member targeting a load balancer. * - * @param failoverShareOptions the {@link FailoverShareOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param createLoadBalancerPoolMemberOptions the {@link CreateLoadBalancerPoolMemberOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember} */ - public ServiceCall failoverShare(FailoverShareOptions failoverShareOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(failoverShareOptions, - "failoverShareOptions cannot be null"); + public ServiceCall createLoadBalancerPoolMember(CreateLoadBalancerPoolMemberOptions createLoadBalancerPoolMemberOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerPoolMemberOptions, + "createLoadBalancerPoolMemberOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", failoverShareOptions.shareId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/failover", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "failoverShare"); + pathParamsMap.put("load_balancer_id", createLoadBalancerPoolMemberOptions.loadBalancerId()); + pathParamsMap.put("pool_id", createLoadBalancerPoolMemberOptions.poolId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerPoolMember"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - if (failoverShareOptions.fallbackPolicy() != null) { - contentJson.addProperty("fallback_policy", failoverShareOptions.fallbackPolicy()); - } - if (failoverShareOptions.timeout() != null) { - contentJson.addProperty("timeout", failoverShareOptions.timeout()); + contentJson.addProperty("port", createLoadBalancerPoolMemberOptions.port()); + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolMemberOptions.target())); + if (createLoadBalancerPoolMemberOptions.weight() != null) { + contentJson.addProperty("weight", createLoadBalancerPoolMemberOptions.weight()); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List mount targets for a file share. - * - * This request lists mount targets for a file share. A mount target is a network endpoint at which a file share may - * be mounted. The file share can be mounted by clients in the same VPC and zone after creating share mount targets. + * Replace load balancer pool members. * - * The share mount targets will be sorted by their `created_at` property values, with newest targets first. + * This request replaces the existing members of the load balancer pool with new members created from the collection + * of member prototype objects. * - * @param listShareMountTargetsOptions the {@link ListShareMountTargetsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareMountTargetCollection} + * @param replaceLoadBalancerPoolMembersOptions the {@link ReplaceLoadBalancerPoolMembersOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMemberCollection} */ - public ServiceCall listShareMountTargets(ListShareMountTargetsOptions listShareMountTargetsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listShareMountTargetsOptions, - "listShareMountTargetsOptions cannot be null"); + public ServiceCall replaceLoadBalancerPoolMembers(ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(replaceLoadBalancerPoolMembersOptions, + "replaceLoadBalancerPoolMembersOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", listShareMountTargetsOptions.shareId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShareMountTargets"); + pathParamsMap.put("load_balancer_id", replaceLoadBalancerPoolMembersOptions.loadBalancerId()); + pathParamsMap.put("pool_id", replaceLoadBalancerPoolMembersOptions.poolId()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "replaceLoadBalancerPoolMembers"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listShareMountTargetsOptions.name() != null) { - builder.query("name", String.valueOf(listShareMountTargetsOptions.name())); - } - if (listShareMountTargetsOptions.start() != null) { - builder.query("start", String.valueOf(listShareMountTargetsOptions.start())); - } - if (listShareMountTargetsOptions.limit() != null) { - builder.query("limit", String.valueOf(listShareMountTargetsOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("members", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceLoadBalancerPoolMembersOptions.members())); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a mount target for a file share. - * - * This request creates a new share mount target from a share mount target prototype object. + * Delete a load balancer pool member. * - * The prototype object is structured in the same way as a retrieved share mount target, and contains the information - * necessary to provision the new file share mount target. + * This request deletes a member from the pool. This operation cannot be reversed. * - * @param createShareMountTargetOptions the {@link CreateShareMountTargetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareMountTarget} + * @param deleteLoadBalancerPoolMemberOptions the {@link DeleteLoadBalancerPoolMemberOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createShareMountTarget(CreateShareMountTargetOptions createShareMountTargetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createShareMountTargetOptions, - "createShareMountTargetOptions cannot be null"); + public ServiceCall deleteLoadBalancerPoolMember(DeleteLoadBalancerPoolMemberOptions deleteLoadBalancerPoolMemberOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerPoolMemberOptions, + "deleteLoadBalancerPoolMemberOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", createShareMountTargetOptions.shareId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createShareMountTarget"); + pathParamsMap.put("load_balancer_id", deleteLoadBalancerPoolMemberOptions.loadBalancerId()); + pathParamsMap.put("pool_id", deleteLoadBalancerPoolMemberOptions.poolId()); + pathParamsMap.put("id", deleteLoadBalancerPoolMemberOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerPoolMember"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createShareMountTargetOptions.shareMountTargetPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a file share mount target. - * - * This request deletes a share mount target. This operation cannot be reversed. + * Retrieve a load balancer pool member. * - * If the request is accepted, the share mount target `lifecycle_state` will be set to - * `deleting`. Once deletion processing completes, it will no longer be retrievable. + * This request retrieves a single member specified by the identifier in the URL path. * - * @param deleteShareMountTargetOptions the {@link DeleteShareMountTargetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareMountTarget} + * @param getLoadBalancerPoolMemberOptions the {@link GetLoadBalancerPoolMemberOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember} */ - public ServiceCall deleteShareMountTarget(DeleteShareMountTargetOptions deleteShareMountTargetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareMountTargetOptions, - "deleteShareMountTargetOptions cannot be null"); + public ServiceCall getLoadBalancerPoolMember(GetLoadBalancerPoolMemberOptions getLoadBalancerPoolMemberOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerPoolMemberOptions, + "getLoadBalancerPoolMemberOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", deleteShareMountTargetOptions.shareId()); - pathParamsMap.put("id", deleteShareMountTargetOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShareMountTarget"); + pathParamsMap.put("load_balancer_id", getLoadBalancerPoolMemberOptions.loadBalancerId()); + pathParamsMap.put("pool_id", getLoadBalancerPoolMemberOptions.poolId()); + pathParamsMap.put("id", getLoadBalancerPoolMemberOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerPoolMember"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a file share mount target. + * Update a load balancer pool member. * - * This request retrieves a single share mount target specified by the identifier in the URL. + * This request updates an existing member from a member patch. * - * @param getShareMountTargetOptions the {@link GetShareMountTargetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareMountTarget} + * @param updateLoadBalancerPoolMemberOptions the {@link UpdateLoadBalancerPoolMemberOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember} */ - public ServiceCall getShareMountTarget(GetShareMountTargetOptions getShareMountTargetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getShareMountTargetOptions, - "getShareMountTargetOptions cannot be null"); + public ServiceCall updateLoadBalancerPoolMember(UpdateLoadBalancerPoolMemberOptions updateLoadBalancerPoolMemberOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerPoolMemberOptions, + "updateLoadBalancerPoolMemberOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", getShareMountTargetOptions.shareId()); - pathParamsMap.put("id", getShareMountTargetOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareMountTarget"); + pathParamsMap.put("load_balancer_id", updateLoadBalancerPoolMemberOptions.loadBalancerId()); + pathParamsMap.put("pool_id", updateLoadBalancerPoolMemberOptions.poolId()); + pathParamsMap.put("id", updateLoadBalancerPoolMemberOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerPoolMember"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerPoolMemberOptions.loadBalancerPoolMemberPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a file share mount target. + * List network ACLs. * - * This request updates a share mount target with the information provided in a share mount target patch object. The - * share mount target patch object is structured in the same way as a retrieved share mount target and needs to - * contain only the information to be updated. + * 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 updateShareMountTargetOptions the {@link UpdateShareMountTargetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareMountTarget} + * @param listNetworkAclsOptions the {@link ListNetworkAclsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection} */ - public ServiceCall updateShareMountTarget(UpdateShareMountTargetOptions updateShareMountTargetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateShareMountTargetOptions, - "updateShareMountTargetOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", updateShareMountTargetOptions.shareId()); - pathParamsMap.put("id", updateShareMountTargetOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateShareMountTarget"); + public ServiceCall listNetworkAcls(ListNetworkAclsOptions listNetworkAclsOptions) { + if (listNetworkAclsOptions == null) { + listNetworkAclsOptions = new ListNetworkAclsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listNetworkAcls"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateShareMountTargetOptions.shareMountTargetPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listNetworkAclsOptions.start() != null) { + builder.query("start", String.valueOf(listNetworkAclsOptions.start())); + } + if (listNetworkAclsOptions.limit() != null) { + builder.query("limit", String.valueOf(listNetworkAclsOptions.limit())); + } + if (listNetworkAclsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listNetworkAclsOptions.resourceGroupId())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List file share snapshots. + * List network ACLs. * - * This request lists snapshots for the specified file share, or across all accessible file shares. A snapshot - * preserves the data of a share at the time the snapshot was captured. + * 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. * - * If the file share is a replica, the list will contain snapshots corresponding to snapshots on the source. + * @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection} + */ + public ServiceCall listNetworkAcls() { + return listNetworkAcls(null); + } + + /** + * Create a network ACL. * - * @param listShareSnapshotsOptions the {@link ListShareSnapshotsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareSnapshotCollection} + * This request creates a new stateless network ACL from a network ACL prototype object. The prototype object is + * structured in the same way as a retrieved network ACL, and contains the information necessary to create the new + * network ACL. + * + * @param createNetworkAclOptions the {@link CreateNetworkAclOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACL} */ - public ServiceCall listShareSnapshots(ListShareSnapshotsOptions listShareSnapshotsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listShareSnapshotsOptions, - "listShareSnapshotsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", listShareSnapshotsOptions.shareId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShareSnapshots"); + public ServiceCall createNetworkAcl(CreateNetworkAclOptions createNetworkAclOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createNetworkAclOptions, + "createNetworkAclOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createNetworkAcl"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listShareSnapshotsOptions.backupPolicyPlanId() != null) { - builder.query("backup_policy_plan.id", String.valueOf(listShareSnapshotsOptions.backupPolicyPlanId())); - } - if (listShareSnapshotsOptions.name() != null) { - builder.query("name", String.valueOf(listShareSnapshotsOptions.name())); - } - if (listShareSnapshotsOptions.start() != null) { - builder.query("start", String.valueOf(listShareSnapshotsOptions.start())); - } - if (listShareSnapshotsOptions.limit() != null) { - builder.query("limit", String.valueOf(listShareSnapshotsOptions.limit())); - } - if (listShareSnapshotsOptions.sort() != null) { - builder.query("sort", String.valueOf(listShareSnapshotsOptions.sort())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createNetworkAclOptions.networkAclPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a snapshot for a file share. - * - * This request creates a new share snapshot from a share snapshot prototype object. The prototype object is - * 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 an `access_control_mode` of `security_group` and a `replication_role` of `source` or `none`. - * - * The snapshot will inherit its `resource_group` and encryption settings from the share. + * Delete a network ACL. * - * 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 - * `pending` until the data is synchronized per the replication schedule determined by the replica share's - * `replication_cron_spec`. + * This request deletes a network ACL. This operation cannot be reversed. For this request to succeed, the network ACL + * must not be the default network ACL for any VPCs, and the network ACL must not be attached to any subnets. * - * @param createShareSnapshotOptions the {@link CreateShareSnapshotOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareSnapshot} + * @param deleteNetworkAclOptions the {@link DeleteNetworkAclOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createShareSnapshot(CreateShareSnapshotOptions createShareSnapshotOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createShareSnapshotOptions, - "createShareSnapshotOptions cannot be null"); + public ServiceCall deleteNetworkAcl(DeleteNetworkAclOptions deleteNetworkAclOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteNetworkAclOptions, + "deleteNetworkAclOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", createShareSnapshotOptions.shareId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createShareSnapshot"); + pathParamsMap.put("id", deleteNetworkAclOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteNetworkAcl"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - if (createShareSnapshotOptions.name() != null) { - contentJson.addProperty("name", createShareSnapshotOptions.name()); - } - if (createShareSnapshotOptions.userTags() != null) { - contentJson.add("user_tags", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createShareSnapshotOptions.userTags())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a share snapshot. - * - * This request deletes a share snapshot. This operation cannot be reversed. For this request to succeed, the share - * must have a `replication_role` of `source` or `none`. + * Retrieve a network ACL. * - * If the request is accepted, the share snapshot `lifecycle_state` will be set to - * `deleting`. Once deletion processing completes, the share snapshot will no longer be retrievable. + * This request retrieves a single network ACL specified by the identifier in the URL. * - * Deleting a share snapshot will not affect any previously-accepted requests to create a share from it. + * @param getNetworkAclOptions the {@link GetNetworkAclOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACL} + */ + public ServiceCall getNetworkAcl(GetNetworkAclOptions getNetworkAclOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getNetworkAclOptions, + "getNetworkAclOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getNetworkAclOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getNetworkAcl"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update a network ACL. * - * If the share has a `replication_role` of `source`, the corresponding snapshot on the replica share will be - * subsequently moved to a `lifecycle_state` of `deleting`. If the data for the corresponding snapshot has already - * been synchronized via the replication schedule determined by `replication_cron_spec`, the snapshot will remain - * available in the replica share's `.snapshot` directory until the next replication sync. + * This request updates a network ACL's name. * - * @param deleteShareSnapshotOptions the {@link DeleteShareSnapshotOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareSnapshot} + * @param updateNetworkAclOptions the {@link UpdateNetworkAclOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACL} */ - public ServiceCall deleteShareSnapshot(DeleteShareSnapshotOptions deleteShareSnapshotOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareSnapshotOptions, - "deleteShareSnapshotOptions cannot be null"); + public ServiceCall updateNetworkAcl(UpdateNetworkAclOptions updateNetworkAclOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateNetworkAclOptions, + "updateNetworkAclOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", deleteShareSnapshotOptions.shareId()); - pathParamsMap.put("id", deleteShareSnapshotOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShareSnapshot"); + pathParamsMap.put("id", updateNetworkAclOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateNetworkAcl"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateNetworkAclOptions.networkAclPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a share snapshot. + * List rules for a network ACL. * - * This request retrieves a single share snapshot specified by the identifier in the URL. + * This request lists rules for a network ACL. These rules can allow or deny traffic between a source CIDR block and a + * destination CIDR block over a particular protocol and port range. * - * @param getShareSnapshotOptions the {@link GetShareSnapshotOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareSnapshot} + * @param listNetworkAclRulesOptions the {@link ListNetworkAclRulesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACLRuleCollection} */ - public ServiceCall getShareSnapshot(GetShareSnapshotOptions getShareSnapshotOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getShareSnapshotOptions, - "getShareSnapshotOptions cannot be null"); + public ServiceCall listNetworkAclRules(ListNetworkAclRulesOptions listNetworkAclRulesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listNetworkAclRulesOptions, + "listNetworkAclRulesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", getShareSnapshotOptions.shareId()); - pathParamsMap.put("id", getShareSnapshotOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareSnapshot"); + pathParamsMap.put("network_acl_id", listNetworkAclRulesOptions.networkAclId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listNetworkAclRules"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listNetworkAclRulesOptions.start() != null) { + builder.query("start", String.valueOf(listNetworkAclRulesOptions.start())); + } + if (listNetworkAclRulesOptions.limit() != null) { + builder.query("limit", String.valueOf(listNetworkAclRulesOptions.limit())); + } + if (listNetworkAclRulesOptions.direction() != null) { + builder.query("direction", String.valueOf(listNetworkAclRulesOptions.direction())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a share snapshot. + * Create a rule for a network ACL. * - * This request updates a share snapshot with the information provided in a share snapshot patch object. The share - * snapshot patch object is structured in the same way as a retrieved share snapshot and needs to contain only the - * information to be updated. + * This request creates a new rule from a network ACL rule prototype object. The prototype object is structured in the + * same way as a retrieved rule, and contains the information necessary to create the new rule. * - * @param updateShareSnapshotOptions the {@link UpdateShareSnapshotOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareSnapshot} + * @param createNetworkAclRuleOptions the {@link CreateNetworkAclRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACLRule} */ - public ServiceCall updateShareSnapshot(UpdateShareSnapshotOptions updateShareSnapshotOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateShareSnapshotOptions, - "updateShareSnapshotOptions cannot be null"); + public ServiceCall createNetworkAclRule(CreateNetworkAclRuleOptions createNetworkAclRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createNetworkAclRuleOptions, + "createNetworkAclRuleOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", updateShareSnapshotOptions.shareId()); - pathParamsMap.put("id", updateShareSnapshotOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateShareSnapshot"); + pathParamsMap.put("network_acl_id", createNetworkAclRuleOptions.networkAclId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createNetworkAclRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateShareSnapshotOptions.ifMatch() != null) { - builder.header("If-Match", updateShareSnapshotOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateShareSnapshotOptions.shareSnapshotPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createNetworkAclRuleOptions.networkAclRulePrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Split the source file share from a replica file share. - * - * This request removes the replication relationship between a source share and the replica share specified by the - * identifier in the URL. The replication relationship cannot be removed if a source share or the replica share has a - * `lifecycle_state` of `updating`, or has a replication operation in progress. + * Delete a network ACL rule. * - * This operation cannot be reversed. + * This request deletes a rule. This operation cannot be reversed. * - * @param deleteShareSourceOptions the {@link DeleteShareSourceOptions} containing the options for the call + * @param deleteNetworkAclRuleOptions the {@link DeleteNetworkAclRuleOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteShareSource(DeleteShareSourceOptions deleteShareSourceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareSourceOptions, - "deleteShareSourceOptions cannot be null"); + public ServiceCall deleteNetworkAclRule(DeleteNetworkAclRuleOptions deleteNetworkAclRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteNetworkAclRuleOptions, + "deleteNetworkAclRuleOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", deleteShareSourceOptions.shareId()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/source", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShareSource"); + pathParamsMap.put("network_acl_id", deleteNetworkAclRuleOptions.networkAclId()); + pathParamsMap.put("id", deleteNetworkAclRuleOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteNetworkAclRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -8696,841 +8716,702 @@ public ServiceCall deleteShareSource(DeleteShareSourceOptions deleteShareS } /** - * Retrieve the source file share for a replica file share. + * Retrieve a network ACL rule. * - * This request retrieves the source file share associated with the replica file share specified by the identifier in - * the URL. + * This request retrieves a single rule specified by the identifier in the URL. * - * @param getShareSourceOptions the {@link GetShareSourceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ShareReference} + * @param getNetworkAclRuleOptions the {@link GetNetworkAclRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACLRule} */ - public ServiceCall getShareSource(GetShareSourceOptions getShareSourceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getShareSourceOptions, - "getShareSourceOptions cannot be null"); + public ServiceCall getNetworkAclRule(GetNetworkAclRuleOptions getNetworkAclRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getNetworkAclRuleOptions, + "getNetworkAclRuleOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("share_id", getShareSourceOptions.shareId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/source", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareSource"); + pathParamsMap.put("network_acl_id", getNetworkAclRuleOptions.networkAclId()); + pathParamsMap.put("id", getNetworkAclRuleOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getNetworkAclRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List backup policies. + * Update a network ACL rule. * - * This request lists backup policies in the region. Backup policies control which sources are selected for backup and - * include a set of backup policy plans that provide the backup schedules and deletion triggers. + * This request updates a rule with the information in a provided rule patch. The rule patch object contains only the + * information to be updated. The request will fail if the provided patch includes properties that are not used by the + * rule's protocol. * - * @param listBackupPoliciesOptions the {@link ListBackupPoliciesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyCollection} + * @param updateNetworkAclRuleOptions the {@link UpdateNetworkAclRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACLRule} */ - public ServiceCall listBackupPolicies(ListBackupPoliciesOptions listBackupPoliciesOptions) { - if (listBackupPoliciesOptions == null) { - listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBackupPolicies"); + public ServiceCall updateNetworkAclRule(UpdateNetworkAclRuleOptions updateNetworkAclRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateNetworkAclRuleOptions, + "updateNetworkAclRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("network_acl_id", updateNetworkAclRuleOptions.networkAclId()); + pathParamsMap.put("id", updateNetworkAclRuleOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateNetworkAclRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listBackupPoliciesOptions.start() != null) { - builder.query("start", String.valueOf(listBackupPoliciesOptions.start())); - } - if (listBackupPoliciesOptions.limit() != null) { - builder.query("limit", String.valueOf(listBackupPoliciesOptions.limit())); - } - if (listBackupPoliciesOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listBackupPoliciesOptions.resourceGroupId())); - } - if (listBackupPoliciesOptions.name() != null) { - builder.query("name", String.valueOf(listBackupPoliciesOptions.name())); - } - if (listBackupPoliciesOptions.tag() != null) { - builder.query("tag", String.valueOf(listBackupPoliciesOptions.tag())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateNetworkAclRuleOptions.networkAclRulePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List backup policies. + * List placement groups. * - * This request lists backup policies in the region. Backup policies control which sources are selected for backup and - * include a set of backup policy plans that provide the backup schedules and deletion triggers. + * This request lists placement groups in the region. * - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyCollection} + * @param listPlacementGroupsOptions the {@link ListPlacementGroupsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PlacementGroupCollection} */ - public ServiceCall listBackupPolicies() { - return listBackupPolicies(null); - } - - /** - * Create a backup policy. - * - * This request creates a new backup policy from a backup policy prototype object. The prototype object is structured - * in the same way as a retrieved backup policy, and contains the information necessary to create the new backup - * policy. - * - * @param createBackupPolicyOptions the {@link CreateBackupPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicy} - */ - public ServiceCall createBackupPolicy(CreateBackupPolicyOptions createBackupPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createBackupPolicyOptions, - "createBackupPolicyOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBackupPolicy"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); + public ServiceCall listPlacementGroups(ListPlacementGroupsOptions listPlacementGroupsOptions) { + if (listPlacementGroupsOptions == null) { + listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder().build(); } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createBackupPolicyOptions.backupPolicyPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List jobs for a backup policy. - * - * This request retrieves jobs for a backup policy. A backup job represents the execution of a backup policy plan for - * a resource matching the policy's criteria. - * - * @param listBackupPolicyJobsOptions the {@link ListBackupPolicyJobsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyJobCollection} - */ - public ServiceCall listBackupPolicyJobs(ListBackupPolicyJobsOptions listBackupPolicyJobsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listBackupPolicyJobsOptions, - "listBackupPolicyJobsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("backup_policy_id", listBackupPolicyJobsOptions.backupPolicyId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/jobs", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBackupPolicyJobs"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPlacementGroups"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listBackupPolicyJobsOptions.status() != null) { - builder.query("status", String.valueOf(listBackupPolicyJobsOptions.status())); - } - if (listBackupPolicyJobsOptions.backupPolicyPlanId() != null) { - builder.query("backup_policy_plan.id", String.valueOf(listBackupPolicyJobsOptions.backupPolicyPlanId())); - } - if (listBackupPolicyJobsOptions.start() != null) { - builder.query("start", String.valueOf(listBackupPolicyJobsOptions.start())); - } - if (listBackupPolicyJobsOptions.limit() != null) { - builder.query("limit", String.valueOf(listBackupPolicyJobsOptions.limit())); - } - if (listBackupPolicyJobsOptions.sort() != null) { - builder.query("sort", String.valueOf(listBackupPolicyJobsOptions.sort())); - } - if (listBackupPolicyJobsOptions.sourceId() != null) { - builder.query("source.id", String.valueOf(listBackupPolicyJobsOptions.sourceId())); - } - if (listBackupPolicyJobsOptions.targetSnapshotsId() != null) { - builder.query("target_snapshots[].id", String.valueOf(listBackupPolicyJobsOptions.targetSnapshotsId())); + if (listPlacementGroupsOptions.start() != null) { + builder.query("start", String.valueOf(listPlacementGroupsOptions.start())); } - if (listBackupPolicyJobsOptions.targetSnapshotsCrn() != null) { - builder.query("target_snapshots[].crn", String.valueOf(listBackupPolicyJobsOptions.targetSnapshotsCrn())); + if (listPlacementGroupsOptions.limit() != null) { + builder.query("limit", String.valueOf(listPlacementGroupsOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a backup policy job. + * List placement groups. * - * This request retrieves a single backup policy job specified by the identifier in the URL. + * This request lists placement groups in the region. * - * @param getBackupPolicyJobOptions the {@link GetBackupPolicyJobOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyJob} + * @return a {@link ServiceCall} with a result of type {@link PlacementGroupCollection} */ - public ServiceCall getBackupPolicyJob(GetBackupPolicyJobOptions getBackupPolicyJobOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBackupPolicyJobOptions, - "getBackupPolicyJobOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("backup_policy_id", getBackupPolicyJobOptions.backupPolicyId()); - pathParamsMap.put("id", getBackupPolicyJobOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/jobs/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBackupPolicyJob"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listPlacementGroups() { + return listPlacementGroups(null); } /** - * List plans for a backup policy. + * Create a placement group. * - * This request retrieves plans for a backup policy. Backup plans provide the backup schedule and deletion triggers. + * This request creates a new placement group. * - * @param listBackupPolicyPlansOptions the {@link ListBackupPolicyPlansOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlanCollection} + * @param createPlacementGroupOptions the {@link CreatePlacementGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PlacementGroup} */ - public ServiceCall listBackupPolicyPlans(ListBackupPolicyPlansOptions listBackupPolicyPlansOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listBackupPolicyPlansOptions, - "listBackupPolicyPlansOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("backup_policy_id", listBackupPolicyPlansOptions.backupPolicyId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listBackupPolicyPlans"); + public ServiceCall createPlacementGroup(CreatePlacementGroupOptions createPlacementGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createPlacementGroupOptions, + "createPlacementGroupOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPlacementGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listBackupPolicyPlansOptions.name() != null) { - builder.query("name", String.valueOf(listBackupPolicyPlansOptions.name())); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("strategy", createPlacementGroupOptions.strategy()); + if (createPlacementGroupOptions.name() != null) { + contentJson.addProperty("name", createPlacementGroupOptions.name()); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (createPlacementGroupOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPlacementGroupOptions.resourceGroup())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a plan for a backup policy. - * - * This request creates a new backup policy plan from a backup policy plan prototype object. The prototype object is - * structured in the same way as a retrieved backup policy plan, and contains the information necessary to create the - * new backup policy plan. - * - * Backups created by this plan will use the resource group of the source being backed up. + * Delete a placement group. * - * Backups created by this plan will use the plan's name truncated to 46 characters, followed by a unique 16-character - * suffix. + * This request deletes a placement group. This operation cannot be reversed. For this request to succeed, the + * placement group must not be associated with an instance. * - * @param createBackupPolicyPlanOptions the {@link CreateBackupPolicyPlanOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlan} + * @param deletePlacementGroupOptions the {@link DeletePlacementGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createBackupPolicyPlan(CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createBackupPolicyPlanOptions, - "createBackupPolicyPlanOptions cannot be null"); + public ServiceCall deletePlacementGroup(DeletePlacementGroupOptions deletePlacementGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deletePlacementGroupOptions, + "deletePlacementGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("backup_policy_id", createBackupPolicyPlanOptions.backupPolicyId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createBackupPolicyPlan"); + pathParamsMap.put("id", deletePlacementGroupOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePlacementGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("cron_spec", createBackupPolicyPlanOptions.cronSpec()); - if (createBackupPolicyPlanOptions.active() != null) { - contentJson.addProperty("active", createBackupPolicyPlanOptions.active()); - } - if (createBackupPolicyPlanOptions.attachUserTags() != null) { - contentJson.add("attach_user_tags", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createBackupPolicyPlanOptions.attachUserTags())); - } - if (createBackupPolicyPlanOptions.clonePolicy() != null) { - contentJson.add("clone_policy", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createBackupPolicyPlanOptions.clonePolicy())); - } - if (createBackupPolicyPlanOptions.copyUserTags() != null) { - contentJson.addProperty("copy_user_tags", createBackupPolicyPlanOptions.copyUserTags()); - } - if (createBackupPolicyPlanOptions.deletionTrigger() != null) { - contentJson.add("deletion_trigger", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createBackupPolicyPlanOptions.deletionTrigger())); - } - if (createBackupPolicyPlanOptions.name() != null) { - contentJson.addProperty("name", createBackupPolicyPlanOptions.name()); - } - if (createBackupPolicyPlanOptions.remoteRegionPolicies() != null) { - contentJson.add("remote_region_policies", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createBackupPolicyPlanOptions.remoteRegionPolicies())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a backup policy plan. - * - * This request deletes a backup policy plan. This operation cannot be reversed. Any backups that have been created by - * the plan will remain but will no longer be subject to the plan's deletion trigger. Any running jobs associated with - * the plan will run to completion before the plan is deleted. + * Retrieve a placement group. * - * If the request is accepted, the backup policy plan `status` will be set to `deleting`. Once deletion processing - * completes, the backup policy plan will no longer be retrievable. + * This request retrieves a single placement group specified by identifier in the URL. * - * @param deleteBackupPolicyPlanOptions the {@link DeleteBackupPolicyPlanOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlan} + * @param getPlacementGroupOptions the {@link GetPlacementGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PlacementGroup} */ - public ServiceCall deleteBackupPolicyPlan(DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBackupPolicyPlanOptions, - "deleteBackupPolicyPlanOptions cannot be null"); + public ServiceCall getPlacementGroup(GetPlacementGroupOptions getPlacementGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getPlacementGroupOptions, + "getPlacementGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("backup_policy_id", deleteBackupPolicyPlanOptions.backupPolicyId()); - pathParamsMap.put("id", deleteBackupPolicyPlanOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBackupPolicyPlan"); + pathParamsMap.put("id", getPlacementGroupOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPlacementGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (deleteBackupPolicyPlanOptions.ifMatch() != null) { - builder.header("If-Match", deleteBackupPolicyPlanOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a backup policy plan. + * Update a placement group. * - * This request retrieves a single backup policy plan specified by the identifier in the URL. + * This request updates a placement group with the information provided placement group patch. The placement group + * patch object is structured in the same way as a retrieved placement group and contains only the information to be + * updated. * - * @param getBackupPolicyPlanOptions the {@link GetBackupPolicyPlanOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlan} + * @param updatePlacementGroupOptions the {@link UpdatePlacementGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PlacementGroup} */ - public ServiceCall getBackupPolicyPlan(GetBackupPolicyPlanOptions getBackupPolicyPlanOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBackupPolicyPlanOptions, - "getBackupPolicyPlanOptions cannot be null"); + public ServiceCall updatePlacementGroup(UpdatePlacementGroupOptions updatePlacementGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updatePlacementGroupOptions, + "updatePlacementGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("backup_policy_id", getBackupPolicyPlanOptions.backupPolicyId()); - pathParamsMap.put("id", getBackupPolicyPlanOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBackupPolicyPlan"); + pathParamsMap.put("id", updatePlacementGroupOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/placement_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePlacementGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePlacementGroupOptions.placementGroupPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a backup policy plan. + * List private path service gateways. * - * This request updates a backup policy plan with the information in a provided plan patch. The plan patch object is - * structured in the same way as a retrieved backup policy plan and can contains only the information to be updated. + * This request lists private path service gateways in the region. Private path service gateways allow + * [service + * providers](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components) + * to make their services available using + * [private path + * connectivity](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components). + * Private path service gateways are used to facilitate and manage the private path connectivity between private path + * network load balancers and their associated endpoint gateways. * - * @param updateBackupPolicyPlanOptions the {@link UpdateBackupPolicyPlanOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicyPlan} + * @param listPrivatePathServiceGatewaysOptions the {@link ListPrivatePathServiceGatewaysOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayCollection} */ - public ServiceCall updateBackupPolicyPlan(UpdateBackupPolicyPlanOptions updateBackupPolicyPlanOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateBackupPolicyPlanOptions, - "updateBackupPolicyPlanOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("backup_policy_id", updateBackupPolicyPlanOptions.backupPolicyId()); - pathParamsMap.put("id", updateBackupPolicyPlanOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{backup_policy_id}/plans/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBackupPolicyPlan"); + public ServiceCall listPrivatePathServiceGateways(ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptions) { + if (listPrivatePathServiceGatewaysOptions == null) { + listPrivatePathServiceGatewaysOptions = new ListPrivatePathServiceGatewaysOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPrivatePathServiceGateways"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateBackupPolicyPlanOptions.ifMatch() != null) { - builder.header("If-Match", updateBackupPolicyPlanOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBackupPolicyPlanOptions.backupPolicyPlanPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listPrivatePathServiceGatewaysOptions.start() != null) { + builder.query("start", String.valueOf(listPrivatePathServiceGatewaysOptions.start())); + } + if (listPrivatePathServiceGatewaysOptions.limit() != null) { + builder.query("limit", String.valueOf(listPrivatePathServiceGatewaysOptions.limit())); + } + if (listPrivatePathServiceGatewaysOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listPrivatePathServiceGatewaysOptions.resourceGroupId())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a backup policy. + * List private path service gateways. * - * This request deletes a backup policy. This operation cannot be reversed. + * This request lists private path service gateways in the region. Private path service gateways allow + * [service + * providers](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components) + * to make their services available using + * [private path + * connectivity](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components). + * Private path service gateways are used to facilitate and manage the private path connectivity between private path + * network load balancers and their associated endpoint gateways. * - * If the request is accepted, the backup policy `status` will be set to `deleting`. Once deletion processing - * completes, the backup policy will no longer be retrievable. + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayCollection} + */ + public ServiceCall listPrivatePathServiceGateways() { + return listPrivatePathServiceGateways(null); + } + + /** + * Create a private path service gateway. * - * @param deleteBackupPolicyOptions the {@link DeleteBackupPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicy} + * This request creates a private path service gateway from a private path service gateway prototype object. The + * prototype object is structured in the same way as a retrieved private path service gateway, and contains the + * information necessary to create the new private path service gateway. + * + * @param createPrivatePathServiceGatewayOptions the {@link CreatePrivatePathServiceGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGateway} */ - public ServiceCall deleteBackupPolicy(DeleteBackupPolicyOptions deleteBackupPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteBackupPolicyOptions, - "deleteBackupPolicyOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteBackupPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteBackupPolicy"); + public ServiceCall createPrivatePathServiceGateway(CreatePrivatePathServiceGatewayOptions createPrivatePathServiceGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createPrivatePathServiceGatewayOptions, + "createPrivatePathServiceGatewayOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPrivatePathServiceGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (deleteBackupPolicyOptions.ifMatch() != null) { - builder.header("If-Match", deleteBackupPolicyOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("load_balancer", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPrivatePathServiceGatewayOptions.loadBalancer())); + contentJson.add("service_endpoints", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPrivatePathServiceGatewayOptions.serviceEndpoints())); + if (createPrivatePathServiceGatewayOptions.defaultAccessPolicy() != null) { + contentJson.addProperty("default_access_policy", createPrivatePathServiceGatewayOptions.defaultAccessPolicy()); + } + if (createPrivatePathServiceGatewayOptions.name() != null) { + contentJson.addProperty("name", createPrivatePathServiceGatewayOptions.name()); + } + if (createPrivatePathServiceGatewayOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPrivatePathServiceGatewayOptions.resourceGroup())); + } + if (createPrivatePathServiceGatewayOptions.zonalAffinity() != null) { + contentJson.addProperty("zonal_affinity", createPrivatePathServiceGatewayOptions.zonalAffinity()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a backup policy. + * Delete a private path service gateway. * - * This request retrieves a single backup policy specified by the identifier in the URL. + * This request deletes a private path service gateway. For this request to succeed, the value of + * `endpoint_gateway_count` must be `0`. This operation cannot be reversed. * - * @param getBackupPolicyOptions the {@link GetBackupPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicy} + * @param deletePrivatePathServiceGatewayOptions the {@link DeletePrivatePathServiceGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getBackupPolicy(GetBackupPolicyOptions getBackupPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getBackupPolicyOptions, - "getBackupPolicyOptions cannot be null"); + public ServiceCall deletePrivatePathServiceGateway(DeletePrivatePathServiceGatewayOptions deletePrivatePathServiceGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deletePrivatePathServiceGatewayOptions, + "deletePrivatePathServiceGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getBackupPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getBackupPolicy"); + pathParamsMap.put("id", deletePrivatePathServiceGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePrivatePathServiceGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update a backup policy. + * Retrieve a private path service gateway. * - * This request updates a backup policy with the information in a provided backup policy patch. The backup policy - * patch object is structured in the same way as a retrieved backup policy and contains only the information to be - * updated. + * This request retrieves the private path service gateway specified by the identifier in the URL. * - * @param updateBackupPolicyOptions the {@link UpdateBackupPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link BackupPolicy} + * @param getPrivatePathServiceGatewayOptions the {@link GetPrivatePathServiceGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGateway} */ - public ServiceCall updateBackupPolicy(UpdateBackupPolicyOptions updateBackupPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateBackupPolicyOptions, - "updateBackupPolicyOptions cannot be null"); + public ServiceCall getPrivatePathServiceGateway(GetPrivatePathServiceGatewayOptions getPrivatePathServiceGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getPrivatePathServiceGatewayOptions, + "getPrivatePathServiceGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateBackupPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/backup_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateBackupPolicy"); + pathParamsMap.put("id", getPrivatePathServiceGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPrivatePathServiceGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateBackupPolicyOptions.ifMatch() != null) { - builder.header("If-Match", updateBackupPolicyOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateBackupPolicyOptions.backupPolicyPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List regions. + * Update a private path service gateway. * - * This request lists regions. Each region is a separate geographic area that contains multiple isolated zones. - * Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other - * zones in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault - * isolation available. Resources deployed within a single region also benefit from the low latency afforded by - * geographic proximity. + * This request updates a private path service gateway with the information provided in a private path service gateway + * patch object. The private path service gateway patch object is structured in the same way as a retrieved private + * path service gateway and contains only the information to be updated. * - * @param listRegionsOptions the {@link ListRegionsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link RegionCollection} + * @param updatePrivatePathServiceGatewayOptions the {@link UpdatePrivatePathServiceGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGateway} */ - public ServiceCall listRegions(ListRegionsOptions listRegionsOptions) { - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/regions")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listRegions"); + public ServiceCall updatePrivatePathServiceGateway(UpdatePrivatePathServiceGatewayOptions updatePrivatePathServiceGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updatePrivatePathServiceGatewayOptions, + "updatePrivatePathServiceGatewayOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", updatePrivatePathServiceGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePrivatePathServiceGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePrivatePathServiceGatewayOptions.privatePathServiceGatewayPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List regions. - * - * This request lists regions. Each region is a separate geographic area that contains multiple isolated zones. - * Resources can be provisioned into one or more zones in a region. Each zone is isolated, but connected to other - * zones in the same region with low-latency and high-bandwidth links. Regions represent the top-level of fault - * isolation available. Resources deployed within a single region also benefit from the low latency afforded by - * geographic proximity. + * List account policies for a private path service gateway. * - * @return a {@link ServiceCall} with a result of type {@link RegionCollection} - */ - public ServiceCall listRegions() { - return listRegions(null); - } - - /** - * Retrieve a region. + * This request lists account policies for a private path service gateway. Each policy defines how requests to use the + * private path service gateway from that account will be handled. * - * This request retrieves a single region specified by the name in the URL. + * The account policies will be sorted by their `created_at` property values, with newest account policies first. + * Account policies with identical `created_at` property values will in turn be sorted by ascending `id` property + * values. * - * @param getRegionOptions the {@link GetRegionOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Region} + * @param listPrivatePathServiceGatewayAccountPoliciesOptions the {@link ListPrivatePathServiceGatewayAccountPoliciesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayAccountPolicyCollection} */ - public ServiceCall getRegion(GetRegionOptions getRegionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getRegionOptions, - "getRegionOptions cannot be null"); + public ServiceCall listPrivatePathServiceGatewayAccountPolicies(ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listPrivatePathServiceGatewayAccountPoliciesOptions, + "listPrivatePathServiceGatewayAccountPoliciesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getRegionOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/regions/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getRegion"); + pathParamsMap.put("private_path_service_gateway_id", listPrivatePathServiceGatewayAccountPoliciesOptions.privatePathServiceGatewayId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPrivatePathServiceGatewayAccountPolicies"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listPrivatePathServiceGatewayAccountPoliciesOptions.start() != null) { + builder.query("start", String.valueOf(listPrivatePathServiceGatewayAccountPoliciesOptions.start())); + } + if (listPrivatePathServiceGatewayAccountPoliciesOptions.limit() != null) { + builder.query("limit", String.valueOf(listPrivatePathServiceGatewayAccountPoliciesOptions.limit())); + } + if (listPrivatePathServiceGatewayAccountPoliciesOptions.accountId() != null) { + builder.query("account.id", String.valueOf(listPrivatePathServiceGatewayAccountPoliciesOptions.accountId())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List zones in a region. + * Create an account policy for a private path service gateway. * - * This request lists zones in a region. Zones represent logically-isolated data centers with high-bandwidth and - * low-latency interconnects to other zones in the same region. Faults in a zone do not affect other zones. + * This request creates an account policy from an account policy prototype object. The prototype object is structured + * in the same way as a retrieved account policy, and contains the information necessary to create the new account + * policy. * - * @param listRegionZonesOptions the {@link ListRegionZonesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ZoneCollection} + * @param createPrivatePathServiceGatewayAccountPolicyOptions the {@link CreatePrivatePathServiceGatewayAccountPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayAccountPolicy} */ - public ServiceCall listRegionZones(ListRegionZonesOptions listRegionZonesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listRegionZonesOptions, - "listRegionZonesOptions cannot be null"); + public ServiceCall createPrivatePathServiceGatewayAccountPolicy(CreatePrivatePathServiceGatewayAccountPolicyOptions createPrivatePathServiceGatewayAccountPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createPrivatePathServiceGatewayAccountPolicyOptions, + "createPrivatePathServiceGatewayAccountPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("region_name", listRegionZonesOptions.regionName()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/regions/{region_name}/zones", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listRegionZones"); + pathParamsMap.put("private_path_service_gateway_id", createPrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPrivatePathServiceGatewayAccountPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("access_policy", createPrivatePathServiceGatewayAccountPolicyOptions.accessPolicy()); + contentJson.add("account", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPrivatePathServiceGatewayAccountPolicyOptions.account())); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a zone. + * Delete an account policy for a private path service gateway. * - * This request retrieves a single zone specified by the region and zone names in the URL. + * This request deletes an account policy. This operation cannot be reversed and it does not affect the `status` of + * any existing endpoint gateway bindings. * - * @param getRegionZoneOptions the {@link GetRegionZoneOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Zone} + * @param deletePrivatePathServiceGatewayAccountPolicyOptions the {@link DeletePrivatePathServiceGatewayAccountPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getRegionZone(GetRegionZoneOptions getRegionZoneOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getRegionZoneOptions, - "getRegionZoneOptions cannot be null"); + public ServiceCall deletePrivatePathServiceGatewayAccountPolicy(DeletePrivatePathServiceGatewayAccountPolicyOptions deletePrivatePathServiceGatewayAccountPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deletePrivatePathServiceGatewayAccountPolicyOptions, + "deletePrivatePathServiceGatewayAccountPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("region_name", getRegionZoneOptions.regionName()); - pathParamsMap.put("name", getRegionZoneOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/regions/{region_name}/zones/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getRegionZone"); + pathParamsMap.put("private_path_service_gateway_id", deletePrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayId()); + pathParamsMap.put("id", deletePrivatePathServiceGatewayAccountPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePrivatePathServiceGatewayAccountPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List virtual network interfaces. - * - * This request lists virtual network interfaces in the region. A virtual network interface is a logical abstraction - * of a virtual network interface in a subnet, and may be attached to a target resource. + * Retrieve an account policy for a private path service gateway. * - * The virtual network interfaces will be sorted by their `created_at` property values, with newest virtual network - * interfaces first. Virtual network interfaces with identical - * `created_at` property values will in turn be sorted by ascending `name` property values. + * This request retrieves a single account policy specified by the identifier in the URL. * - * @param listVirtualNetworkInterfacesOptions the {@link ListVirtualNetworkInterfacesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterfaceCollection} + * @param getPrivatePathServiceGatewayAccountPolicyOptions the {@link GetPrivatePathServiceGatewayAccountPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayAccountPolicy} */ - public ServiceCall listVirtualNetworkInterfaces(ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptions) { - if (listVirtualNetworkInterfacesOptions == null) { - listVirtualNetworkInterfacesOptions = new ListVirtualNetworkInterfacesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVirtualNetworkInterfaces"); + public ServiceCall getPrivatePathServiceGatewayAccountPolicy(GetPrivatePathServiceGatewayAccountPolicyOptions getPrivatePathServiceGatewayAccountPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getPrivatePathServiceGatewayAccountPolicyOptions, + "getPrivatePathServiceGatewayAccountPolicyOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("private_path_service_gateway_id", getPrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayId()); + pathParamsMap.put("id", getPrivatePathServiceGatewayAccountPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPrivatePathServiceGatewayAccountPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVirtualNetworkInterfacesOptions.start() != null) { - builder.query("start", String.valueOf(listVirtualNetworkInterfacesOptions.start())); - } - if (listVirtualNetworkInterfacesOptions.limit() != null) { - builder.query("limit", String.valueOf(listVirtualNetworkInterfacesOptions.limit())); - } - if (listVirtualNetworkInterfacesOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listVirtualNetworkInterfacesOptions.resourceGroupId())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List virtual network interfaces. - * - * This request lists virtual network interfaces in the region. A virtual network interface is a logical abstraction - * of a virtual network interface in a subnet, and may be attached to a target resource. + * Update an account policy for a private path service gateway. * - * The virtual network interfaces will be sorted by their `created_at` property values, with newest virtual network - * interfaces first. Virtual network interfaces with identical - * `created_at` property values will in turn be sorted by ascending `name` property values. + * This request updates an account policy with the information in a provided account policy patch. The account policy + * patch object is structured in the same way as a retrieved account policy and contains only the information to be + * updated. * - * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterfaceCollection} + * @param updatePrivatePathServiceGatewayAccountPolicyOptions the {@link UpdatePrivatePathServiceGatewayAccountPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayAccountPolicy} */ - public ServiceCall listVirtualNetworkInterfaces() { - return listVirtualNetworkInterfaces(null); + public ServiceCall updatePrivatePathServiceGatewayAccountPolicy(UpdatePrivatePathServiceGatewayAccountPolicyOptions updatePrivatePathServiceGatewayAccountPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updatePrivatePathServiceGatewayAccountPolicyOptions, + "updatePrivatePathServiceGatewayAccountPolicyOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("private_path_service_gateway_id", updatePrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayId()); + pathParamsMap.put("id", updatePrivatePathServiceGatewayAccountPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePrivatePathServiceGatewayAccountPolicy"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayAccountPolicyPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); } /** - * Create a virtual network interface. + * List endpoint gateway bindings for a private path service gateway. * - * This request creates a new virtual network interface from a virtual network interface prototype object. The - * prototype object is structured in the same way as a retrieved virtual network interface, and contains the - * information necessary to create the new virtual network interface. + * This request lists endpoint gateway bindings for a private path service gateway. Each endpoint gateway binding is + * implicitly created when an endpoint gateway is created targeting the private path service gateway. The associated + * account policy is applied to all new endpoint gateway bindings. If an associated account policy doesn't exist, the + * private path service gateway's `default_access_policy` is used. * - * @param createVirtualNetworkInterfaceOptions the {@link CreateVirtualNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} + * The endpoint gateway bindings will be sorted by their `created_at` property values, with newest endpoint gateway + * bindings first. Endpoint gateway bindings with identical + * `created_at` property values will in turn be sorted by ascending `name` property values. + * + * @param listPrivatePathServiceGatewayEndpointGatewayBindingsOptions the {@link ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayEndpointGatewayBindingCollection} */ - public ServiceCall createVirtualNetworkInterface(CreateVirtualNetworkInterfaceOptions createVirtualNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVirtualNetworkInterfaceOptions, - "createVirtualNetworkInterfaceOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVirtualNetworkInterface"); + public ServiceCall listPrivatePathServiceGatewayEndpointGatewayBindings(ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions, + "listPrivatePathServiceGatewayEndpointGatewayBindingsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("private_path_service_gateway_id", listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.privatePathServiceGatewayId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPrivatePathServiceGatewayEndpointGatewayBindings"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - if (createVirtualNetworkInterfaceOptions.allowIpSpoofing() != null) { - contentJson.addProperty("allow_ip_spoofing", createVirtualNetworkInterfaceOptions.allowIpSpoofing()); - } - if (createVirtualNetworkInterfaceOptions.autoDelete() != null) { - contentJson.addProperty("auto_delete", createVirtualNetworkInterfaceOptions.autoDelete()); - } - if (createVirtualNetworkInterfaceOptions.enableInfrastructureNat() != null) { - contentJson.addProperty("enable_infrastructure_nat", createVirtualNetworkInterfaceOptions.enableInfrastructureNat()); - } - if (createVirtualNetworkInterfaceOptions.ips() != null) { - contentJson.add("ips", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.ips())); - } - if (createVirtualNetworkInterfaceOptions.name() != null) { - contentJson.addProperty("name", createVirtualNetworkInterfaceOptions.name()); - } - if (createVirtualNetworkInterfaceOptions.primaryIp() != null) { - contentJson.add("primary_ip", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.primaryIp())); - } - if (createVirtualNetworkInterfaceOptions.protocolStateFilteringMode() != null) { - contentJson.addProperty("protocol_state_filtering_mode", createVirtualNetworkInterfaceOptions.protocolStateFilteringMode()); + if (listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.start() != null) { + builder.query("start", String.valueOf(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.start())); } - if (createVirtualNetworkInterfaceOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.resourceGroup())); + if (listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.limit() != null) { + builder.query("limit", String.valueOf(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.limit())); } - if (createVirtualNetworkInterfaceOptions.securityGroups() != null) { - contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.securityGroups())); + if (listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.status() != null) { + builder.query("status", String.valueOf(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.status())); } - if (createVirtualNetworkInterfaceOptions.subnet() != null) { - contentJson.add("subnet", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.subnet())); + if (listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.accountId() != null) { + builder.query("account.id", String.valueOf(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.accountId())); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a virtual network interface. - * - * This request creates a new virtual network interface from a virtual network interface prototype object. The - * prototype object is structured in the same way as a retrieved virtual network interface, and contains the - * information necessary to create the new virtual network interface. - * - * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} - */ - public ServiceCall createVirtualNetworkInterface() { - return createVirtualNetworkInterface(null); - } - - /** - * Delete a virtual network interface. + * Retrieve an endpoint gateway binding for a private path service gateway. * - * This request deletes a virtual network interface. This operation cannot be reversed. For this request to succeed, - * the virtual network interface must not be required by another resource, such as the primary network attachment for - * an instance. + * This request retrieves a single endpoint gateway binding specified by the identifier in the URL. * - * @param deleteVirtualNetworkInterfacesOptions the {@link DeleteVirtualNetworkInterfacesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} + * @param getPrivatePathServiceGatewayEndpointGatewayBindingOptions the {@link GetPrivatePathServiceGatewayEndpointGatewayBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayEndpointGatewayBinding} */ - public ServiceCall deleteVirtualNetworkInterfaces(DeleteVirtualNetworkInterfacesOptions deleteVirtualNetworkInterfacesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVirtualNetworkInterfacesOptions, - "deleteVirtualNetworkInterfacesOptions cannot be null"); + public ServiceCall getPrivatePathServiceGatewayEndpointGatewayBinding(GetPrivatePathServiceGatewayEndpointGatewayBindingOptions getPrivatePathServiceGatewayEndpointGatewayBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getPrivatePathServiceGatewayEndpointGatewayBindingOptions, + "getPrivatePathServiceGatewayEndpointGatewayBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteVirtualNetworkInterfacesOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVirtualNetworkInterfaces"); + pathParamsMap.put("private_path_service_gateway_id", getPrivatePathServiceGatewayEndpointGatewayBindingOptions.privatePathServiceGatewayId()); + pathParamsMap.put("id", getPrivatePathServiceGatewayEndpointGatewayBindingOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPrivatePathServiceGatewayEndpointGatewayBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a virtual network interface. + * Deny an endpoint gateway binding for a private path service gateway. * - * This request retrieves a single virtual network interface specified by the identifier in the URL. + * This request denies a `pending` endpoint gateway request, and optionally sets the policy to deny future requests + * from the same account. * - * @param getVirtualNetworkInterfaceOptions the {@link GetVirtualNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} + * @param denyPrivatePathServiceGatewayEndpointGatewayBindingOptions the {@link DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getVirtualNetworkInterface(GetVirtualNetworkInterfaceOptions getVirtualNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVirtualNetworkInterfaceOptions, - "getVirtualNetworkInterfaceOptions cannot be null"); + public ServiceCall denyPrivatePathServiceGatewayEndpointGatewayBinding(DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions denyPrivatePathServiceGatewayEndpointGatewayBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(denyPrivatePathServiceGatewayEndpointGatewayBindingOptions, + "denyPrivatePathServiceGatewayEndpointGatewayBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVirtualNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVirtualNetworkInterface"); + pathParamsMap.put("private_path_service_gateway_id", denyPrivatePathServiceGatewayEndpointGatewayBindingOptions.privatePathServiceGatewayId()); + pathParamsMap.put("id", denyPrivatePathServiceGatewayEndpointGatewayBindingOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}/deny", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "denyPrivatePathServiceGatewayEndpointGatewayBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update a virtual network interface. - * - * This request updates a virtual network interface with the information in a provided virtual network interface - * patch. The virtual network interface patch object is structured in the same way as a retrieved virtual network - * interface and contains only the information to be updated. - * - * @param updateVirtualNetworkInterfaceOptions the {@link UpdateVirtualNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} - */ - public ServiceCall updateVirtualNetworkInterface(UpdateVirtualNetworkInterfaceOptions updateVirtualNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVirtualNetworkInterfaceOptions, - "updateVirtualNetworkInterfaceOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateVirtualNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVirtualNetworkInterface"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); + final JsonObject contentJson = new JsonObject(); + if (denyPrivatePathServiceGatewayEndpointGatewayBindingOptions.setAccountPolicy() != null) { + contentJson.addProperty("set_account_policy", denyPrivatePathServiceGatewayEndpointGatewayBindingOptions.setAccountPolicy()); } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVirtualNetworkInterfaceOptions.virtualNetworkInterfacePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List floating IPs associated with a virtual network interface. + * Permit an endpoint gateway binding for a private path service gateway. * - * This request lists floating IPs associated with a virtual network interface. + * This request permits a `pending` endpoint gateway request, and optionally sets the policy to permit future requests + * from the same account. * - * @param listNetworkInterfaceFloatingIpsOptions the {@link ListNetworkInterfaceFloatingIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIPCollectionVirtualNetworkInterfaceContext} + * @param permitPrivatePathServiceGatewayEndpointGatewayBindingOptions the {@link PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listNetworkInterfaceFloatingIps(ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listNetworkInterfaceFloatingIpsOptions, - "listNetworkInterfaceFloatingIpsOptions cannot be null"); + public ServiceCall permitPrivatePathServiceGatewayEndpointGatewayBinding(PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions permitPrivatePathServiceGatewayEndpointGatewayBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(permitPrivatePathServiceGatewayEndpointGatewayBindingOptions, + "permitPrivatePathServiceGatewayEndpointGatewayBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("virtual_network_interface_id", listNetworkInterfaceFloatingIpsOptions.virtualNetworkInterfaceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listNetworkInterfaceFloatingIps"); + pathParamsMap.put("private_path_service_gateway_id", permitPrivatePathServiceGatewayEndpointGatewayBindingOptions.privatePathServiceGatewayId()); + pathParamsMap.put("id", permitPrivatePathServiceGatewayEndpointGatewayBindingOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}/permit", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "permitPrivatePathServiceGatewayEndpointGatewayBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listNetworkInterfaceFloatingIpsOptions.start() != null) { - builder.query("start", String.valueOf(listNetworkInterfaceFloatingIpsOptions.start())); - } - if (listNetworkInterfaceFloatingIpsOptions.limit() != null) { - builder.query("limit", String.valueOf(listNetworkInterfaceFloatingIpsOptions.limit())); - } - if (listNetworkInterfaceFloatingIpsOptions.sort() != null) { - builder.query("sort", String.valueOf(listNetworkInterfaceFloatingIpsOptions.sort())); + final JsonObject contentJson = new JsonObject(); + if (permitPrivatePathServiceGatewayEndpointGatewayBindingOptions.setAccountPolicy() != null) { + contentJson.addProperty("set_account_policy", permitPrivatePathServiceGatewayEndpointGatewayBindingOptions.setAccountPolicy()); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Disassociate a floating IP from a virtual network interface. + * Publish a private path service gateway. * - * This request disassociates the specified floating IP from the specified virtual network interface. + * This request publishes a private path service gateway, allowing any account to request access to it. * - * @param removeNetworkInterfaceFloatingIpOptions the {@link RemoveNetworkInterfaceFloatingIpOptions} containing the options for the call + * @param publishPrivatePathServiceGatewayOptions the {@link PublishPrivatePathServiceGatewayOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall removeNetworkInterfaceFloatingIp(RemoveNetworkInterfaceFloatingIpOptions removeNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(removeNetworkInterfaceFloatingIpOptions, - "removeNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall publishPrivatePathServiceGateway(PublishPrivatePathServiceGatewayOptions publishPrivatePathServiceGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(publishPrivatePathServiceGatewayOptions, + "publishPrivatePathServiceGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("virtual_network_interface_id", removeNetworkInterfaceFloatingIpOptions.virtualNetworkInterfaceId()); - pathParamsMap.put("id", removeNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeNetworkInterfaceFloatingIp"); + pathParamsMap.put("private_path_service_gateway_id", publishPrivatePathServiceGatewayOptions.privatePathServiceGatewayId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/publish", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "publishPrivatePathServiceGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -9541,345 +9422,299 @@ public ServiceCall removeNetworkInterfaceFloatingIp(RemoveNetworkInterface } /** - * Retrieve associated floating IP. + * Revoke access to a private path service gateway for an account. * - * This request retrieves a specified floating IP if it is associated with the virtual network interface specified in - * the URL. + * This request revokes a consumer account. This operation cannot be reversed. The `status` of all endpoint gateway + * bindings associated with the specified private path service gateway become `denied`. If the specified account has + * an existing access policy, that policy will be updated to `denied`. Otherwise, a new `deny` access policy will be + * created for the account. * - * @param getNetworkInterfaceFloatingIpOptions the {@link GetNetworkInterfaceFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIPReference} + * @param revokeAccountForPrivatePathServiceGatewayOptions the {@link RevokeAccountForPrivatePathServiceGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getNetworkInterfaceFloatingIp(GetNetworkInterfaceFloatingIpOptions getNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getNetworkInterfaceFloatingIpOptions, - "getNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall revokeAccountForPrivatePathServiceGateway(RevokeAccountForPrivatePathServiceGatewayOptions revokeAccountForPrivatePathServiceGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(revokeAccountForPrivatePathServiceGatewayOptions, + "revokeAccountForPrivatePathServiceGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("virtual_network_interface_id", getNetworkInterfaceFloatingIpOptions.virtualNetworkInterfaceId()); - pathParamsMap.put("id", getNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getNetworkInterfaceFloatingIp"); + pathParamsMap.put("private_path_service_gateway_id", revokeAccountForPrivatePathServiceGatewayOptions.privatePathServiceGatewayId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/revoke_account", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "revokeAccountForPrivatePathServiceGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("account", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(revokeAccountForPrivatePathServiceGatewayOptions.account())); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Add an association between a floating IP and a virtual network interface. - * - * This request adds an association between the specified floating IP and the specified virtual network interface. - * - * If the virtual network interface has `enable_infrastructure_nat` set to `true`, no more than one floating IP can be - * associated, and network address translation is performed between the floating IP address and the virtual network - * interface's `primary_ip` address. - * - * If the virtual network interface has `enable_infrastructure_nat` set to `false`, packets are passed unchanged - * to/from the virtual network interface. - * - * The floating IP must: - * - be in the same `zone` as the virtual network interface - * - not currently be associated with another resource - * - * The virtual network interface's `target` must not currently be a file share mount target. + * Unpublish a private path service gateway. * - * A request body is not required, and if provided, is ignored. + * This request unpublishes a private path service gateway. For this request to succeed, any existing access from + * other accounts must first be revoked. Once unpublished, access will again be restricted to the account that created + * this private path service gateway. * - * @param addNetworkInterfaceFloatingIpOptions the {@link AddNetworkInterfaceFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIPReference} + * @param unpublishPrivatePathServiceGatewayOptions the {@link UnpublishPrivatePathServiceGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall addNetworkInterfaceFloatingIp(AddNetworkInterfaceFloatingIpOptions addNetworkInterfaceFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(addNetworkInterfaceFloatingIpOptions, - "addNetworkInterfaceFloatingIpOptions cannot be null"); + public ServiceCall unpublishPrivatePathServiceGateway(UnpublishPrivatePathServiceGatewayOptions unpublishPrivatePathServiceGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(unpublishPrivatePathServiceGatewayOptions, + "unpublishPrivatePathServiceGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("virtual_network_interface_id", addNetworkInterfaceFloatingIpOptions.virtualNetworkInterfaceId()); - pathParamsMap.put("id", addNetworkInterfaceFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addNetworkInterfaceFloatingIp"); + pathParamsMap.put("private_path_service_gateway_id", unpublishPrivatePathServiceGatewayOptions.privatePathServiceGatewayId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/unpublish", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "unpublishPrivatePathServiceGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List reserved IPs bound to a virtual network interface. + * List public address ranges. * - * This request lists reserved IPs bound to a virtual network interface. + * This request lists [public address ranges](https://cloud.ibm.com/docs/vpc?topic=vpc-about-par) in the region. A + * public address range is a contiguous block of public IP addresses that can be bound to a `target` that specifies a + * `vpc` and a `zone`. Incoming traffic for these IP addresses will be routed according to the VPC's ingress routing + * table. * - * @param listVirtualNetworkInterfaceIpsOptions the {@link ListVirtualNetworkInterfaceIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionVirtualNetworkInterfaceContext} + * @param listPublicAddressRangesOptions the {@link ListPublicAddressRangesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicAddressRangeCollection} */ - public ServiceCall listVirtualNetworkInterfaceIps(ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVirtualNetworkInterfaceIpsOptions, - "listVirtualNetworkInterfaceIpsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("virtual_network_interface_id", listVirtualNetworkInterfaceIpsOptions.virtualNetworkInterfaceId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVirtualNetworkInterfaceIps"); + public ServiceCall listPublicAddressRanges(ListPublicAddressRangesOptions listPublicAddressRangesOptions) { + if (listPublicAddressRangesOptions == null) { + listPublicAddressRangesOptions = new ListPublicAddressRangesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPublicAddressRanges"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVirtualNetworkInterfaceIpsOptions.start() != null) { - builder.query("start", String.valueOf(listVirtualNetworkInterfaceIpsOptions.start())); + if (listPublicAddressRangesOptions.start() != null) { + builder.query("start", String.valueOf(listPublicAddressRangesOptions.start())); } - if (listVirtualNetworkInterfaceIpsOptions.limit() != null) { - builder.query("limit", String.valueOf(listVirtualNetworkInterfaceIpsOptions.limit())); + if (listPublicAddressRangesOptions.limit() != null) { + builder.query("limit", String.valueOf(listPublicAddressRangesOptions.limit())); } - if (listVirtualNetworkInterfaceIpsOptions.sort() != null) { - builder.query("sort", String.valueOf(listVirtualNetworkInterfaceIpsOptions.sort())); + if (listPublicAddressRangesOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listPublicAddressRangesOptions.resourceGroupId())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Unbind a reserved IP from a virtual network interface. - * - * This request unbinds the specified reserved IP from the specified virtual network interface. If the reserved IP has - * `auto_delete` set to `true`, the reserved IP will be deleted. + * List public address ranges. * - * The reserved IP for the `primary_ip` cannot be unbound. + * This request lists [public address ranges](https://cloud.ibm.com/docs/vpc?topic=vpc-about-par) in the region. A + * public address range is a contiguous block of public IP addresses that can be bound to a `target` that specifies a + * `vpc` and a `zone`. Incoming traffic for these IP addresses will be routed according to the VPC's ingress routing + * table. * - * @param removeVirtualNetworkInterfaceIpOptions the {@link RemoveVirtualNetworkInterfaceIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @return a {@link ServiceCall} with a result of type {@link PublicAddressRangeCollection} */ - public ServiceCall removeVirtualNetworkInterfaceIp(RemoveVirtualNetworkInterfaceIpOptions removeVirtualNetworkInterfaceIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(removeVirtualNetworkInterfaceIpOptions, - "removeVirtualNetworkInterfaceIpOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("virtual_network_interface_id", removeVirtualNetworkInterfaceIpOptions.virtualNetworkInterfaceId()); - pathParamsMap.put("id", removeVirtualNetworkInterfaceIpOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeVirtualNetworkInterfaceIp"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listPublicAddressRanges() { + return listPublicAddressRanges(null); } /** - * Retrieve bound reserved IP. + * Create a public address range. * - * This request retrieves the specified reserved IP address if it is bound to the virtual network interface specified - * in the URL. + * This request creates a new public address range from a public address range prototype object. The prototype object + * is structured in the same way as a retrieved public address range, and contains the information necessary to create + * the new public address range. * - * @param getVirtualNetworkInterfaceIpOptions the {@link GetVirtualNetworkInterfaceIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIPReference} + * @param createPublicAddressRangeOptions the {@link CreatePublicAddressRangeOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicAddressRange} */ - public ServiceCall getVirtualNetworkInterfaceIp(GetVirtualNetworkInterfaceIpOptions getVirtualNetworkInterfaceIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVirtualNetworkInterfaceIpOptions, - "getVirtualNetworkInterfaceIpOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("virtual_network_interface_id", getVirtualNetworkInterfaceIpOptions.virtualNetworkInterfaceId()); - pathParamsMap.put("id", getVirtualNetworkInterfaceIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVirtualNetworkInterfaceIp"); + public ServiceCall createPublicAddressRange(CreatePublicAddressRangeOptions createPublicAddressRangeOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createPublicAddressRangeOptions, + "createPublicAddressRangeOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPublicAddressRange"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("ipv4_address_count", createPublicAddressRangeOptions.ipv4AddressCount()); + if (createPublicAddressRangeOptions.name() != null) { + contentJson.addProperty("name", createPublicAddressRangeOptions.name()); + } + if (createPublicAddressRangeOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicAddressRangeOptions.resourceGroup())); + } + if (createPublicAddressRangeOptions.target() != null) { + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicAddressRangeOptions.target())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Bind a reserved IP to a virtual network interface. - * - * This request binds the specified reserved IP to the specified virtual network interface. + * Delete a public address range. * - * The reserved IP must currently be unbound and in the primary IP's subnet. The virtual network interface's `target` - * must not currently be a file share mount target. + * This request deletes a public address range. If the public address range is bound to a + * `target`, it will be unbound. This operation cannot be reversed. * - * @param addVirtualNetworkInterfaceIpOptions the {@link AddVirtualNetworkInterfaceIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIPReference} + * @param deletePublicAddressRangeOptions the {@link DeletePublicAddressRangeOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicAddressRange} */ - public ServiceCall addVirtualNetworkInterfaceIp(AddVirtualNetworkInterfaceIpOptions addVirtualNetworkInterfaceIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(addVirtualNetworkInterfaceIpOptions, - "addVirtualNetworkInterfaceIpOptions cannot be null"); + public ServiceCall deletePublicAddressRange(DeletePublicAddressRangeOptions deletePublicAddressRangeOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deletePublicAddressRangeOptions, + "deletePublicAddressRangeOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("virtual_network_interface_id", addVirtualNetworkInterfaceIpOptions.virtualNetworkInterfaceId()); - pathParamsMap.put("id", addVirtualNetworkInterfaceIpOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addVirtualNetworkInterfaceIp"); + pathParamsMap.put("id", deletePublicAddressRangeOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePublicAddressRange"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List cluster network profiles. + * Retrieve a public address range. * - * This request lists cluster network profiles available in the region. A cluster network profile specifies the - * performance characteristics and capabilities for a cluster network. + * This request retrieves a single public address range specified by the identifier in the URL. * - * @param listClusterNetworkProfilesOptions the {@link ListClusterNetworkProfilesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkProfileCollection} + * @param getPublicAddressRangeOptions the {@link GetPublicAddressRangeOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicAddressRange} */ - public ServiceCall listClusterNetworkProfiles(ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptions) { - if (listClusterNetworkProfilesOptions == null) { - listClusterNetworkProfilesOptions = new ListClusterNetworkProfilesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_network/profiles")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworkProfiles"); + public ServiceCall getPublicAddressRange(GetPublicAddressRangeOptions getPublicAddressRangeOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getPublicAddressRangeOptions, + "getPublicAddressRangeOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getPublicAddressRangeOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPublicAddressRange"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listClusterNetworkProfilesOptions.start() != null) { - builder.query("start", String.valueOf(listClusterNetworkProfilesOptions.start())); - } - if (listClusterNetworkProfilesOptions.limit() != null) { - builder.query("limit", String.valueOf(listClusterNetworkProfilesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List cluster network profiles. - * - * This request lists cluster network profiles available in the region. A cluster network profile specifies the - * performance characteristics and capabilities for a cluster network. - * - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkProfileCollection} - */ - public ServiceCall listClusterNetworkProfiles() { - return listClusterNetworkProfiles(null); - } - - /** - * Retrieve a cluster network profile. + * Update a public address range. * - * This request retrieves a single cluster network profile specified by the name in the URL. + * This request updates a public address range with the information in a provided public address range patch. The + * public address range patch object is structured in the same way as a retrieved public address range and contains + * only the information to be updated. * - * @param getClusterNetworkProfileOptions the {@link GetClusterNetworkProfileOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkProfile} + * @param updatePublicAddressRangeOptions the {@link UpdatePublicAddressRangeOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicAddressRange} */ - public ServiceCall getClusterNetworkProfile(GetClusterNetworkProfileOptions getClusterNetworkProfileOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkProfileOptions, - "getClusterNetworkProfileOptions cannot be null"); + public ServiceCall updatePublicAddressRange(UpdatePublicAddressRangeOptions updatePublicAddressRangeOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updatePublicAddressRangeOptions, + "updatePublicAddressRangeOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getClusterNetworkProfileOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_network/profiles/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetworkProfile"); + pathParamsMap.put("id", updatePublicAddressRangeOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePublicAddressRange"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePublicAddressRangeOptions.publicAddressRangePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List cluster networks. + * List public gateways. * - * This request lists [cluster networks](https://cloud.ibm.com/docs/vpc?topic=vpc-about-cluster-network) in the - * region. A cluster network is a grouping of resources in a separate networking space for high performance computing - * and networking. + * This request lists public gateways in the region. A public gateway is a virtual network device associated with a + * VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the + * same zone only. * - * @param listClusterNetworksOptions the {@link ListClusterNetworksOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkCollection} + * @param listPublicGatewaysOptions the {@link ListPublicGatewaysOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicGatewayCollection} */ - public ServiceCall listClusterNetworks(ListClusterNetworksOptions listClusterNetworksOptions) { - if (listClusterNetworksOptions == null) { - listClusterNetworksOptions = new ListClusterNetworksOptions.Builder().build(); + public ServiceCall listPublicGateways(ListPublicGatewaysOptions listPublicGatewaysOptions) { + if (listPublicGatewaysOptions == null) { + listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder().build(); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworks"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPublicGateways"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listClusterNetworksOptions.start() != null) { - builder.query("start", String.valueOf(listClusterNetworksOptions.start())); - } - if (listClusterNetworksOptions.limit() != null) { - builder.query("limit", String.valueOf(listClusterNetworksOptions.limit())); - } - if (listClusterNetworksOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listClusterNetworksOptions.resourceGroupId())); - } - if (listClusterNetworksOptions.name() != null) { - builder.query("name", String.valueOf(listClusterNetworksOptions.name())); - } - if (listClusterNetworksOptions.sort() != null) { - builder.query("sort", String.valueOf(listClusterNetworksOptions.sort())); - } - if (listClusterNetworksOptions.vpcId() != null) { - builder.query("vpc.id", String.valueOf(listClusterNetworksOptions.vpcId())); + if (listPublicGatewaysOptions.start() != null) { + builder.query("start", String.valueOf(listPublicGatewaysOptions.start())); } - if (listClusterNetworksOptions.vpcCrn() != null) { - builder.query("vpc.crn", String.valueOf(listClusterNetworksOptions.vpcCrn())); + if (listPublicGatewaysOptions.limit() != null) { + builder.query("limit", String.valueOf(listPublicGatewaysOptions.limit())); } - if (listClusterNetworksOptions.vpcName() != null) { - builder.query("vpc.name", String.valueOf(listClusterNetworksOptions.vpcName())); + if (listPublicGatewaysOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listPublicGatewaysOptions.resourceGroupId())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List cluster networks. + * List public gateways. * - * This request lists [cluster networks](https://cloud.ibm.com/docs/vpc?topic=vpc-about-cluster-network) in the - * region. A cluster network is a grouping of resources in a separate networking space for high performance computing - * and networking. + * This request lists public gateways in the region. A public gateway is a virtual network device associated with a + * VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the + * same zone only. * - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkCollection} + * @return a {@link ServiceCall} with a result of type {@link PublicGatewayCollection} */ - public ServiceCall listClusterNetworks() { - return listClusterNetworks(null); + public ServiceCall listPublicGateways() { + return listPublicGateways(null); } /** - * Create a cluster network. + * Create a public gateway. * - * This request creates a new cluster network from a cluster network prototype object. The prototype object is - * structured in the same way as a retrieved cluster network, and contains the information necessary to create the new - * cluster network. + * This request creates a new public gateway from a public gateway prototype object. For this to succeed, the VPC must + * not already have a public gateway in the specified zone. * - * @param createClusterNetworkOptions the {@link CreateClusterNetworkOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetwork} + * If a floating IP is provided, it must be unbound. If a floating IP is not provided, one will be created and bound + * to the public gateway. Once a public gateway has been created, its floating IP cannot be unbound. A public gateway + * must be explicitly attached to each subnet it will provide connectivity for. + * + * @param createPublicGatewayOptions the {@link CreatePublicGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicGateway} */ - public ServiceCall createClusterNetwork(CreateClusterNetworkOptions createClusterNetworkOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkOptions, - "createClusterNetworkOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetwork"); + public ServiceCall createPublicGateway(CreatePublicGatewayOptions createPublicGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createPublicGatewayOptions, + "createPublicGatewayOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPublicGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -9887,1981 +9722,1878 @@ public ServiceCall createClusterNetwork(CreateClusterNetworkOpti builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.add("profile", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.profile())); - contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.vpc())); - contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.zone())); - if (createClusterNetworkOptions.name() != null) { - contentJson.addProperty("name", createClusterNetworkOptions.name()); + contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicGatewayOptions.vpc())); + contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicGatewayOptions.zone())); + if (createPublicGatewayOptions.floatingIp() != null) { + contentJson.add("floating_ip", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicGatewayOptions.floatingIp())); } - if (createClusterNetworkOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.resourceGroup())); + if (createPublicGatewayOptions.name() != null) { + contentJson.addProperty("name", createPublicGatewayOptions.name()); } - if (createClusterNetworkOptions.subnetPrefixes() != null) { - contentJson.add("subnet_prefixes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkOptions.subnetPrefixes())); + if (createPublicGatewayOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicGatewayOptions.resourceGroup())); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List cluster network interfaces. - * - * This request lists cluster network interfaces in the region. A cluster network interface is a logical abstraction - * of a cluster network interface in a subnet, and may be attached to a target resource. + * Delete a public gateway. * - * The cluster network interfaces will be sorted by their `created_at` property values, with newest cluster network - * interfaces first. Cluster network interfaces with identical - * `created_at` property values will in turn be sorted by ascending `name` property values. + * This request deletes a public gateway. This operation cannot be reversed. For this request to succeed, the public + * gateway must not be attached to any subnets. The public gateway's floating IP will be automatically unbound. If the + * floating IP was created when the public gateway was created, it will be deleted. * - * @param listClusterNetworkInterfacesOptions the {@link ListClusterNetworkInterfacesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterfaceCollection} + * @param deletePublicGatewayOptions the {@link DeletePublicGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listClusterNetworkInterfaces(ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listClusterNetworkInterfacesOptions, - "listClusterNetworkInterfacesOptions cannot be null"); + public ServiceCall deletePublicGateway(DeletePublicGatewayOptions deletePublicGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deletePublicGatewayOptions, + "deletePublicGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", listClusterNetworkInterfacesOptions.clusterNetworkId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworkInterfaces"); + pathParamsMap.put("id", deletePublicGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePublicGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listClusterNetworkInterfacesOptions.start() != null) { - builder.query("start", String.valueOf(listClusterNetworkInterfacesOptions.start())); - } - if (listClusterNetworkInterfacesOptions.limit() != null) { - builder.query("limit", String.valueOf(listClusterNetworkInterfacesOptions.limit())); - } - if (listClusterNetworkInterfacesOptions.name() != null) { - builder.query("name", String.valueOf(listClusterNetworkInterfacesOptions.name())); - } - if (listClusterNetworkInterfacesOptions.sort() != null) { - builder.query("sort", String.valueOf(listClusterNetworkInterfacesOptions.sort())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Create a cluster network interface. + * Retrieve a public gateway. * - * This request creates a new cluster network interface from a cluster network interface prototype object. The - * prototype object is structured in the same way as a retrieved cluster network interface, and contains the - * information necessary to create the new cluster network interface. + * This request retrieves a single public gateway specified by the identifier in the URL. * - * @param createClusterNetworkInterfaceOptions the {@link CreateClusterNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterface} + * @param getPublicGatewayOptions the {@link GetPublicGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicGateway} */ - public ServiceCall createClusterNetworkInterface(CreateClusterNetworkInterfaceOptions createClusterNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkInterfaceOptions, - "createClusterNetworkInterfaceOptions cannot be null"); + public ServiceCall getPublicGateway(GetPublicGatewayOptions getPublicGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getPublicGatewayOptions, + "getPublicGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", createClusterNetworkInterfaceOptions.clusterNetworkId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetworkInterface"); + pathParamsMap.put("id", getPublicGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPublicGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - if (createClusterNetworkInterfaceOptions.name() != null) { - contentJson.addProperty("name", createClusterNetworkInterfaceOptions.name()); - } - if (createClusterNetworkInterfaceOptions.primaryIp() != null) { - contentJson.add("primary_ip", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkInterfaceOptions.primaryIp())); - } - if (createClusterNetworkInterfaceOptions.subnet() != null) { - contentJson.add("subnet", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createClusterNetworkInterfaceOptions.subnet())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a cluster network interface. + * Update a public gateway. * - * This request deletes a cluster network interface. This operation cannot be reversed. For this request to succeed, - * the cluster network interface must not be required by another resource, such as a cluster network attachment for a - * virtual server instance. + * This request updates a public gateway's name. * - * @param deleteClusterNetworkInterfaceOptions the {@link DeleteClusterNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterface} + * @param updatePublicGatewayOptions the {@link UpdatePublicGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicGateway} */ - public ServiceCall deleteClusterNetworkInterface(DeleteClusterNetworkInterfaceOptions deleteClusterNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteClusterNetworkInterfaceOptions, - "deleteClusterNetworkInterfaceOptions cannot be null"); + public ServiceCall updatePublicGateway(UpdatePublicGatewayOptions updatePublicGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updatePublicGatewayOptions, + "updatePublicGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", deleteClusterNetworkInterfaceOptions.clusterNetworkId()); - pathParamsMap.put("id", deleteClusterNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteClusterNetworkInterface"); + pathParamsMap.put("id", updatePublicGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePublicGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (deleteClusterNetworkInterfaceOptions.ifMatch() != null) { - builder.header("If-Match", deleteClusterNetworkInterfaceOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePublicGatewayOptions.publicGatewayPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a cluster network interface. + * List reservations. * - * This request retrieves a single cluster network interface specified by the identifier in the URL. + * This request lists reservations in the region. A reservation provides reserved capacity for a specified profile in + * a specified zone. A reservation can also include a long-term committed use discount. * - * @param getClusterNetworkInterfaceOptions the {@link GetClusterNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterface} + * The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations + * with identical `created_at` property values will in turn be sorted by ascending `name` property values. + * + * @param listReservationsOptions the {@link ListReservationsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservationCollection} */ - public ServiceCall getClusterNetworkInterface(GetClusterNetworkInterfaceOptions getClusterNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkInterfaceOptions, - "getClusterNetworkInterfaceOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", getClusterNetworkInterfaceOptions.clusterNetworkId()); - pathParamsMap.put("id", getClusterNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetworkInterface"); + public ServiceCall listReservations(ListReservationsOptions listReservationsOptions) { + if (listReservationsOptions == null) { + listReservationsOptions = new ListReservationsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listReservations"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listReservationsOptions.start() != null) { + builder.query("start", String.valueOf(listReservationsOptions.start())); + } + if (listReservationsOptions.limit() != null) { + builder.query("limit", String.valueOf(listReservationsOptions.limit())); + } + if (listReservationsOptions.name() != null) { + builder.query("name", String.valueOf(listReservationsOptions.name())); + } + if (listReservationsOptions.profileResourceType() != null) { + builder.query("profile.resource_type", String.valueOf(listReservationsOptions.profileResourceType())); + } + if (listReservationsOptions.affinityPolicy() != null) { + builder.query("affinity_policy", String.valueOf(listReservationsOptions.affinityPolicy())); + } + if (listReservationsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listReservationsOptions.resourceGroupId())); + } + if (listReservationsOptions.zoneName() != null) { + builder.query("zone.name", String.valueOf(listReservationsOptions.zoneName())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a cluster network interface. + * List reservations. * - * This request updates a cluster network interface with the information provided in a cluster network interface patch - * object. The patch object is structured in the same way as a retrieved cluster network interface and needs to - * contain only the information to be updated. + * This request lists reservations in the region. A reservation provides reserved capacity for a specified profile in + * a specified zone. A reservation can also include a long-term committed use discount. * - * @param updateClusterNetworkInterfaceOptions the {@link UpdateClusterNetworkInterfaceOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkInterface} + * The reservations will be sorted by their `created_at` property values, with newest reservations first. Reservations + * with identical `created_at` property values will in turn be sorted by ascending `name` property values. + * + * @return a {@link ServiceCall} with a result of type {@link ReservationCollection} */ - public ServiceCall updateClusterNetworkInterface(UpdateClusterNetworkInterfaceOptions updateClusterNetworkInterfaceOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateClusterNetworkInterfaceOptions, - "updateClusterNetworkInterfaceOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", updateClusterNetworkInterfaceOptions.clusterNetworkId()); - pathParamsMap.put("id", updateClusterNetworkInterfaceOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/interfaces/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateClusterNetworkInterface"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (updateClusterNetworkInterfaceOptions.ifMatch() != null) { - builder.header("If-Match", updateClusterNetworkInterfaceOptions.ifMatch()); - } - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateClusterNetworkInterfaceOptions.clusterNetworkInterfacePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listReservations() { + return listReservations(null); } /** - * List cluster network subnets. + * Create a reservation. * - * This request lists cluster network subnets in the cluster network. A cluster network subnet provides network - * routing between other cluster network subnets within a cluster network. + * This request creates a new reservation from a reservation prototype object. The prototype object is structured in + * the same way as a retrieved reservation, and contains the information necessary to create the new reservation. * - * @param listClusterNetworkSubnetsOptions the {@link ListClusterNetworkSubnetsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetCollection} + * @param createReservationOptions the {@link CreateReservationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Reservation} */ - public ServiceCall listClusterNetworkSubnets(ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listClusterNetworkSubnetsOptions, - "listClusterNetworkSubnetsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", listClusterNetworkSubnetsOptions.clusterNetworkId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworkSubnets"); + public ServiceCall createReservation(CreateReservationOptions createReservationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createReservationOptions, + "createReservationOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createReservation"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listClusterNetworkSubnetsOptions.start() != null) { - builder.query("start", String.valueOf(listClusterNetworkSubnetsOptions.start())); - } - if (listClusterNetworkSubnetsOptions.limit() != null) { - builder.query("limit", String.valueOf(listClusterNetworkSubnetsOptions.limit())); + final JsonObject contentJson = new JsonObject(); + contentJson.add("capacity", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.capacity())); + contentJson.add("committed_use", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.committedUse())); + contentJson.add("profile", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.profile())); + contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.zone())); + if (createReservationOptions.affinityPolicy() != null) { + contentJson.addProperty("affinity_policy", createReservationOptions.affinityPolicy()); } - if (listClusterNetworkSubnetsOptions.name() != null) { - builder.query("name", String.valueOf(listClusterNetworkSubnetsOptions.name())); + if (createReservationOptions.name() != null) { + contentJson.addProperty("name", createReservationOptions.name()); } - if (listClusterNetworkSubnetsOptions.sort() != null) { - builder.query("sort", String.valueOf(listClusterNetworkSubnetsOptions.sort())); + if (createReservationOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createReservationOptions.resourceGroup())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a cluster network subnet. + * Delete a reservation. * - * This request creates a new cluster network subnet from a cluster network subnet prototype object. The prototype - * object is structured in the same way as a retrieved cluster network subnet, and contains the information necessary - * to create the new cluster network subnet. + * This request deletes a reservation. This operation cannot be reversed. Reservations with a `status` of `active` are + * not allowed to be deleted. * - * @param createClusterNetworkSubnetOptions the {@link CreateClusterNetworkSubnetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnet} + * @param deleteReservationOptions the {@link DeleteReservationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Reservation} */ - public ServiceCall createClusterNetworkSubnet(CreateClusterNetworkSubnetOptions createClusterNetworkSubnetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkSubnetOptions, - "createClusterNetworkSubnetOptions cannot be null"); + public ServiceCall deleteReservation(DeleteReservationOptions deleteReservationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteReservationOptions, + "deleteReservationOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", createClusterNetworkSubnetOptions.clusterNetworkId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetworkSubnet"); + pathParamsMap.put("id", deleteReservationOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteReservation"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createClusterNetworkSubnetOptions.clusterNetworkSubnetPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List cluster network subnet reserved IPs. + * Retrieve a reservation. * - * This request lists cluster network subnet reserved IPs in the cluster network. + * This request retrieves a single reservation specified by identifier in the URL. * - * @param listClusterNetworkSubnetReservedIpsOptions the {@link ListClusterNetworkSubnetReservedIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIPCollection} + * @param getReservationOptions the {@link GetReservationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Reservation} */ - public ServiceCall listClusterNetworkSubnetReservedIps(ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listClusterNetworkSubnetReservedIpsOptions, - "listClusterNetworkSubnetReservedIpsOptions cannot be null"); + public ServiceCall getReservation(GetReservationOptions getReservationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getReservationOptions, + "getReservationOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", listClusterNetworkSubnetReservedIpsOptions.clusterNetworkId()); - pathParamsMap.put("cluster_network_subnet_id", listClusterNetworkSubnetReservedIpsOptions.clusterNetworkSubnetId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listClusterNetworkSubnetReservedIps"); + pathParamsMap.put("id", getReservationOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getReservation"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listClusterNetworkSubnetReservedIpsOptions.start() != null) { - builder.query("start", String.valueOf(listClusterNetworkSubnetReservedIpsOptions.start())); - } - if (listClusterNetworkSubnetReservedIpsOptions.limit() != null) { - builder.query("limit", String.valueOf(listClusterNetworkSubnetReservedIpsOptions.limit())); - } - if (listClusterNetworkSubnetReservedIpsOptions.name() != null) { - builder.query("name", String.valueOf(listClusterNetworkSubnetReservedIpsOptions.name())); - } - if (listClusterNetworkSubnetReservedIpsOptions.sort() != null) { - builder.query("sort", String.valueOf(listClusterNetworkSubnetReservedIpsOptions.sort())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a cluster network subnet reserved IP. + * Update a reservation. * - * This request creates a new cluster network subnet reserved IP from a cluster network subnet reserved IP prototype - * object. The prototype object is structured in the same way as a retrieved cluster network subnet reserved IP, and - * contains the information necessary to create the new cluster network subnet reserved IP. + * This request updates a reservation with the information provided in a reservation patch object. The patch object is + * structured in the same way as a retrieved reservation and needs to contain only the information to be updated. * - * @param createClusterNetworkSubnetReservedIpOptions the {@link CreateClusterNetworkSubnetReservedIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIP} + * @param updateReservationOptions the {@link UpdateReservationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Reservation} */ - public ServiceCall createClusterNetworkSubnetReservedIp(CreateClusterNetworkSubnetReservedIpOptions createClusterNetworkSubnetReservedIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createClusterNetworkSubnetReservedIpOptions, - "createClusterNetworkSubnetReservedIpOptions cannot be null"); + public ServiceCall updateReservation(UpdateReservationOptions updateReservationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateReservationOptions, + "updateReservationOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", createClusterNetworkSubnetReservedIpOptions.clusterNetworkId()); - pathParamsMap.put("cluster_network_subnet_id", createClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createClusterNetworkSubnetReservedIp"); + pathParamsMap.put("id", updateReservationOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateReservation"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - if (createClusterNetworkSubnetReservedIpOptions.address() != null) { - contentJson.addProperty("address", createClusterNetworkSubnetReservedIpOptions.address()); - } - if (createClusterNetworkSubnetReservedIpOptions.name() != null) { - contentJson.addProperty("name", createClusterNetworkSubnetReservedIpOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateReservationOptions.reservationPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a cluster network subnet reserved IP. - * - * This request deletes a cluster network subnet reserved IP. This operation cannot be reversed. + * Activate a reservation. * - * For this request to succeed, the reserved IP must be unbound. A provider-owned reserved IP is not allowed to be - * deleted. + * This request activates a reservation. For this request to succeed, the reservation status must be `inactive`. * - * @param deleteClusterNetworkSubnetReservedIpOptions the {@link DeleteClusterNetworkSubnetReservedIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIP} + * @param activateReservationOptions the {@link ActivateReservationOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteClusterNetworkSubnetReservedIp(DeleteClusterNetworkSubnetReservedIpOptions deleteClusterNetworkSubnetReservedIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteClusterNetworkSubnetReservedIpOptions, - "deleteClusterNetworkSubnetReservedIpOptions cannot be null"); + public ServiceCall activateReservation(ActivateReservationOptions activateReservationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(activateReservationOptions, + "activateReservationOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", deleteClusterNetworkSubnetReservedIpOptions.clusterNetworkId()); - pathParamsMap.put("cluster_network_subnet_id", deleteClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetId()); - pathParamsMap.put("id", deleteClusterNetworkSubnetReservedIpOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteClusterNetworkSubnetReservedIp"); + pathParamsMap.put("id", activateReservationOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reservations/{id}/activate", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "activateReservation"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); - if (deleteClusterNetworkSubnetReservedIpOptions.ifMatch() != null) { - builder.header("If-Match", deleteClusterNetworkSubnetReservedIpOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a cluster network subnet reserved IP. + * List security groups. * - * This request retrieves a single cluster network subnet reserved IP specified by the identifier in the URL. + * 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 getClusterNetworkSubnetReservedIpOptions the {@link GetClusterNetworkSubnetReservedIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIP} + * @param listSecurityGroupsOptions the {@link ListSecurityGroupsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection} */ - public ServiceCall getClusterNetworkSubnetReservedIp(GetClusterNetworkSubnetReservedIpOptions getClusterNetworkSubnetReservedIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkSubnetReservedIpOptions, - "getClusterNetworkSubnetReservedIpOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", getClusterNetworkSubnetReservedIpOptions.clusterNetworkId()); - pathParamsMap.put("cluster_network_subnet_id", getClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetId()); - pathParamsMap.put("id", getClusterNetworkSubnetReservedIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetworkSubnetReservedIp"); + public ServiceCall listSecurityGroups(ListSecurityGroupsOptions listSecurityGroupsOptions) { + if (listSecurityGroupsOptions == null) { + listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSecurityGroups"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listSecurityGroupsOptions.start() != null) { + builder.query("start", String.valueOf(listSecurityGroupsOptions.start())); + } + if (listSecurityGroupsOptions.limit() != null) { + builder.query("limit", String.valueOf(listSecurityGroupsOptions.limit())); + } + if (listSecurityGroupsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listSecurityGroupsOptions.resourceGroupId())); + } + if (listSecurityGroupsOptions.vpcId() != null) { + builder.query("vpc.id", String.valueOf(listSecurityGroupsOptions.vpcId())); + } + if (listSecurityGroupsOptions.vpcCrn() != null) { + builder.query("vpc.crn", String.valueOf(listSecurityGroupsOptions.vpcCrn())); + } + if (listSecurityGroupsOptions.vpcName() != null) { + builder.query("vpc.name", String.valueOf(listSecurityGroupsOptions.vpcName())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a cluster network subnet reserved IP. + * List security groups. * - * This request updates a cluster network subnet reserved IP with the information provided in a cluster network subnet - * reserved IP patch object. The patch object is structured in the same way as a retrieved cluster network subnet - * reserved IP and needs to contain only the information to be updated. + * 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 updateClusterNetworkSubnetReservedIpOptions the {@link UpdateClusterNetworkSubnetReservedIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnetReservedIP} + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection} */ - public ServiceCall updateClusterNetworkSubnetReservedIp(UpdateClusterNetworkSubnetReservedIpOptions updateClusterNetworkSubnetReservedIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateClusterNetworkSubnetReservedIpOptions, - "updateClusterNetworkSubnetReservedIpOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", updateClusterNetworkSubnetReservedIpOptions.clusterNetworkId()); - pathParamsMap.put("cluster_network_subnet_id", updateClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetId()); - pathParamsMap.put("id", updateClusterNetworkSubnetReservedIpOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{cluster_network_subnet_id}/reserved_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateClusterNetworkSubnetReservedIp"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (updateClusterNetworkSubnetReservedIpOptions.ifMatch() != null) { - builder.header("If-Match", updateClusterNetworkSubnetReservedIpOptions.ifMatch()); - } - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateClusterNetworkSubnetReservedIpOptions.clusterNetworkSubnetReservedIpPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listSecurityGroups() { + return listSecurityGroups(null); } /** - * Delete a cluster network subnet. - * - * This request deletes a cluster network subnet. This operation cannot be reversed. + * Create a security group. * - * For this request to succeed, this cluster subnet must not be attached to a cluster network interface. + * This request creates a new security group from a security group prototype object. The prototype object is + * structured in the same way as a retrieved security group, and contains the information necessary to create the new + * security group. If security group rules are included in the prototype object, those rules will be added to the + * security group. Each security group is scoped to one VPC. Only resources in that VPC can be added to the security + * group. * - * @param deleteClusterNetworkSubnetOptions the {@link DeleteClusterNetworkSubnetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnet} + * @param createSecurityGroupOptions the {@link CreateSecurityGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroup} */ - public ServiceCall deleteClusterNetworkSubnet(DeleteClusterNetworkSubnetOptions deleteClusterNetworkSubnetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteClusterNetworkSubnetOptions, - "deleteClusterNetworkSubnetOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", deleteClusterNetworkSubnetOptions.clusterNetworkId()); - pathParamsMap.put("id", deleteClusterNetworkSubnetOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteClusterNetworkSubnet"); + public ServiceCall createSecurityGroup(CreateSecurityGroupOptions createSecurityGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createSecurityGroupOptions, + "createSecurityGroupOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSecurityGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (deleteClusterNetworkSubnetOptions.ifMatch() != null) { - builder.header("If-Match", deleteClusterNetworkSubnetOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createSecurityGroupOptions.vpc())); + if (createSecurityGroupOptions.name() != null) { + contentJson.addProperty("name", createSecurityGroupOptions.name()); + } + if (createSecurityGroupOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createSecurityGroupOptions.resourceGroup())); + } + if (createSecurityGroupOptions.rules() != null) { + contentJson.add("rules", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createSecurityGroupOptions.rules())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a cluster network subnet. + * Delete a security group. * - * This request retrieves a single cluster network subnet specified by the identifier in the URL. + * This request deletes a security group. A security group cannot be deleted if it is referenced by any security group + * targets or rules. Additionally, a VPC's default security group cannot be deleted. This operation cannot be + * reversed. * - * @param getClusterNetworkSubnetOptions the {@link GetClusterNetworkSubnetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnet} + * @param deleteSecurityGroupOptions the {@link DeleteSecurityGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getClusterNetworkSubnet(GetClusterNetworkSubnetOptions getClusterNetworkSubnetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkSubnetOptions, - "getClusterNetworkSubnetOptions cannot be null"); + public ServiceCall deleteSecurityGroup(DeleteSecurityGroupOptions deleteSecurityGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSecurityGroupOptions, + "deleteSecurityGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", getClusterNetworkSubnetOptions.clusterNetworkId()); - pathParamsMap.put("id", getClusterNetworkSubnetOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetworkSubnet"); + pathParamsMap.put("id", deleteSecurityGroupOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSecurityGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update a cluster network subnet. + * Retrieve a security group. * - * This request updates a cluster network subnet with the information provided in a cluster network subnet patch - * object. The patch object is structured in the same way as a retrieved cluster network subnet and needs to contain - * only the information to be updated. + * This request retrieves a single security group specified by the identifier in the URL path. * - * @param updateClusterNetworkSubnetOptions the {@link UpdateClusterNetworkSubnetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetworkSubnet} + * @param getSecurityGroupOptions the {@link GetSecurityGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroup} */ - public ServiceCall updateClusterNetworkSubnet(UpdateClusterNetworkSubnetOptions updateClusterNetworkSubnetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateClusterNetworkSubnetOptions, - "updateClusterNetworkSubnetOptions cannot be null"); + public ServiceCall getSecurityGroup(GetSecurityGroupOptions getSecurityGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSecurityGroupOptions, + "getSecurityGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("cluster_network_id", updateClusterNetworkSubnetOptions.clusterNetworkId()); - pathParamsMap.put("id", updateClusterNetworkSubnetOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{cluster_network_id}/subnets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateClusterNetworkSubnet"); + pathParamsMap.put("id", getSecurityGroupOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSecurityGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateClusterNetworkSubnetOptions.ifMatch() != null) { - builder.header("If-Match", updateClusterNetworkSubnetOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateClusterNetworkSubnetOptions.clusterNetworkSubnetPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a cluster network. - * - * This request deletes a cluster network. This operation cannot be reversed. + * Update a security group. * - * For this request to succeed, virtual server instances must not reside in this cluster network. + * This request updates a security group with the information provided in a security group patch object. The security + * group patch object is structured in the same way as a retrieved security group and contains only the information to + * be updated. * - * @param deleteClusterNetworkOptions the {@link DeleteClusterNetworkOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetwork} + * @param updateSecurityGroupOptions the {@link UpdateSecurityGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroup} */ - public ServiceCall deleteClusterNetwork(DeleteClusterNetworkOptions deleteClusterNetworkOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteClusterNetworkOptions, - "deleteClusterNetworkOptions cannot be null"); + public ServiceCall updateSecurityGroup(UpdateSecurityGroupOptions updateSecurityGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateSecurityGroupOptions, + "updateSecurityGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteClusterNetworkOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteClusterNetwork"); + pathParamsMap.put("id", updateSecurityGroupOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSecurityGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (deleteClusterNetworkOptions.ifMatch() != null) { - builder.header("If-Match", deleteClusterNetworkOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSecurityGroupOptions.securityGroupPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a cluster network. + * List rules in a security group. * - * This request retrieves a single cluster network specified by the identifier in the URL. + * This request lists rules in a security group. These rules define what traffic the security group permits. Security + * group rules are stateful, such that reverse traffic in response to allowed traffic is automatically permitted. * - * @param getClusterNetworkOptions the {@link GetClusterNetworkOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetwork} + * @param listSecurityGroupRulesOptions the {@link ListSecurityGroupRulesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupRuleCollection} */ - public ServiceCall getClusterNetwork(GetClusterNetworkOptions getClusterNetworkOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getClusterNetworkOptions, - "getClusterNetworkOptions cannot be null"); + public ServiceCall listSecurityGroupRules(ListSecurityGroupRulesOptions listSecurityGroupRulesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listSecurityGroupRulesOptions, + "listSecurityGroupRulesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getClusterNetworkOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getClusterNetwork"); + pathParamsMap.put("security_group_id", listSecurityGroupRulesOptions.securityGroupId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSecurityGroupRules"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a cluster. + * Create a rule for a security group. * - * This request updates a cluster network with the information provided in a cluster network patch object. The patch - * object is structured in the same way as a retrieved cluster network and needs to contain only the information to be - * updated. + * This request creates a new security group rule from a security group rule prototype object. The prototype object is + * structured in the same way as a retrieved security group rule and contains the information necessary to create the + * rule. As part of creating a new rule in a security group, the rule is applied to all the networking interfaces in + * the security group. Rules specify which IP traffic a security group will allow. Security group rules are stateful, + * such that reverse traffic in response to allowed traffic is automatically permitted. A rule allowing inbound TCP + * traffic on port 80 also allows outbound TCP traffic on port 80 without the need for an additional rule. * - * @param updateClusterNetworkOptions the {@link UpdateClusterNetworkOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ClusterNetwork} + * @param createSecurityGroupRuleOptions the {@link CreateSecurityGroupRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupRule} */ - public ServiceCall updateClusterNetwork(UpdateClusterNetworkOptions updateClusterNetworkOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateClusterNetworkOptions, - "updateClusterNetworkOptions cannot be null"); + public ServiceCall createSecurityGroupRule(CreateSecurityGroupRuleOptions createSecurityGroupRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createSecurityGroupRuleOptions, + "createSecurityGroupRuleOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateClusterNetworkOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/cluster_networks/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateClusterNetwork"); + pathParamsMap.put("security_group_id", createSecurityGroupRuleOptions.securityGroupId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSecurityGroupRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateClusterNetworkOptions.ifMatch() != null) { - builder.header("If-Match", updateClusterNetworkOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateClusterNetworkOptions.clusterNetworkPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createSecurityGroupRuleOptions.securityGroupRulePrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List public gateways. + * Delete a security group rule. * - * This request lists public gateways in the region. A public gateway is a virtual network device associated with a - * VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the - * same zone only. + * This request deletes a security group rule. This operation cannot be reversed. Removing a security group rule will + * not end existing connections allowed by that rule. * - * @param listPublicGatewaysOptions the {@link ListPublicGatewaysOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicGatewayCollection} + * @param deleteSecurityGroupRuleOptions the {@link DeleteSecurityGroupRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listPublicGateways(ListPublicGatewaysOptions listPublicGatewaysOptions) { - if (listPublicGatewaysOptions == null) { - listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPublicGateways"); + public ServiceCall deleteSecurityGroupRule(DeleteSecurityGroupRuleOptions deleteSecurityGroupRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSecurityGroupRuleOptions, + "deleteSecurityGroupRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("security_group_id", deleteSecurityGroupRuleOptions.securityGroupId()); + pathParamsMap.put("id", deleteSecurityGroupRuleOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSecurityGroupRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listPublicGatewaysOptions.start() != null) { - builder.query("start", String.valueOf(listPublicGatewaysOptions.start())); - } - if (listPublicGatewaysOptions.limit() != null) { - builder.query("limit", String.valueOf(listPublicGatewaysOptions.limit())); - } - if (listPublicGatewaysOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listPublicGatewaysOptions.resourceGroupId())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List public gateways. - * - * This request lists public gateways in the region. A public gateway is a virtual network device associated with a - * VPC, which allows access to the Internet. A public gateway resides in a zone and can be connected to subnets in the - * same zone only. - * - * @return a {@link ServiceCall} with a result of type {@link PublicGatewayCollection} - */ - public ServiceCall listPublicGateways() { - return listPublicGateways(null); - } - - /** - * Create a public gateway. - * - * This request creates a new public gateway from a public gateway prototype object. For this to succeed, the VPC must - * not already have a public gateway in the specified zone. + * Retrieve a security group rule. * - * If a floating IP is provided, it must be unbound. If a floating IP is not provided, one will be created and bound - * to the public gateway. Once a public gateway has been created, its floating IP cannot be unbound. A public gateway - * must be explicitly attached to each subnet it will provide connectivity for. + * This request retrieves a single security group rule specified by the identifier in the URL path. * - * @param createPublicGatewayOptions the {@link CreatePublicGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicGateway} + * @param getSecurityGroupRuleOptions the {@link GetSecurityGroupRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupRule} */ - public ServiceCall createPublicGateway(CreatePublicGatewayOptions createPublicGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createPublicGatewayOptions, - "createPublicGatewayOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPublicGateway"); + public ServiceCall getSecurityGroupRule(GetSecurityGroupRuleOptions getSecurityGroupRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSecurityGroupRuleOptions, + "getSecurityGroupRuleOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("security_group_id", getSecurityGroupRuleOptions.securityGroupId()); + pathParamsMap.put("id", getSecurityGroupRuleOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSecurityGroupRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicGatewayOptions.vpc())); - contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicGatewayOptions.zone())); - if (createPublicGatewayOptions.floatingIp() != null) { - contentJson.add("floating_ip", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicGatewayOptions.floatingIp())); - } - if (createPublicGatewayOptions.name() != null) { - contentJson.addProperty("name", createPublicGatewayOptions.name()); - } - if (createPublicGatewayOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicGatewayOptions.resourceGroup())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a public gateway. + * Update a security group rule. * - * This request deletes a public gateway. This operation cannot be reversed. For this request to succeed, the public - * gateway must not be attached to any subnets. The public gateway's floating IP will be automatically unbound. If the - * floating IP was created when the public gateway was created, it will be deleted. + * This request updates a security group rule with the information in a provided rule patch object. The rule patch + * object contains only the information to be updated. The request will fail if the provided patch includes properties + * that are not used by the rule's protocol. * - * @param deletePublicGatewayOptions the {@link DeletePublicGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param updateSecurityGroupRuleOptions the {@link UpdateSecurityGroupRuleOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupRule} */ - public ServiceCall deletePublicGateway(DeletePublicGatewayOptions deletePublicGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deletePublicGatewayOptions, - "deletePublicGatewayOptions cannot be null"); + public ServiceCall updateSecurityGroupRule(UpdateSecurityGroupRuleOptions updateSecurityGroupRuleOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateSecurityGroupRuleOptions, + "updateSecurityGroupRuleOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deletePublicGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePublicGateway"); + pathParamsMap.put("security_group_id", updateSecurityGroupRuleOptions.securityGroupId()); + pathParamsMap.put("id", updateSecurityGroupRuleOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSecurityGroupRule"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSecurityGroupRuleOptions.securityGroupRulePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a public gateway. + * List targets associated with a security group. * - * This request retrieves a single public gateway specified by the identifier in the URL. + * This request lists targets associated with a security group, to which the rules in the security group are applied. * - * @param getPublicGatewayOptions the {@link GetPublicGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicGateway} + * @param listSecurityGroupTargetsOptions the {@link ListSecurityGroupTargetsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupTargetCollection} */ - public ServiceCall getPublicGateway(GetPublicGatewayOptions getPublicGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getPublicGatewayOptions, - "getPublicGatewayOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getPublicGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPublicGateway"); + public ServiceCall listSecurityGroupTargets(ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listSecurityGroupTargetsOptions, + "listSecurityGroupTargetsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("security_group_id", listSecurityGroupTargetsOptions.securityGroupId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/targets", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSecurityGroupTargets"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listSecurityGroupTargetsOptions.start() != null) { + builder.query("start", String.valueOf(listSecurityGroupTargetsOptions.start())); + } + if (listSecurityGroupTargetsOptions.limit() != null) { + builder.query("limit", String.valueOf(listSecurityGroupTargetsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a public gateway. + * Remove a target from a security group. * - * This request updates a public gateway's name. + * This request removes a target from a security group. For this request to succeed, the target must be attached to at + * least one other security group. The specified target identifier can be: * - * @param updatePublicGatewayOptions the {@link UpdatePublicGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicGateway} + * - A bare metal server network interface identifier + * - A virtual network interface identifier + * - A VPN server identifier + * - A load balancer identifier + * - An endpoint gateway identifier + * - An instance network interface identifier + * + * Security groups are stateful, so any changes to a target's security groups are applied to new connections. Existing + * connections are not affected. + * + * @param deleteSecurityGroupTargetBindingOptions the {@link DeleteSecurityGroupTargetBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updatePublicGateway(UpdatePublicGatewayOptions updatePublicGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updatePublicGatewayOptions, - "updatePublicGatewayOptions cannot be null"); + public ServiceCall deleteSecurityGroupTargetBinding(DeleteSecurityGroupTargetBindingOptions deleteSecurityGroupTargetBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSecurityGroupTargetBindingOptions, + "deleteSecurityGroupTargetBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updatePublicGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePublicGateway"); + pathParamsMap.put("security_group_id", deleteSecurityGroupTargetBindingOptions.securityGroupId()); + pathParamsMap.put("id", deleteSecurityGroupTargetBindingOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/targets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSecurityGroupTargetBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePublicGatewayOptions.publicGatewayPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List floating IPs. + * Retrieve a security group target. * - * This request lists floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet to - * an instance. + * This request retrieves a single target specified by the identifier in the URL path. The target must be an existing + * target of the security group. * - * @param listFloatingIpsOptions the {@link ListFloatingIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIPCollection} + * @param getSecurityGroupTargetOptions the {@link GetSecurityGroupTargetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupTargetReference} */ - public ServiceCall listFloatingIps(ListFloatingIpsOptions listFloatingIpsOptions) { - if (listFloatingIpsOptions == null) { - listFloatingIpsOptions = new ListFloatingIpsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listFloatingIps"); + public ServiceCall getSecurityGroupTarget(GetSecurityGroupTargetOptions getSecurityGroupTargetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSecurityGroupTargetOptions, + "getSecurityGroupTargetOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("security_group_id", getSecurityGroupTargetOptions.securityGroupId()); + pathParamsMap.put("id", getSecurityGroupTargetOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/targets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSecurityGroupTarget"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listFloatingIpsOptions.start() != null) { - builder.query("start", String.valueOf(listFloatingIpsOptions.start())); - } - if (listFloatingIpsOptions.limit() != null) { - builder.query("limit", String.valueOf(listFloatingIpsOptions.limit())); - } - if (listFloatingIpsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listFloatingIpsOptions.resourceGroupId())); - } - if (listFloatingIpsOptions.sort() != null) { - builder.query("sort", String.valueOf(listFloatingIpsOptions.sort())); - } - if (listFloatingIpsOptions.targetId() != null) { - builder.query("target.id", String.valueOf(listFloatingIpsOptions.targetId())); - } - if (listFloatingIpsOptions.targetCrn() != null) { - builder.query("target.crn", String.valueOf(listFloatingIpsOptions.targetCrn())); - } - if (listFloatingIpsOptions.targetName() != null) { - builder.query("target.name", String.valueOf(listFloatingIpsOptions.targetName())); - } - if (listFloatingIpsOptions.targetResourceType() != null) { - builder.query("target.resource_type", String.valueOf(listFloatingIpsOptions.targetResourceType())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List floating IPs. + * Add a target to a security group. * - * This request lists floating IPs in the region. Floating IPs allow inbound and outbound traffic from the Internet to - * an instance. + * This request adds a resource to an existing security group. The specified target identifier can be: * - * @return a {@link ServiceCall} with a result of type {@link FloatingIPCollection} - */ - public ServiceCall listFloatingIps() { - return listFloatingIps(null); - } - - /** - * Reserve a floating IP. + * - A bare metal server network interface identifier + * - A virtual network interface identifier + * - A VPN server identifier + * - A load balancer identifier + * - An endpoint gateway identifier + * - An instance network interface identifier * - * This request reserves a new floating IP. + * When a target is added to a security group, the security group rules are applied to the target. A request body is + * not required, and if provided, is ignored. * - * @param createFloatingIpOptions the {@link CreateFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIP} + * @param createSecurityGroupTargetBindingOptions the {@link CreateSecurityGroupTargetBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SecurityGroupTargetReference} */ - public ServiceCall createFloatingIp(CreateFloatingIpOptions createFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createFloatingIpOptions, - "createFloatingIpOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createFloatingIp"); + public ServiceCall createSecurityGroupTargetBinding(CreateSecurityGroupTargetBindingOptions createSecurityGroupTargetBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createSecurityGroupTargetBindingOptions, + "createSecurityGroupTargetBindingOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("security_group_id", createSecurityGroupTargetBindingOptions.securityGroupId()); + pathParamsMap.put("id", createSecurityGroupTargetBindingOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/targets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSecurityGroupTargetBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createFloatingIpOptions.floatingIpPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a floating IP. + * List file share profiles. * - * This request disassociates (if associated) and releases a floating IP. This operation cannot be reversed. For this - * request to succeed, the floating IP must not be required by another resource, such as a public gateway. + * This request lists [file share profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) available + * in the region. A file share profile specifies the performance characteristics and pricing model for a file share. * - * @param deleteFloatingIpOptions the {@link DeleteFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listShareProfilesOptions the {@link ListShareProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareProfileCollection} */ - public ServiceCall deleteFloatingIp(DeleteFloatingIpOptions deleteFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteFloatingIpOptions, - "deleteFloatingIpOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteFloatingIp"); + public ServiceCall listShareProfiles(ListShareProfilesOptions listShareProfilesOptions) { + if (listShareProfilesOptions == null) { + listShareProfilesOptions = new ListShareProfilesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/share/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShareProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listShareProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listShareProfilesOptions.start())); + } + if (listShareProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listShareProfilesOptions.limit())); + } + if (listShareProfilesOptions.sort() != null) { + builder.query("sort", String.valueOf(listShareProfilesOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a floating IP. + * List file share profiles. * - * This request retrieves a single floating IP specified by the identifier in the URL. + * This request lists [file share profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) available + * in the region. A file share profile specifies the performance characteristics and pricing model for a file share. * - * @param getFloatingIpOptions the {@link GetFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIP} + * @return a {@link ServiceCall} with a result of type {@link ShareProfileCollection} */ - public ServiceCall getFloatingIp(GetFloatingIpOptions getFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getFloatingIpOptions, - "getFloatingIpOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getFloatingIp"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listShareProfiles() { + return listShareProfiles(null); } /** - * Update a floating IP. + * Retrieve a file share profile. * - * This request updates a floating IP's name and/or target. + * This request retrieves a single file share profile specified by the name in the URL. * - * @param updateFloatingIpOptions the {@link UpdateFloatingIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FloatingIP} + * @param getShareProfileOptions the {@link GetShareProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareProfile} */ - public ServiceCall updateFloatingIp(UpdateFloatingIpOptions updateFloatingIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateFloatingIpOptions, - "updateFloatingIpOptions cannot be null"); + public ServiceCall getShareProfile(GetShareProfileOptions getShareProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getShareProfileOptions, + "getShareProfileOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateFloatingIpOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/floating_ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateFloatingIp"); + pathParamsMap.put("name", getShareProfileOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/share/profiles/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareProfile"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateFloatingIpOptions.floatingIpPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List public address ranges. + * List file shares. * - * This request lists [public address ranges](https://cloud.ibm.com/docs/vpc?topic=vpc-about-par) in the region. A - * public address range is a contiguous block of public IP addresses that can be bound to a `target` that specifies a - * `vpc` and a `zone`. Incoming traffic for these IP addresses will be routed according to the VPC's ingress routing - * table. + * This request lists file shares in the region. * - * @param listPublicAddressRangesOptions the {@link ListPublicAddressRangesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicAddressRangeCollection} + * @param listSharesOptions the {@link ListSharesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareCollection} */ - public ServiceCall listPublicAddressRanges(ListPublicAddressRangesOptions listPublicAddressRangesOptions) { - if (listPublicAddressRangesOptions == null) { - listPublicAddressRangesOptions = new ListPublicAddressRangesOptions.Builder().build(); + public ServiceCall listShares(ListSharesOptions listSharesOptions) { + if (listSharesOptions == null) { + listSharesOptions = new ListSharesOptions.Builder().build(); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPublicAddressRanges"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShares"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listPublicAddressRangesOptions.start() != null) { - builder.query("start", String.valueOf(listPublicAddressRangesOptions.start())); + if (listSharesOptions.start() != null) { + builder.query("start", String.valueOf(listSharesOptions.start())); } - if (listPublicAddressRangesOptions.limit() != null) { - builder.query("limit", String.valueOf(listPublicAddressRangesOptions.limit())); + if (listSharesOptions.limit() != null) { + builder.query("limit", String.valueOf(listSharesOptions.limit())); } - if (listPublicAddressRangesOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listPublicAddressRangesOptions.resourceGroupId())); + if (listSharesOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listSharesOptions.resourceGroupId())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listSharesOptions.name() != null) { + builder.query("name", String.valueOf(listSharesOptions.name())); + } + if (listSharesOptions.sort() != null) { + builder.query("sort", String.valueOf(listSharesOptions.sort())); + } + if (listSharesOptions.replicationRole() != null) { + builder.query("replication_role", String.valueOf(listSharesOptions.replicationRole())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List public address ranges. + * List file shares. * - * This request lists [public address ranges](https://cloud.ibm.com/docs/vpc?topic=vpc-about-par) in the region. A - * public address range is a contiguous block of public IP addresses that can be bound to a `target` that specifies a - * `vpc` and a `zone`. Incoming traffic for these IP addresses will be routed according to the VPC's ingress routing - * table. + * This request lists file shares in the region. * - * @return a {@link ServiceCall} with a result of type {@link PublicAddressRangeCollection} + * @return a {@link ServiceCall} with a result of type {@link ShareCollection} */ - public ServiceCall listPublicAddressRanges() { - return listPublicAddressRanges(null); + public ServiceCall listShares() { + return listShares(null); } /** - * Create a public address range. + * Create a file share. * - * This request creates a new public address range from a public address range prototype object. The prototype object - * is structured in the same way as a retrieved public address range, and contains the information necessary to create - * the new public address range. + * This request provisions new file shares from a share prototype object. The new file shares can be a standalone + * share, a replica share, or both a source and replica share. * - * @param createPublicAddressRangeOptions the {@link CreatePublicAddressRangeOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicAddressRange} + * The prototype object is structured in the same way as a retrieved share, and contains the information necessary to + * provision the new file shares. + * + * @param createShareOptions the {@link CreateShareOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Share} */ - public ServiceCall createPublicAddressRange(CreatePublicAddressRangeOptions createPublicAddressRangeOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createPublicAddressRangeOptions, - "createPublicAddressRangeOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPublicAddressRange"); + public ServiceCall createShare(CreateShareOptions createShareOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createShareOptions, + "createShareOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createShare"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("ipv4_address_count", createPublicAddressRangeOptions.ipv4AddressCount()); - if (createPublicAddressRangeOptions.name() != null) { - contentJson.addProperty("name", createPublicAddressRangeOptions.name()); - } - if (createPublicAddressRangeOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicAddressRangeOptions.resourceGroup())); - } - if (createPublicAddressRangeOptions.target() != null) { - contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPublicAddressRangeOptions.target())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createShareOptions.sharePrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a public address range. + * Delete a file share. * - * This request deletes a public address range. If the public address range is bound to a - * `target`, it will be unbound. This operation cannot be reversed. + * This request deletes a share. This operation cannot be reversed. A share cannot be deleted if it: + * - has share mount targets + * - has a `lifecycle_state` of `updating` + * - has a replication operation in progress * - * @param deletePublicAddressRangeOptions the {@link DeletePublicAddressRangeOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicAddressRange} + * If the request is accepted, the share `lifecycle_state` will be set to `deleting`. Once deletion processing + * completes, it will no longer be retrievable. + * + * @param deleteShareOptions the {@link DeleteShareOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Share} */ - public ServiceCall deletePublicAddressRange(DeletePublicAddressRangeOptions deletePublicAddressRangeOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deletePublicAddressRangeOptions, - "deletePublicAddressRangeOptions cannot be null"); + public ServiceCall deleteShare(DeleteShareOptions deleteShareOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareOptions, + "deleteShareOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deletePublicAddressRangeOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePublicAddressRange"); + pathParamsMap.put("id", deleteShareOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShare"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (deleteShareOptions.ifMatch() != null) { + builder.header("If-Match", deleteShareOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a public address range. + * Retrieve a file share. * - * This request retrieves a single public address range specified by the identifier in the URL. + * This request retrieves a single file share specified by the identifier in the URL. * - * @param getPublicAddressRangeOptions the {@link GetPublicAddressRangeOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicAddressRange} + * @param getShareOptions the {@link GetShareOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Share} */ - public ServiceCall getPublicAddressRange(GetPublicAddressRangeOptions getPublicAddressRangeOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getPublicAddressRangeOptions, - "getPublicAddressRangeOptions cannot be null"); + public ServiceCall getShare(GetShareOptions getShareOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getShareOptions, + "getShareOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getPublicAddressRangeOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPublicAddressRange"); + pathParamsMap.put("id", getShareOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShare"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a public address range. + * Update a file share. * - * This request updates a public address range with the information in a provided public address range patch. The - * public address range patch object is structured in the same way as a retrieved public address range and contains - * only the information to be updated. + * This request updates a share with the information in a provided share patch. The share patch object is structured + * in the same way as a retrieved share and contains only the information to be updated. * - * @param updatePublicAddressRangeOptions the {@link UpdatePublicAddressRangeOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PublicAddressRange} + * @param updateShareOptions the {@link UpdateShareOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Share} */ - public ServiceCall updatePublicAddressRange(UpdatePublicAddressRangeOptions updatePublicAddressRangeOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updatePublicAddressRangeOptions, - "updatePublicAddressRangeOptions cannot be null"); + public ServiceCall updateShare(UpdateShareOptions updateShareOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateShareOptions, + "updateShareOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updatePublicAddressRangeOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/public_address_ranges/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePublicAddressRange"); + pathParamsMap.put("id", updateShareOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateShare"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateShareOptions.ifMatch() != null) { + builder.header("If-Match", updateShareOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePublicAddressRangeOptions.publicAddressRangePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateShareOptions.sharePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List network ACLs. + * List accessor bindings for a file share. * - * 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. + * This request lists accessor bindings for a share. Each accessor binding identifies a resource (possibly in another + * account) with access to this file share including its snapshots. * - * @param listNetworkAclsOptions the {@link ListNetworkAclsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection} + * The share accessor bindings will be sorted by their `created_at` property values, with newest bindings first. + * + * @param listShareAccessorBindingsOptions the {@link ListShareAccessorBindingsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareAccessorBindingCollection} */ - public ServiceCall listNetworkAcls(ListNetworkAclsOptions listNetworkAclsOptions) { - if (listNetworkAclsOptions == null) { - listNetworkAclsOptions = new ListNetworkAclsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listNetworkAcls"); + public ServiceCall listShareAccessorBindings(ListShareAccessorBindingsOptions listShareAccessorBindingsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listShareAccessorBindingsOptions, + "listShareAccessorBindingsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", listShareAccessorBindingsOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{id}/accessor_bindings", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShareAccessorBindings"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listNetworkAclsOptions.start() != null) { - builder.query("start", String.valueOf(listNetworkAclsOptions.start())); - } - if (listNetworkAclsOptions.limit() != null) { - builder.query("limit", String.valueOf(listNetworkAclsOptions.limit())); + if (listShareAccessorBindingsOptions.start() != null) { + builder.query("start", String.valueOf(listShareAccessorBindingsOptions.start())); } - if (listNetworkAclsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listNetworkAclsOptions.resourceGroupId())); + if (listShareAccessorBindingsOptions.limit() != null) { + builder.query("limit", String.valueOf(listShareAccessorBindingsOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List network ACLs. + * Delete a file share accessor binding. * - * 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. + * This request deletes a share accessor binding. This operation cannot be reversed. * - * @return a {@link ServiceCall} with a result of type {@link NetworkACLCollection} + * @param deleteShareAccessorBindingOptions the {@link DeleteShareAccessorBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listNetworkAcls() { - return listNetworkAcls(null); + public ServiceCall deleteShareAccessorBinding(DeleteShareAccessorBindingOptions deleteShareAccessorBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareAccessorBindingOptions, + "deleteShareAccessorBindingOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("share_id", deleteShareAccessorBindingOptions.shareId()); + pathParamsMap.put("id", deleteShareAccessorBindingOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/accessor_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShareAccessorBinding"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); } /** - * Create a network ACL. + * Retrieve a file share accessor binding. * - * This request creates a new stateless network ACL from a network ACL prototype object. The prototype object is - * structured in the same way as a retrieved network ACL, and contains the information necessary to create the new - * network ACL. + * This request retrieves a single accessor binding specified by the identifier in the URL. * - * @param createNetworkAclOptions the {@link CreateNetworkAclOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACL} + * @param getShareAccessorBindingOptions the {@link GetShareAccessorBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareAccessorBinding} */ - public ServiceCall createNetworkAcl(CreateNetworkAclOptions createNetworkAclOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createNetworkAclOptions, - "createNetworkAclOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createNetworkAcl"); + public ServiceCall getShareAccessorBinding(GetShareAccessorBindingOptions getShareAccessorBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getShareAccessorBindingOptions, + "getShareAccessorBindingOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("share_id", getShareAccessorBindingOptions.shareId()); + pathParamsMap.put("id", getShareAccessorBindingOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/accessor_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareAccessorBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createNetworkAclOptions.networkAclPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a network ACL. + * Failover to replica file share. * - * This request deletes a network ACL. This operation cannot be reversed. For this request to succeed, the network ACL - * must not be the default network ACL for any VPCs, and the network ACL must not be attached to any subnets. + * This request triggers a failover to the replica file share specified by the identifier in the URL. The failover + * cannot be started if a source share or the replica share has a `lifecycle_state` of `updating`, or has a + * replication operation in progress. * - * @param deleteNetworkAclOptions the {@link DeleteNetworkAclOptions} containing the options for the call + * If `fallback_policy` is specified as `split`, and the request is accepted but the failover operation cannot be + * performed, a split will be triggered. + * + * @param failoverShareOptions the {@link FailoverShareOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteNetworkAcl(DeleteNetworkAclOptions deleteNetworkAclOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteNetworkAclOptions, - "deleteNetworkAclOptions cannot be null"); + public ServiceCall failoverShare(FailoverShareOptions failoverShareOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(failoverShareOptions, + "failoverShareOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteNetworkAclOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteNetworkAcl"); + pathParamsMap.put("share_id", failoverShareOptions.shareId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/failover", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "failoverShare"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); + final JsonObject contentJson = new JsonObject(); + if (failoverShareOptions.fallbackPolicy() != null) { + contentJson.addProperty("fallback_policy", failoverShareOptions.fallbackPolicy()); + } + if (failoverShareOptions.timeout() != null) { + contentJson.addProperty("timeout", failoverShareOptions.timeout()); + } + builder.bodyJson(contentJson); ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a network ACL. + * List mount targets for a file share. * - * This request retrieves a single network ACL specified by the identifier in the URL. + * This request lists mount targets for a file share. A mount target is a network endpoint at which a file share may + * be mounted. The file share can be mounted by clients in the same VPC and zone after creating share mount targets. * - * @param getNetworkAclOptions the {@link GetNetworkAclOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACL} + * The share mount targets will be sorted by their `created_at` property values, with newest targets first. + * + * @param listShareMountTargetsOptions the {@link ListShareMountTargetsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareMountTargetCollection} */ - public ServiceCall getNetworkAcl(GetNetworkAclOptions getNetworkAclOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getNetworkAclOptions, - "getNetworkAclOptions cannot be null"); + public ServiceCall listShareMountTargets(ListShareMountTargetsOptions listShareMountTargetsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listShareMountTargetsOptions, + "listShareMountTargetsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getNetworkAclOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getNetworkAcl"); + pathParamsMap.put("share_id", listShareMountTargetsOptions.shareId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShareMountTargets"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listShareMountTargetsOptions.name() != null) { + builder.query("name", String.valueOf(listShareMountTargetsOptions.name())); + } + if (listShareMountTargetsOptions.start() != null) { + builder.query("start", String.valueOf(listShareMountTargetsOptions.start())); + } + if (listShareMountTargetsOptions.limit() != null) { + builder.query("limit", String.valueOf(listShareMountTargetsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a network ACL. + * Create a mount target for a file share. * - * This request updates a network ACL's name. + * This request creates a new share mount target from a share mount target prototype object. * - * @param updateNetworkAclOptions the {@link UpdateNetworkAclOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACL} + * The prototype object is structured in the same way as a retrieved share mount target, and contains the information + * necessary to provision the new file share mount target. + * + * @param createShareMountTargetOptions the {@link CreateShareMountTargetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareMountTarget} */ - public ServiceCall updateNetworkAcl(UpdateNetworkAclOptions updateNetworkAclOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateNetworkAclOptions, - "updateNetworkAclOptions cannot be null"); + public ServiceCall createShareMountTarget(CreateShareMountTargetOptions createShareMountTargetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createShareMountTargetOptions, + "createShareMountTargetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateNetworkAclOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateNetworkAcl"); + pathParamsMap.put("share_id", createShareMountTargetOptions.shareId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createShareMountTarget"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateNetworkAclOptions.networkAclPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createShareMountTargetOptions.shareMountTargetPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List rules for a network ACL. + * Delete a file share mount target. * - * This request lists rules for a network ACL. These rules can allow or deny traffic between a source CIDR block and a - * destination CIDR block over a particular protocol and port range. + * This request deletes a share mount target. This operation cannot be reversed. * - * @param listNetworkAclRulesOptions the {@link ListNetworkAclRulesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACLRuleCollection} + * If the request is accepted, the share mount target `lifecycle_state` will be set to + * `deleting`. Once deletion processing completes, it will no longer be retrievable. + * + * @param deleteShareMountTargetOptions the {@link DeleteShareMountTargetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareMountTarget} */ - public ServiceCall listNetworkAclRules(ListNetworkAclRulesOptions listNetworkAclRulesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listNetworkAclRulesOptions, - "listNetworkAclRulesOptions cannot be null"); + public ServiceCall deleteShareMountTarget(DeleteShareMountTargetOptions deleteShareMountTargetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareMountTargetOptions, + "deleteShareMountTargetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("network_acl_id", listNetworkAclRulesOptions.networkAclId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listNetworkAclRules"); + pathParamsMap.put("share_id", deleteShareMountTargetOptions.shareId()); + pathParamsMap.put("id", deleteShareMountTargetOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShareMountTarget"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listNetworkAclRulesOptions.start() != null) { - builder.query("start", String.valueOf(listNetworkAclRulesOptions.start())); - } - if (listNetworkAclRulesOptions.limit() != null) { - builder.query("limit", String.valueOf(listNetworkAclRulesOptions.limit())); - } - if (listNetworkAclRulesOptions.direction() != null) { - builder.query("direction", String.valueOf(listNetworkAclRulesOptions.direction())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a rule for a network ACL. + * Retrieve a file share mount target. * - * This request creates a new rule from a network ACL rule prototype object. The prototype object is structured in the - * same way as a retrieved rule, and contains the information necessary to create the new rule. + * This request retrieves a single share mount target specified by the identifier in the URL. * - * @param createNetworkAclRuleOptions the {@link CreateNetworkAclRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACLRule} + * @param getShareMountTargetOptions the {@link GetShareMountTargetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareMountTarget} */ - public ServiceCall createNetworkAclRule(CreateNetworkAclRuleOptions createNetworkAclRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createNetworkAclRuleOptions, - "createNetworkAclRuleOptions cannot be null"); + public ServiceCall getShareMountTarget(GetShareMountTargetOptions getShareMountTargetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getShareMountTargetOptions, + "getShareMountTargetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("network_acl_id", createNetworkAclRuleOptions.networkAclId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createNetworkAclRule"); + pathParamsMap.put("share_id", getShareMountTargetOptions.shareId()); + pathParamsMap.put("id", getShareMountTargetOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareMountTarget"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createNetworkAclRuleOptions.networkAclRulePrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a network ACL rule. + * Update a file share mount target. * - * This request deletes a rule. This operation cannot be reversed. + * This request updates a share mount target with the information provided in a share mount target patch object. The + * share mount target patch object is structured in the same way as a retrieved share mount target and needs to + * contain only the information to be updated. * - * @param deleteNetworkAclRuleOptions the {@link DeleteNetworkAclRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param updateShareMountTargetOptions the {@link UpdateShareMountTargetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareMountTarget} */ - public ServiceCall deleteNetworkAclRule(DeleteNetworkAclRuleOptions deleteNetworkAclRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteNetworkAclRuleOptions, - "deleteNetworkAclRuleOptions cannot be null"); + public ServiceCall updateShareMountTarget(UpdateShareMountTargetOptions updateShareMountTargetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateShareMountTargetOptions, + "updateShareMountTargetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("network_acl_id", deleteNetworkAclRuleOptions.networkAclId()); - pathParamsMap.put("id", deleteNetworkAclRuleOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteNetworkAclRule"); + pathParamsMap.put("share_id", updateShareMountTargetOptions.shareId()); + pathParamsMap.put("id", updateShareMountTargetOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/mount_targets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateShareMountTarget"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateShareMountTargetOptions.shareMountTargetPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a network ACL rule. + * List file share snapshots. * - * This request retrieves a single rule specified by the identifier in the URL. + * This request lists snapshots for the specified file share, or across all accessible file shares. A snapshot + * preserves the data of a share at the time the snapshot was captured. * - * @param getNetworkAclRuleOptions the {@link GetNetworkAclRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACLRule} + * If the file share is a replica, the list will contain snapshots corresponding to snapshots on the source. + * + * @param listShareSnapshotsOptions the {@link ListShareSnapshotsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareSnapshotCollection} */ - public ServiceCall getNetworkAclRule(GetNetworkAclRuleOptions getNetworkAclRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getNetworkAclRuleOptions, - "getNetworkAclRuleOptions cannot be null"); + public ServiceCall listShareSnapshots(ListShareSnapshotsOptions listShareSnapshotsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listShareSnapshotsOptions, + "listShareSnapshotsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("network_acl_id", getNetworkAclRuleOptions.networkAclId()); - pathParamsMap.put("id", getNetworkAclRuleOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getNetworkAclRule"); + pathParamsMap.put("share_id", listShareSnapshotsOptions.shareId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listShareSnapshots"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listShareSnapshotsOptions.backupPolicyPlanId() != null) { + builder.query("backup_policy_plan.id", String.valueOf(listShareSnapshotsOptions.backupPolicyPlanId())); + } + if (listShareSnapshotsOptions.name() != null) { + builder.query("name", String.valueOf(listShareSnapshotsOptions.name())); + } + if (listShareSnapshotsOptions.start() != null) { + builder.query("start", String.valueOf(listShareSnapshotsOptions.start())); + } + if (listShareSnapshotsOptions.limit() != null) { + builder.query("limit", String.valueOf(listShareSnapshotsOptions.limit())); + } + if (listShareSnapshotsOptions.sort() != null) { + builder.query("sort", String.valueOf(listShareSnapshotsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a network ACL rule. + * Create a snapshot for a file share. * - * This request updates a rule with the information in a provided rule patch. The rule patch object contains only the - * information to be updated. The request will fail if the provided patch includes properties that are not used by the - * rule's protocol. + * This request creates a new share snapshot from a share snapshot prototype object. The prototype object is + * structured in the same way as a retrieved share snapshot, and contains the information necessary to create the new + * share snapshot. * - * @param updateNetworkAclRuleOptions the {@link UpdateNetworkAclRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link NetworkACLRule} - */ - public ServiceCall updateNetworkAclRule(UpdateNetworkAclRuleOptions updateNetworkAclRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateNetworkAclRuleOptions, - "updateNetworkAclRuleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("network_acl_id", updateNetworkAclRuleOptions.networkAclId()); - pathParamsMap.put("id", updateNetworkAclRuleOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/network_acls/{network_acl_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateNetworkAclRule"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateNetworkAclRuleOptions.networkAclRulePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List security groups. + * The share must have an `access_control_mode` of `security_group`, and a + * `replication_role` of `source` or `none`. * - * 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. + * The snapshot will inherit its `resource_group` and encryption settings from the share. * - * @param listSecurityGroupsOptions the {@link ListSecurityGroupsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection} + * 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 + * `pending` until the data is synchronized per the replication schedule determined by the replica share's + * `replication_cron_spec`. + * + * @param createShareSnapshotOptions the {@link CreateShareSnapshotOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareSnapshot} */ - public ServiceCall listSecurityGroups(ListSecurityGroupsOptions listSecurityGroupsOptions) { - if (listSecurityGroupsOptions == null) { - listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSecurityGroups"); + public ServiceCall createShareSnapshot(CreateShareSnapshotOptions createShareSnapshotOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createShareSnapshotOptions, + "createShareSnapshotOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("share_id", createShareSnapshotOptions.shareId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createShareSnapshot"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listSecurityGroupsOptions.start() != null) { - builder.query("start", String.valueOf(listSecurityGroupsOptions.start())); - } - if (listSecurityGroupsOptions.limit() != null) { - builder.query("limit", String.valueOf(listSecurityGroupsOptions.limit())); - } - if (listSecurityGroupsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listSecurityGroupsOptions.resourceGroupId())); - } - if (listSecurityGroupsOptions.vpcId() != null) { - builder.query("vpc.id", String.valueOf(listSecurityGroupsOptions.vpcId())); - } - if (listSecurityGroupsOptions.vpcCrn() != null) { - builder.query("vpc.crn", String.valueOf(listSecurityGroupsOptions.vpcCrn())); + final JsonObject contentJson = new JsonObject(); + if (createShareSnapshotOptions.name() != null) { + contentJson.addProperty("name", createShareSnapshotOptions.name()); } - if (listSecurityGroupsOptions.vpcName() != null) { - builder.query("vpc.name", String.valueOf(listSecurityGroupsOptions.vpcName())); + if (createShareSnapshotOptions.userTags() != null) { + contentJson.add("user_tags", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createShareSnapshotOptions.userTags())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List security groups. + * Delete a share snapshot. * - * 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. + * This request deletes a share snapshot. This operation cannot be reversed. For this request to succeed, the share + * must have a `replication_role` of `source` or `none`. * - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupCollection} - */ - public ServiceCall listSecurityGroups() { - return listSecurityGroups(null); - } - - /** - * Create a security group. + * If the request is accepted, the share snapshot `lifecycle_state` will be set to + * `deleting`. Once deletion processing completes, the share snapshot will no longer be retrievable. * - * This request creates a new security group from a security group prototype object. The prototype object is - * structured in the same way as a retrieved security group, and contains the information necessary to create the new - * security group. If security group rules are included in the prototype object, those rules will be added to the - * security group. Each security group is scoped to one VPC. Only resources in that VPC can be added to the security - * group. + * Deleting a share snapshot will not affect any previously-accepted requests to create a share from it. * - * @param createSecurityGroupOptions the {@link CreateSecurityGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroup} + * If the share has a `replication_role` of `source`, the corresponding snapshot on the replica share will be + * subsequently moved to a `lifecycle_state` of `deleting`. If the data for the corresponding snapshot has already + * been synchronized via the replication schedule determined by `replication_cron_spec`, the snapshot will remain + * available in the replica share's `.snapshot` directory until the next replication sync. + * + * @param deleteShareSnapshotOptions the {@link DeleteShareSnapshotOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareSnapshot} */ - public ServiceCall createSecurityGroup(CreateSecurityGroupOptions createSecurityGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createSecurityGroupOptions, - "createSecurityGroupOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSecurityGroup"); + public ServiceCall deleteShareSnapshot(DeleteShareSnapshotOptions deleteShareSnapshotOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareSnapshotOptions, + "deleteShareSnapshotOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("share_id", deleteShareSnapshotOptions.shareId()); + pathParamsMap.put("id", deleteShareSnapshotOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShareSnapshot"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createSecurityGroupOptions.vpc())); - if (createSecurityGroupOptions.name() != null) { - contentJson.addProperty("name", createSecurityGroupOptions.name()); - } - if (createSecurityGroupOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createSecurityGroupOptions.resourceGroup())); - } - if (createSecurityGroupOptions.rules() != null) { - contentJson.add("rules", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createSecurityGroupOptions.rules())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a security group. + * Retrieve a share snapshot. * - * This request deletes a security group. A security group cannot be deleted if it is referenced by any security group - * targets or rules. Additionally, a VPC's default security group cannot be deleted. This operation cannot be - * reversed. + * This request retrieves a single share snapshot specified by the identifier in the URL. * - * @param deleteSecurityGroupOptions the {@link DeleteSecurityGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getShareSnapshotOptions the {@link GetShareSnapshotOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareSnapshot} */ - public ServiceCall deleteSecurityGroup(DeleteSecurityGroupOptions deleteSecurityGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSecurityGroupOptions, - "deleteSecurityGroupOptions cannot be null"); + public ServiceCall getShareSnapshot(GetShareSnapshotOptions getShareSnapshotOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getShareSnapshotOptions, + "getShareSnapshotOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteSecurityGroupOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSecurityGroup"); + pathParamsMap.put("share_id", getShareSnapshotOptions.shareId()); + pathParamsMap.put("id", getShareSnapshotOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareSnapshot"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a security group. + * Update a share snapshot. * - * This request retrieves a single security group specified by the identifier in the URL path. + * This request updates a share snapshot with the information provided in a share snapshot patch object. The share + * snapshot patch object is structured in the same way as a retrieved share snapshot and needs to contain only the + * information to be updated. * - * @param getSecurityGroupOptions the {@link GetSecurityGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroup} + * @param updateShareSnapshotOptions the {@link UpdateShareSnapshotOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareSnapshot} */ - public ServiceCall getSecurityGroup(GetSecurityGroupOptions getSecurityGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSecurityGroupOptions, - "getSecurityGroupOptions cannot be null"); + public ServiceCall updateShareSnapshot(UpdateShareSnapshotOptions updateShareSnapshotOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateShareSnapshotOptions, + "updateShareSnapshotOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getSecurityGroupOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSecurityGroup"); + pathParamsMap.put("share_id", updateShareSnapshotOptions.shareId()); + pathParamsMap.put("id", updateShareSnapshotOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/snapshots/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateShareSnapshot"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateShareSnapshotOptions.ifMatch() != null) { + builder.header("If-Match", updateShareSnapshotOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateShareSnapshotOptions.shareSnapshotPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a security group. + * Split the source file share from a replica file share. * - * This request updates a security group with the information provided in a security group patch object. The security - * group patch object is structured in the same way as a retrieved security group and contains only the information to - * be updated. + * This request removes the replication relationship between a source share and the replica share specified by the + * identifier in the URL. The replication relationship cannot be removed if a source share or the replica share has a + * `lifecycle_state` of `updating`, or has a replication operation in progress. * - * @param updateSecurityGroupOptions the {@link UpdateSecurityGroupOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroup} + * This operation cannot be reversed. + * + * @param deleteShareSourceOptions the {@link DeleteShareSourceOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updateSecurityGroup(UpdateSecurityGroupOptions updateSecurityGroupOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateSecurityGroupOptions, - "updateSecurityGroupOptions cannot be null"); + public ServiceCall deleteShareSource(DeleteShareSourceOptions deleteShareSourceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteShareSourceOptions, + "deleteShareSourceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateSecurityGroupOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSecurityGroup"); + pathParamsMap.put("share_id", deleteShareSourceOptions.shareId()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/source", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteShareSource"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSecurityGroupOptions.securityGroupPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List rules in a security group. + * Retrieve the source file share for a replica file share. * - * This request lists rules in a security group. These rules define what traffic the security group permits. Security - * group rules are stateful, such that reverse traffic in response to allowed traffic is automatically permitted. + * This request retrieves the source file share associated with the replica file share specified by the identifier in + * the URL. * - * @param listSecurityGroupRulesOptions the {@link ListSecurityGroupRulesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupRuleCollection} + * @param getShareSourceOptions the {@link GetShareSourceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ShareReference} */ - public ServiceCall listSecurityGroupRules(ListSecurityGroupRulesOptions listSecurityGroupRulesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listSecurityGroupRulesOptions, - "listSecurityGroupRulesOptions cannot be null"); + public ServiceCall getShareSource(GetShareSourceOptions getShareSourceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getShareSourceOptions, + "getShareSourceOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", listSecurityGroupRulesOptions.securityGroupId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSecurityGroupRules"); + pathParamsMap.put("share_id", getShareSourceOptions.shareId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/shares/{share_id}/source", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getShareSource"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a rule for a security group. + * List snapshot consistency groups. * - * This request creates a new security group rule from a security group rule prototype object. The prototype object is - * structured in the same way as a retrieved security group rule and contains the information necessary to create the - * rule. As part of creating a new rule in a security group, the rule is applied to all the networking interfaces in - * the security group. Rules specify which IP traffic a security group will allow. Security group rules are stateful, - * such that reverse traffic in response to allowed traffic is automatically permitted. A rule allowing inbound TCP - * traffic on port 80 also allows outbound TCP traffic on port 80 without the need for an additional rule. + * This request lists snapshot consistency groups in the region. A snapshot consistency group is a collection of + * individual snapshots taken at the same time. * - * @param createSecurityGroupRuleOptions the {@link CreateSecurityGroupRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupRule} + * @param listSnapshotConsistencyGroupsOptions the {@link ListSnapshotConsistencyGroupsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroupCollection} */ - public ServiceCall createSecurityGroupRule(CreateSecurityGroupRuleOptions createSecurityGroupRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createSecurityGroupRuleOptions, - "createSecurityGroupRuleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", createSecurityGroupRuleOptions.securityGroupId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSecurityGroupRule"); + public ServiceCall listSnapshotConsistencyGroups(ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptions) { + if (listSnapshotConsistencyGroupsOptions == null) { + listSnapshotConsistencyGroupsOptions = new ListSnapshotConsistencyGroupsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSnapshotConsistencyGroups"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createSecurityGroupRuleOptions.securityGroupRulePrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listSnapshotConsistencyGroupsOptions.start() != null) { + builder.query("start", String.valueOf(listSnapshotConsistencyGroupsOptions.start())); + } + if (listSnapshotConsistencyGroupsOptions.limit() != null) { + builder.query("limit", String.valueOf(listSnapshotConsistencyGroupsOptions.limit())); + } + if (listSnapshotConsistencyGroupsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listSnapshotConsistencyGroupsOptions.resourceGroupId())); + } + if (listSnapshotConsistencyGroupsOptions.name() != null) { + builder.query("name", String.valueOf(listSnapshotConsistencyGroupsOptions.name())); + } + if (listSnapshotConsistencyGroupsOptions.sort() != null) { + builder.query("sort", String.valueOf(listSnapshotConsistencyGroupsOptions.sort())); + } + if (listSnapshotConsistencyGroupsOptions.backupPolicyPlanId() != null) { + builder.query("backup_policy_plan.id", String.valueOf(listSnapshotConsistencyGroupsOptions.backupPolicyPlanId())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a security group rule. + * List snapshot consistency groups. * - * This request deletes a security group rule. This operation cannot be reversed. Removing a security group rule will - * not end existing connections allowed by that rule. + * This request lists snapshot consistency groups in the region. A snapshot consistency group is a collection of + * individual snapshots taken at the same time. * - * @param deleteSecurityGroupRuleOptions the {@link DeleteSecurityGroupRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroupCollection} */ - public ServiceCall deleteSecurityGroupRule(DeleteSecurityGroupRuleOptions deleteSecurityGroupRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSecurityGroupRuleOptions, - "deleteSecurityGroupRuleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", deleteSecurityGroupRuleOptions.securityGroupId()); - pathParamsMap.put("id", deleteSecurityGroupRuleOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSecurityGroupRule"); + public ServiceCall listSnapshotConsistencyGroups() { + return listSnapshotConsistencyGroups(null); + } + + /** + * Create a snapshot consistency group. + * + * This request creates a new snapshot consistency group from a snapshot consistency group object. The prototype + * object is structured in the same way as a retrieved consistency group, and contains the information necessary to + * provision the new snapshot consistency group. + * + * @param createSnapshotConsistencyGroupOptions the {@link CreateSnapshotConsistencyGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroup} + */ + public ServiceCall createSnapshotConsistencyGroup(CreateSnapshotConsistencyGroupOptions createSnapshotConsistencyGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createSnapshotConsistencyGroupOptions, + "createSnapshotConsistencyGroupOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSnapshotConsistencyGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createSnapshotConsistencyGroupOptions.snapshotConsistencyGroupPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a security group rule. + * Delete a snapshot consistency group. * - * This request retrieves a single security group rule specified by the identifier in the URL path. + * This request deletes snapshot consistency group. This operation cannot be reversed. If the + * `delete_snapshots_on_delete` property is `true`, all snapshots in the consistency group will also be deleted. * - * @param getSecurityGroupRuleOptions the {@link GetSecurityGroupRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupRule} + * @param deleteSnapshotConsistencyGroupOptions the {@link DeleteSnapshotConsistencyGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroup} */ - public ServiceCall getSecurityGroupRule(GetSecurityGroupRuleOptions getSecurityGroupRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSecurityGroupRuleOptions, - "getSecurityGroupRuleOptions cannot be null"); + public ServiceCall deleteSnapshotConsistencyGroup(DeleteSnapshotConsistencyGroupOptions deleteSnapshotConsistencyGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotConsistencyGroupOptions, + "deleteSnapshotConsistencyGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", getSecurityGroupRuleOptions.securityGroupId()); - pathParamsMap.put("id", getSecurityGroupRuleOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSecurityGroupRule"); + pathParamsMap.put("id", deleteSnapshotConsistencyGroupOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSnapshotConsistencyGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a security group rule. + * Retrieve a snapshot consistency group. * - * This request updates a security group rule with the information in a provided rule patch object. The rule patch - * object contains only the information to be updated. The request will fail if the provided patch includes properties - * that are not used by the rule's protocol. + * This request retrieves a single snapshot consistency group specified by the identifier in the URL. * - * @param updateSecurityGroupRuleOptions the {@link UpdateSecurityGroupRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupRule} + * @param getSnapshotConsistencyGroupOptions the {@link GetSnapshotConsistencyGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroup} */ - public ServiceCall updateSecurityGroupRule(UpdateSecurityGroupRuleOptions updateSecurityGroupRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateSecurityGroupRuleOptions, - "updateSecurityGroupRuleOptions cannot be null"); + public ServiceCall getSnapshotConsistencyGroup(GetSnapshotConsistencyGroupOptions getSnapshotConsistencyGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSnapshotConsistencyGroupOptions, + "getSnapshotConsistencyGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", updateSecurityGroupRuleOptions.securityGroupId()); - pathParamsMap.put("id", updateSecurityGroupRuleOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSecurityGroupRule"); + pathParamsMap.put("id", getSnapshotConsistencyGroupOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSnapshotConsistencyGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSecurityGroupRuleOptions.securityGroupRulePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List targets associated with a security group. + * Update a snapshot consistency group. * - * This request lists targets associated with a security group, to which the rules in the security group are applied. + * This request updates a snapshot consistency group with the information in a provided snapshot consistency group + * patch. The snapshot consistency group patch object is structured in the same way as a retrieved snapshot + * consistency group and contains only the information to be updated. * - * @param listSecurityGroupTargetsOptions the {@link ListSecurityGroupTargetsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupTargetCollection} + * @param updateSnapshotConsistencyGroupOptions the {@link UpdateSnapshotConsistencyGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotConsistencyGroup} */ - public ServiceCall listSecurityGroupTargets(ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listSecurityGroupTargetsOptions, - "listSecurityGroupTargetsOptions cannot be null"); + public ServiceCall updateSnapshotConsistencyGroup(UpdateSnapshotConsistencyGroupOptions updateSnapshotConsistencyGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateSnapshotConsistencyGroupOptions, + "updateSnapshotConsistencyGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", listSecurityGroupTargetsOptions.securityGroupId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/targets", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSecurityGroupTargets"); + pathParamsMap.put("id", updateSnapshotConsistencyGroupOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshot_consistency_groups/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSnapshotConsistencyGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateSnapshotConsistencyGroupOptions.ifMatch() != null) { + builder.header("If-Match", updateSnapshotConsistencyGroupOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listSecurityGroupTargetsOptions.start() != null) { - builder.query("start", String.valueOf(listSecurityGroupTargetsOptions.start())); - } - if (listSecurityGroupTargetsOptions.limit() != null) { - builder.query("limit", String.valueOf(listSecurityGroupTargetsOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSnapshotConsistencyGroupOptions.snapshotConsistencyGroupPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Remove a target from a security group. - * - * This request removes a target from a security group. For this request to succeed, the target must be attached to at - * least one other security group. The specified target identifier can be: - * - * - A bare metal server network interface identifier - * - A virtual network interface identifier - * - A VPN server identifier - * - A load balancer identifier - * - An endpoint gateway identifier - * - An instance network interface identifier + * Delete a filtered collection of snapshots. * - * Security groups are stateful, so any changes to a target's security groups are applied to new connections. Existing - * connections are not affected. + * This request deletes snapshots that match the specified filter. This operation cannot be reversed. * - * @param deleteSecurityGroupTargetBindingOptions the {@link DeleteSecurityGroupTargetBindingOptions} containing the options for the call + * @param deleteSnapshotsOptions the {@link DeleteSnapshotsOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteSecurityGroupTargetBinding(DeleteSecurityGroupTargetBindingOptions deleteSecurityGroupTargetBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSecurityGroupTargetBindingOptions, - "deleteSecurityGroupTargetBindingOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", deleteSecurityGroupTargetBindingOptions.securityGroupId()); - pathParamsMap.put("id", deleteSecurityGroupTargetBindingOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/targets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSecurityGroupTargetBinding"); + public ServiceCall deleteSnapshots(DeleteSnapshotsOptions deleteSnapshotsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotsOptions, + "deleteSnapshotsOptions cannot be null"); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSnapshots"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); + builder.query("source_volume.id", String.valueOf(deleteSnapshotsOptions.sourceVolumeId())); ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a security group target. + * List snapshots. * - * This request retrieves a single target specified by the identifier in the URL path. The target must be an existing - * target of the security group. + * This request lists snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is + * created. * - * @param getSecurityGroupTargetOptions the {@link GetSecurityGroupTargetOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupTargetReference} + * @param listSnapshotsOptions the {@link ListSnapshotsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotCollection} */ - public ServiceCall getSecurityGroupTarget(GetSecurityGroupTargetOptions getSecurityGroupTargetOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getSecurityGroupTargetOptions, - "getSecurityGroupTargetOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", getSecurityGroupTargetOptions.securityGroupId()); - pathParamsMap.put("id", getSecurityGroupTargetOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/targets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSecurityGroupTarget"); + public ServiceCall listSnapshots(ListSnapshotsOptions listSnapshotsOptions) { + if (listSnapshotsOptions == null) { + listSnapshotsOptions = new ListSnapshotsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSnapshots"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Add a target to a security group. - * - * This request adds a resource to an existing security group. The specified target identifier can be: - * - * - A bare metal server network interface identifier - * - A virtual network interface identifier - * - A VPN server identifier - * - A load balancer identifier - * - An endpoint gateway identifier - * - An instance network interface identifier - * - * When a target is added to a security group, the security group rules are applied to the target. A request body is - * not required, and if provided, is ignored. - * - * @param createSecurityGroupTargetBindingOptions the {@link CreateSecurityGroupTargetBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link SecurityGroupTargetReference} - */ - public ServiceCall createSecurityGroupTargetBinding(CreateSecurityGroupTargetBindingOptions createSecurityGroupTargetBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createSecurityGroupTargetBindingOptions, - "createSecurityGroupTargetBindingOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("security_group_id", createSecurityGroupTargetBindingOptions.securityGroupId()); - pathParamsMap.put("id", createSecurityGroupTargetBindingOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/security_groups/{security_group_id}/targets/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSecurityGroupTargetBinding"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); + if (listSnapshotsOptions.start() != null) { + builder.query("start", String.valueOf(listSnapshotsOptions.start())); } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List IKE policies. - * - * This request lists IKE policies in the region. - * - * @param listIkePoliciesOptions the {@link ListIkePoliciesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IKEPolicyCollection} - */ - public ServiceCall listIkePolicies(ListIkePoliciesOptions listIkePoliciesOptions) { - if (listIkePoliciesOptions == null) { - listIkePoliciesOptions = new ListIkePoliciesOptions.Builder().build(); + if (listSnapshotsOptions.limit() != null) { + builder.query("limit", String.valueOf(listSnapshotsOptions.limit())); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listIkePolicies"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); + if (listSnapshotsOptions.tag() != null) { + builder.query("tag", String.valueOf(listSnapshotsOptions.tag())); } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - if (listIkePoliciesOptions.start() != null) { - builder.query("start", String.valueOf(listIkePoliciesOptions.start())); + if (listSnapshotsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listSnapshotsOptions.resourceGroupId())); } - if (listIkePoliciesOptions.limit() != null) { - builder.query("limit", String.valueOf(listIkePoliciesOptions.limit())); + if (listSnapshotsOptions.name() != null) { + builder.query("name", String.valueOf(listSnapshotsOptions.name())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listSnapshotsOptions.sourceVolumeId() != null) { + builder.query("source_volume.id", String.valueOf(listSnapshotsOptions.sourceVolumeId())); + } + if (listSnapshotsOptions.sourceVolumeCrn() != null) { + builder.query("source_volume.crn", String.valueOf(listSnapshotsOptions.sourceVolumeCrn())); + } + if (listSnapshotsOptions.sourceImageId() != null) { + builder.query("source_image.id", String.valueOf(listSnapshotsOptions.sourceImageId())); + } + if (listSnapshotsOptions.sourceImageCrn() != null) { + builder.query("source_image.crn", String.valueOf(listSnapshotsOptions.sourceImageCrn())); + } + if (listSnapshotsOptions.sort() != null) { + builder.query("sort", String.valueOf(listSnapshotsOptions.sort())); + } + if (listSnapshotsOptions.backupPolicyPlanId() != null) { + builder.query("backup_policy_plan.id", String.valueOf(listSnapshotsOptions.backupPolicyPlanId())); + } + if (listSnapshotsOptions.copiesId() != null) { + builder.query("copies[].id", String.valueOf(listSnapshotsOptions.copiesId())); + } + if (listSnapshotsOptions.copiesName() != null) { + builder.query("copies[].name", String.valueOf(listSnapshotsOptions.copiesName())); + } + if (listSnapshotsOptions.copiesCrn() != null) { + builder.query("copies[].crn", String.valueOf(listSnapshotsOptions.copiesCrn())); + } + if (listSnapshotsOptions.copiesRemoteRegionName() != null) { + builder.query("copies[].remote.region.name", String.valueOf(listSnapshotsOptions.copiesRemoteRegionName())); + } + if (listSnapshotsOptions.sourceSnapshotId() != null) { + builder.query("source_snapshot.id", String.valueOf(listSnapshotsOptions.sourceSnapshotId())); + } + if (listSnapshotsOptions.sourceSnapshotRemoteRegionName() != null) { + builder.query("source_snapshot.remote.region.name", String.valueOf(listSnapshotsOptions.sourceSnapshotRemoteRegionName())); + } + if (listSnapshotsOptions.sourceVolumeRemoteRegionName() != null) { + builder.query("source_volume.remote.region.name", String.valueOf(listSnapshotsOptions.sourceVolumeRemoteRegionName())); + } + if (listSnapshotsOptions.sourceImageRemoteRegionName() != null) { + builder.query("source_image.remote.region.name", String.valueOf(listSnapshotsOptions.sourceImageRemoteRegionName())); + } + if (listSnapshotsOptions.clonesZoneName() != null) { + builder.query("clones[].zone.name", String.valueOf(listSnapshotsOptions.clonesZoneName())); + } + if (listSnapshotsOptions.snapshotConsistencyGroupId() != null) { + builder.query("snapshot_consistency_group.id", String.valueOf(listSnapshotsOptions.snapshotConsistencyGroupId())); + } + if (listSnapshotsOptions.snapshotConsistencyGroupCrn() != null) { + builder.query("snapshot_consistency_group.crn", String.valueOf(listSnapshotsOptions.snapshotConsistencyGroupCrn())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List IKE policies. + * List snapshots. * - * This request lists IKE policies in the region. + * This request lists snapshots in the region. A snapshot preserves the data of a volume at the time the snapshot is + * created. * - * @return a {@link ServiceCall} with a result of type {@link IKEPolicyCollection} + * @return a {@link ServiceCall} with a result of type {@link SnapshotCollection} */ - public ServiceCall listIkePolicies() { - return listIkePolicies(null); + public ServiceCall listSnapshots() { + return listSnapshots(null); } /** - * Create an IKE policy. + * Create a snapshot. * - * This request creates a new IKE policy. + * This request creates a new snapshot from a snapshot prototype object. The prototype object is structured in the + * same way as a retrieved snapshot, and contains the information necessary to provision the new snapshot. * - * @param createIkePolicyOptions the {@link CreateIkePolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IKEPolicy} + * @param createSnapshotOptions the {@link CreateSnapshotOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Snapshot} */ - public ServiceCall createIkePolicy(CreateIkePolicyOptions createIkePolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createIkePolicyOptions, - "createIkePolicyOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createIkePolicy"); + public ServiceCall createSnapshot(CreateSnapshotOptions createSnapshotOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createSnapshotOptions, + "createSnapshotOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSnapshot"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("authentication_algorithm", createIkePolicyOptions.authenticationAlgorithm()); - contentJson.addProperty("dh_group", createIkePolicyOptions.dhGroup()); - contentJson.addProperty("encryption_algorithm", createIkePolicyOptions.encryptionAlgorithm()); - contentJson.addProperty("ike_version", createIkePolicyOptions.ikeVersion()); - if (createIkePolicyOptions.keyLifetime() != null) { - contentJson.addProperty("key_lifetime", createIkePolicyOptions.keyLifetime()); - } - if (createIkePolicyOptions.name() != null) { - contentJson.addProperty("name", createIkePolicyOptions.name()); - } - if (createIkePolicyOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createIkePolicyOptions.resourceGroup())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createSnapshotOptions.snapshotPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an IKE policy. + * Delete a snapshot. * - * This request deletes an IKE policy. This operation cannot be reversed. For this request to succeed, there must not - * be any VPN gateway connections using this policy. + * This request deletes a snapshot. This operation cannot be reversed. * - * @param deleteIkePolicyOptions the {@link DeleteIkePolicyOptions} containing the options for the call + * @param deleteSnapshotOptions the {@link DeleteSnapshotOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteIkePolicy(DeleteIkePolicyOptions deleteIkePolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteIkePolicyOptions, - "deleteIkePolicyOptions cannot be null"); + public ServiceCall deleteSnapshot(DeleteSnapshotOptions deleteSnapshotOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotOptions, + "deleteSnapshotOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteIkePolicyOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteIkePolicy"); + pathParamsMap.put("id", deleteSnapshotOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSnapshot"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + 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 responseConverter = ResponseConverterUtils.getVoid(); @@ -11869,186 +11601,105 @@ public ServiceCall deleteIkePolicy(DeleteIkePolicyOptions deleteIkePolicyO } /** - * Retrieve an IKE policy. + * Retrieve a snapshot. * - * This request retrieves a single IKE policy specified by the identifier in the URL. + * This request retrieves a single snapshot specified by the identifier in the URL. * - * @param getIkePolicyOptions the {@link GetIkePolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IKEPolicy} + * @param getSnapshotOptions the {@link GetSnapshotOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Snapshot} */ - public ServiceCall getIkePolicy(GetIkePolicyOptions getIkePolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getIkePolicyOptions, - "getIkePolicyOptions cannot be null"); + public ServiceCall getSnapshot(GetSnapshotOptions getSnapshotOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSnapshotOptions, + "getSnapshotOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getIkePolicyOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getIkePolicy"); + pathParamsMap.put("id", getSnapshotOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSnapshot"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an IKE policy. + * Update a snapshot. * - * This request updates the properties of an existing IKE policy. + * This request updates a snapshot with the information in a provided snapshot patch. The snapshot consistency group + * patch object is structured in the same way as a retrieved snapshot and contains only the information to be updated. * - * @param updateIkePolicyOptions the {@link UpdateIkePolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IKEPolicy} + * @param updateSnapshotOptions the {@link UpdateSnapshotOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Snapshot} */ - public ServiceCall updateIkePolicy(UpdateIkePolicyOptions updateIkePolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateIkePolicyOptions, - "updateIkePolicyOptions cannot be null"); + public ServiceCall updateSnapshot(UpdateSnapshotOptions updateSnapshotOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateSnapshotOptions, + "updateSnapshotOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateIkePolicyOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateIkePolicy"); + pathParamsMap.put("id", updateSnapshotOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSnapshot"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateSnapshotOptions.ifMatch() != null) { + builder.header("If-Match", updateSnapshotOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateIkePolicyOptions.ikePolicyPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSnapshotOptions.snapshotPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List VPN gateway connections that use a specified IKE policy. + * List clones for a snapshot. * - * This request lists VPN gateway connections that use an IKE policy. + * This request lists clones for a snapshot. Use a clone to quickly restore a snapshot within the clone's zone. * - * @param listIkePolicyConnectionsOptions the {@link ListIkePolicyConnectionsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IKEPolicyConnectionCollection} + * @param listSnapshotClonesOptions the {@link ListSnapshotClonesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotCloneCollection} */ - public ServiceCall listIkePolicyConnections(ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listIkePolicyConnectionsOptions, - "listIkePolicyConnectionsOptions cannot be null"); + public ServiceCall listSnapshotClones(ListSnapshotClonesOptions listSnapshotClonesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listSnapshotClonesOptions, + "listSnapshotClonesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", listIkePolicyConnectionsOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies/{id}/connections", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listIkePolicyConnections"); + pathParamsMap.put("id", listSnapshotClonesOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/clones", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSnapshotClones"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listIkePolicyConnectionsOptions.start() != null) { - builder.query("start", String.valueOf(listIkePolicyConnectionsOptions.start())); - } - if (listIkePolicyConnectionsOptions.limit() != null) { - builder.query("limit", String.valueOf(listIkePolicyConnectionsOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List IPsec policies. - * - * This request lists IPsec policies in the region. - * - * @param listIpsecPoliciesOptions the {@link ListIpsecPoliciesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IPsecPolicyCollection} - */ - public ServiceCall listIpsecPolicies(ListIpsecPoliciesOptions listIpsecPoliciesOptions) { - if (listIpsecPoliciesOptions == null) { - listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listIpsecPolicies"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - if (listIpsecPoliciesOptions.start() != null) { - builder.query("start", String.valueOf(listIpsecPoliciesOptions.start())); - } - if (listIpsecPoliciesOptions.limit() != null) { - builder.query("limit", String.valueOf(listIpsecPoliciesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List IPsec policies. - * - * This request lists IPsec policies in the region. - * - * @return a {@link ServiceCall} with a result of type {@link IPsecPolicyCollection} - */ - public ServiceCall listIpsecPolicies() { - return listIpsecPolicies(null); - } - - /** - * Create an IPsec policy. - * - * This request creates a new IPsec policy. - * - * @param createIpsecPolicyOptions the {@link CreateIpsecPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IPsecPolicy} - */ - public ServiceCall createIpsecPolicy(CreateIpsecPolicyOptions createIpsecPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createIpsecPolicyOptions, - "createIpsecPolicyOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createIpsecPolicy"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("authentication_algorithm", createIpsecPolicyOptions.authenticationAlgorithm()); - contentJson.addProperty("encryption_algorithm", createIpsecPolicyOptions.encryptionAlgorithm()); - contentJson.addProperty("pfs", createIpsecPolicyOptions.pfs()); - if (createIpsecPolicyOptions.keyLifetime() != null) { - contentJson.addProperty("key_lifetime", createIpsecPolicyOptions.keyLifetime()); - } - if (createIpsecPolicyOptions.name() != null) { - contentJson.addProperty("name", createIpsecPolicyOptions.name()); - } - if (createIpsecPolicyOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createIpsecPolicyOptions.resourceGroup())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an IPsec policy. + * Delete a snapshot clone. * - * This request deletes an IPsec policy. This operation cannot be reversed. For this request to succeed, there must - * not be any VPN gateway connections using this policy. + * This request deletes a snapshot clone. This operation cannot be reversed, but an equivalent clone may be recreated + * from the snapshot. * - * @param deleteIpsecPolicyOptions the {@link DeleteIpsecPolicyOptions} containing the options for the call + * @param deleteSnapshotCloneOptions the {@link DeleteSnapshotCloneOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteIpsecPolicy(DeleteIpsecPolicyOptions deleteIpsecPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteIpsecPolicyOptions, - "deleteIpsecPolicyOptions cannot be null"); + public ServiceCall deleteSnapshotClone(DeleteSnapshotCloneOptions deleteSnapshotCloneOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSnapshotCloneOptions, + "deleteSnapshotCloneOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteIpsecPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteIpsecPolicy"); + pathParamsMap.put("id", deleteSnapshotCloneOptions.id()); + pathParamsMap.put("zone_name", deleteSnapshotCloneOptions.zoneName()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/clones/{zone_name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSnapshotClone"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -12059,183 +11710,206 @@ public ServiceCall deleteIpsecPolicy(DeleteIpsecPolicyOptions deleteIpsecP } /** - * Retrieve an IPsec policy. + * Retrieve a snapshot clone. * - * This request retrieves a single IPsec policy specified by the identifier in the URL. + * This request retrieves a single clone specified by the snapshot identifier and zone name in the URL. * - * @param getIpsecPolicyOptions the {@link GetIpsecPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IPsecPolicy} + * @param getSnapshotCloneOptions the {@link GetSnapshotCloneOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotClone} */ - public ServiceCall getIpsecPolicy(GetIpsecPolicyOptions getIpsecPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getIpsecPolicyOptions, - "getIpsecPolicyOptions cannot be null"); + public ServiceCall getSnapshotClone(GetSnapshotCloneOptions getSnapshotCloneOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSnapshotCloneOptions, + "getSnapshotCloneOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getIpsecPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getIpsecPolicy"); + pathParamsMap.put("id", getSnapshotCloneOptions.id()); + pathParamsMap.put("zone_name", getSnapshotCloneOptions.zoneName()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/clones/{zone_name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSnapshotClone"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an IPsec policy. + * Create a clone for a snapshot. * - * This request updates the properties of an existing IPsec policy. + * This request creates a new clone for a snapshot in the specified zone. A request body is not required, and if + * provided, is ignored. If the snapshot already has a clone in the zone, it is returned. * - * @param updateIpsecPolicyOptions the {@link UpdateIpsecPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IPsecPolicy} + * @param createSnapshotCloneOptions the {@link CreateSnapshotCloneOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotClone} */ - public ServiceCall updateIpsecPolicy(UpdateIpsecPolicyOptions updateIpsecPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateIpsecPolicyOptions, - "updateIpsecPolicyOptions cannot be null"); + public ServiceCall createSnapshotClone(CreateSnapshotCloneOptions createSnapshotCloneOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createSnapshotCloneOptions, + "createSnapshotCloneOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateIpsecPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateIpsecPolicy"); + pathParamsMap.put("id", createSnapshotCloneOptions.id()); + pathParamsMap.put("zone_name", createSnapshotCloneOptions.zoneName()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/clones/{zone_name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSnapshotClone"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateIpsecPolicyOptions.iPsecPolicyPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List VPN gateway connections that use a specified IPsec policy. + * List instance profiles compatible with a snapshot. * - * This request lists VPN gateway connections that use an IPsec policy. + * This request lists instance profiles compatible with a snapshot's + * `allowed_use.instance`, `operating_system.architecture` and + * `operating_system.user_data_format` properties, sorted by ascending `name` property values. The specified snapshot + * must be bootable. * - * @param listIpsecPolicyConnectionsOptions the {@link ListIpsecPolicyConnectionsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IPsecPolicyConnectionCollection} + * @param listSnapshotInstanceProfilesOptions the {@link ListSnapshotInstanceProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SnapshotInstanceProfileCollection} */ - public ServiceCall listIpsecPolicyConnections(ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listIpsecPolicyConnectionsOptions, - "listIpsecPolicyConnectionsOptions cannot be null"); + public ServiceCall listSnapshotInstanceProfiles(ListSnapshotInstanceProfilesOptions listSnapshotInstanceProfilesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listSnapshotInstanceProfilesOptions, + "listSnapshotInstanceProfilesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", listIpsecPolicyConnectionsOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies/{id}/connections", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listIpsecPolicyConnections"); + pathParamsMap.put("id", listSnapshotInstanceProfilesOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/snapshots/{id}/instance_profiles", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSnapshotInstanceProfiles"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listIpsecPolicyConnectionsOptions.start() != null) { - builder.query("start", String.valueOf(listIpsecPolicyConnectionsOptions.start())); + if (listSnapshotInstanceProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listSnapshotInstanceProfilesOptions.start())); } - if (listIpsecPolicyConnectionsOptions.limit() != null) { - builder.query("limit", String.valueOf(listIpsecPolicyConnectionsOptions.limit())); + if (listSnapshotInstanceProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listSnapshotInstanceProfilesOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List VPN gateways. + * List subnets. * - * This request lists VPN gateways in the region. + * This request lists subnets in the region. Subnets are contiguous ranges of IP addresses specified in CIDR block + * notation. Each subnet is within a particular zone and cannot span multiple zones or regions. * - * @param listVpnGatewaysOptions the {@link ListVpnGatewaysOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGatewayCollection} + * @param listSubnetsOptions the {@link ListSubnetsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link SubnetCollection} */ - public ServiceCall listVpnGateways(ListVpnGatewaysOptions listVpnGatewaysOptions) { - if (listVpnGatewaysOptions == null) { - listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder().build(); + public ServiceCall listSubnets(ListSubnetsOptions listSubnetsOptions) { + if (listSubnetsOptions == null) { + listSubnetsOptions = new ListSubnetsOptions.Builder().build(); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGateways"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSubnets"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpnGatewaysOptions.start() != null) { - builder.query("start", String.valueOf(listVpnGatewaysOptions.start())); + if (listSubnetsOptions.start() != null) { + builder.query("start", String.valueOf(listSubnetsOptions.start())); } - if (listVpnGatewaysOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpnGatewaysOptions.limit())); + if (listSubnetsOptions.limit() != null) { + builder.query("limit", String.valueOf(listSubnetsOptions.limit())); } - if (listVpnGatewaysOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listVpnGatewaysOptions.resourceGroupId())); + if (listSubnetsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listSubnetsOptions.resourceGroupId())); } - if (listVpnGatewaysOptions.sort() != null) { - builder.query("sort", String.valueOf(listVpnGatewaysOptions.sort())); + if (listSubnetsOptions.zoneName() != null) { + builder.query("zone.name", String.valueOf(listSubnetsOptions.zoneName())); } - if (listVpnGatewaysOptions.mode() != null) { - builder.query("mode", String.valueOf(listVpnGatewaysOptions.mode())); + if (listSubnetsOptions.vpcId() != null) { + builder.query("vpc.id", String.valueOf(listSubnetsOptions.vpcId())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listSubnetsOptions.vpcCrn() != null) { + builder.query("vpc.crn", String.valueOf(listSubnetsOptions.vpcCrn())); + } + if (listSubnetsOptions.vpcName() != null) { + builder.query("vpc.name", String.valueOf(listSubnetsOptions.vpcName())); + } + if (listSubnetsOptions.routingTableId() != null) { + builder.query("routing_table.id", String.valueOf(listSubnetsOptions.routingTableId())); + } + if (listSubnetsOptions.routingTableName() != null) { + builder.query("routing_table.name", String.valueOf(listSubnetsOptions.routingTableName())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List VPN gateways. + * List subnets. * - * This request lists VPN gateways in the region. + * This request lists subnets in the region. Subnets are contiguous ranges of IP addresses specified in CIDR block + * notation. Each subnet is within a particular zone and cannot span multiple zones or regions. * - * @return a {@link ServiceCall} with a result of type {@link VPNGatewayCollection} + * @return a {@link ServiceCall} with a result of type {@link SubnetCollection} */ - public ServiceCall listVpnGateways() { - return listVpnGateways(null); + public ServiceCall listSubnets() { + return listSubnets(null); } /** - * Create a VPN gateway. + * Create a subnet. * - * This request creates a new VPN gateway. + * This request creates a new subnet from a subnet prototype object. The prototype object is structured in the same + * way as a retrieved subnet, and contains the information necessary to create the new subnet. For this request to + * succeed, the prototype's CIDR block must not overlap with an existing subnet in the VPC. * - * @param createVpnGatewayOptions the {@link CreateVpnGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGateway} + * @param createSubnetOptions the {@link CreateSubnetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Subnet} */ - public ServiceCall createVpnGateway(CreateVpnGatewayOptions createVpnGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpnGatewayOptions, - "createVpnGatewayOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpnGateway"); - for (Entry header : sdkHeaders.entrySet()) { + public ServiceCall createSubnet(CreateSubnetOptions createSubnetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createSubnetOptions, + "createSubnetOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSubnet"); + for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createVpnGatewayOptions.vpnGatewayPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createSubnetOptions.subnetPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a VPN gateway. + * Delete a subnet. * - * This request deletes a VPN gateway. This operation cannot be reversed. For this request to succeed, the VPN gateway - * must not have a `status` of `pending`, and there must not be any VPC routes using the VPN gateway's connections as - * a next hop. + * This request deletes a subnet. This operation cannot be reversed. For this request to succeed, the subnet must not + * be referenced by any bare metal server network interfaces, instance network interfaces, virtual network interfaces, + * VPN gateways, or load balancers. A delete operation automatically detaches the subnet from any network ACLs, public + * gateways, or endpoint gateways. All flow log collectors with `auto_delete` set to `true` targeting the subnet or + * any resource in the subnet are automatically deleted. * - * @param deleteVpnGatewayOptions the {@link DeleteVpnGatewayOptions} containing the options for the call + * @param deleteSubnetOptions the {@link DeleteSubnetOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteVpnGateway(DeleteVpnGatewayOptions deleteVpnGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnGatewayOptions, - "deleteVpnGatewayOptions cannot be null"); + public ServiceCall deleteSubnet(DeleteSubnetOptions deleteSubnetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSubnetOptions, + "deleteSubnetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteVpnGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnGateway"); + pathParamsMap.put("id", deleteSubnetOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSubnet"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -12246,137 +11920,127 @@ public ServiceCall deleteVpnGateway(DeleteVpnGatewayOptions deleteVpnGatew } /** - * Retrieve a VPN gateway. + * Retrieve a subnet. * - * This request retrieves a single VPN gateway specified by the identifier in the URL. + * This request retrieves a single subnet specified by the identifier in the URL. * - * @param getVpnGatewayOptions the {@link GetVpnGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGateway} + * @param getSubnetOptions the {@link GetSubnetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Subnet} */ - public ServiceCall getVpnGateway(GetVpnGatewayOptions getVpnGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnGatewayOptions, - "getVpnGatewayOptions cannot be null"); + public ServiceCall getSubnet(GetSubnetOptions getSubnetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetOptions, + "getSubnetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVpnGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnGateway"); + pathParamsMap.put("id", getSubnetOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnet"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a VPN gateway. + * Update a subnet. * - * This request updates the properties of an existing VPN gateway. + * This request updates a subnet with the information in a provided subnet patch. The subnet patch object is + * structured in the same way as a retrieved subnet and contains only the information to be updated. * - * @param updateVpnGatewayOptions the {@link UpdateVpnGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGateway} + * @param updateSubnetOptions the {@link UpdateSubnetOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Subnet} */ - public ServiceCall updateVpnGateway(UpdateVpnGatewayOptions updateVpnGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpnGatewayOptions, - "updateVpnGatewayOptions cannot be null"); + public ServiceCall updateSubnet(UpdateSubnetOptions updateSubnetOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateSubnetOptions, + "updateSubnetOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateVpnGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpnGateway"); + pathParamsMap.put("id", updateSubnetOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSubnet"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpnGatewayOptions.vpnGatewayPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSubnetOptions.subnetPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List connections of a VPN gateway. + * Retrieve a subnet's attached network ACL. * - * This request lists connections of a VPN gateway. + * This request retrieves the network ACL attached to the subnet specified by the identifier in the URL. * - * @param listVpnGatewayConnectionsOptions the {@link ListVpnGatewayConnectionsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnectionCollection} + * @param getSubnetNetworkAclOptions the {@link GetSubnetNetworkAclOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACL} */ - public ServiceCall listVpnGatewayConnections(ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnGatewayConnectionsOptions, - "listVpnGatewayConnectionsOptions cannot be null"); + public ServiceCall getSubnetNetworkAcl(GetSubnetNetworkAclOptions getSubnetNetworkAclOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetNetworkAclOptions, + "getSubnetNetworkAclOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", listVpnGatewayConnectionsOptions.vpnGatewayId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGatewayConnections"); + pathParamsMap.put("id", getSubnetNetworkAclOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/network_acl", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnetNetworkAcl"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpnGatewayConnectionsOptions.start() != null) { - builder.query("start", String.valueOf(listVpnGatewayConnectionsOptions.start())); - } - if (listVpnGatewayConnectionsOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpnGatewayConnectionsOptions.limit())); - } - if (listVpnGatewayConnectionsOptions.status() != null) { - builder.query("status", String.valueOf(listVpnGatewayConnectionsOptions.status())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a connection for a VPN gateway. + * Replace the network ACL for a subnet. * - * This request creates a new VPN gateway connection. + * This request replaces the existing network ACL for a subnet with the network ACL specified in the request body. * - * @param createVpnGatewayConnectionOptions the {@link CreateVpnGatewayConnectionOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnection} + * @param replaceSubnetNetworkAclOptions the {@link ReplaceSubnetNetworkAclOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link NetworkACL} */ - public ServiceCall createVpnGatewayConnection(CreateVpnGatewayConnectionOptions createVpnGatewayConnectionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpnGatewayConnectionOptions, - "createVpnGatewayConnectionOptions cannot be null"); + public ServiceCall replaceSubnetNetworkAcl(ReplaceSubnetNetworkAclOptions replaceSubnetNetworkAclOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(replaceSubnetNetworkAclOptions, + "replaceSubnetNetworkAclOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", createVpnGatewayConnectionOptions.vpnGatewayId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpnGatewayConnection"); + pathParamsMap.put("id", replaceSubnetNetworkAclOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/network_acl", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "replaceSubnetNetworkAcl"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createVpnGatewayConnectionOptions.vpnGatewayConnectionPrototype()), "application/json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(replaceSubnetNetworkAclOptions.networkAclIdentity()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a VPN gateway connection. + * Detach a public gateway from a subnet. * - * This request deletes a VPN gateway connection. This operation cannot be reversed. For this request to succeed, - * there must not be VPC routes using this VPN connection as a next hop. + * This request detaches the public gateway from the subnet specified by the subnet identifier in the URL. * - * @param deleteVpnGatewayConnectionOptions the {@link DeleteVpnGatewayConnectionOptions} containing the options for the call + * @param unsetSubnetPublicGatewayOptions the {@link UnsetSubnetPublicGatewayOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteVpnGatewayConnection(DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnGatewayConnectionOptions, - "deleteVpnGatewayConnectionOptions cannot be null"); + public ServiceCall unsetSubnetPublicGateway(UnsetSubnetPublicGatewayOptions unsetSubnetPublicGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(unsetSubnetPublicGatewayOptions, + "unsetSubnetPublicGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", deleteVpnGatewayConnectionOptions.vpnGatewayId()); - pathParamsMap.put("id", deleteVpnGatewayConnectionOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnGatewayConnection"); + pathParamsMap.put("id", unsetSubnetPublicGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/public_gateway", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "unsetSubnetPublicGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -12387,222 +12051,224 @@ public ServiceCall deleteVpnGatewayConnection(DeleteVpnGatewayConnectionOp } /** - * Retrieve a VPN gateway connection. + * Retrieve a subnet's attached public gateway. * - * This request retrieves a single VPN gateway connection specified by the identifier in the URL. + * This request retrieves the public gateway attached to the subnet specified by the identifier in the URL. * - * @param getVpnGatewayConnectionOptions the {@link GetVpnGatewayConnectionOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnection} + * @param getSubnetPublicGatewayOptions the {@link GetSubnetPublicGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicGateway} */ - public ServiceCall getVpnGatewayConnection(GetVpnGatewayConnectionOptions getVpnGatewayConnectionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnGatewayConnectionOptions, - "getVpnGatewayConnectionOptions cannot be null"); + public ServiceCall getSubnetPublicGateway(GetSubnetPublicGatewayOptions getSubnetPublicGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetPublicGatewayOptions, + "getSubnetPublicGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", getVpnGatewayConnectionOptions.vpnGatewayId()); - pathParamsMap.put("id", getVpnGatewayConnectionOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnGatewayConnection"); + pathParamsMap.put("id", getSubnetPublicGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/public_gateway", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnetPublicGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a VPN gateway connection. + * Attach a public gateway to a subnet. * - * This request updates the properties of an existing VPN gateway connection. + * This request attaches the public gateway, specified in the request body, to the subnet specified by the subnet + * identifier in the URL. The public gateway must have the same VPC and zone as the subnet. * - * @param updateVpnGatewayConnectionOptions the {@link UpdateVpnGatewayConnectionOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnection} + * @param setSubnetPublicGatewayOptions the {@link SetSubnetPublicGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PublicGateway} */ - public ServiceCall updateVpnGatewayConnection(UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpnGatewayConnectionOptions, - "updateVpnGatewayConnectionOptions cannot be null"); + public ServiceCall setSubnetPublicGateway(SetSubnetPublicGatewayOptions setSubnetPublicGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(setSubnetPublicGatewayOptions, + "setSubnetPublicGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", updateVpnGatewayConnectionOptions.vpnGatewayId()); - pathParamsMap.put("id", updateVpnGatewayConnectionOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpnGatewayConnection"); + pathParamsMap.put("id", setSubnetPublicGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/public_gateway", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "setSubnetPublicGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpnGatewayConnectionOptions.vpnGatewayConnectionPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(setSubnetPublicGatewayOptions.publicGatewayIdentity()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List local CIDRs for a VPN gateway connection. - * - * This request lists local CIDRs for a VPN gateway connection. + * Retrieve a subnet's attached routing table. * - * This request is only supported for policy mode VPN gateways. + * This request retrieves the routing table attached to the subnet specified by the identifier in the URL. * - * @param listVpnGatewayConnectionsLocalCidrsOptions the {@link ListVpnGatewayConnectionsLocalCidrsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnectionCIDRs} + * @param getSubnetRoutingTableOptions the {@link GetSubnetRoutingTableOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RoutingTable} */ - public ServiceCall listVpnGatewayConnectionsLocalCidrs(ListVpnGatewayConnectionsLocalCidrsOptions listVpnGatewayConnectionsLocalCidrsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnGatewayConnectionsLocalCidrsOptions, - "listVpnGatewayConnectionsLocalCidrsOptions cannot be null"); + public ServiceCall getSubnetRoutingTable(GetSubnetRoutingTableOptions getSubnetRoutingTableOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetRoutingTableOptions, + "getSubnetRoutingTableOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", listVpnGatewayConnectionsLocalCidrsOptions.vpnGatewayId()); - pathParamsMap.put("id", listVpnGatewayConnectionsLocalCidrsOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGatewayConnectionsLocalCidrs"); + pathParamsMap.put("id", getSubnetRoutingTableOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/routing_table", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnetRoutingTable"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Remove a local CIDR from a VPN gateway connection. + * Replace the routing table for a subnet. * - * This request removes a CIDR from a VPN gateway connection. + * This request replaces the existing routing table for a subnet with the routing table specified in the request body. * - * This request is only supported for policy mode VPN gateways. + * For this request to succeed, the routing table `route_direct_link_ingress`, + * `route_internet_ingress`, `route_transit_gateway_ingress`, and `route_vpc_zone_ingress` properties must be `false`. * - * @param removeVpnGatewayConnectionsLocalCidrOptions the {@link RemoveVpnGatewayConnectionsLocalCidrOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall removeVpnGatewayConnectionsLocalCidr(RemoveVpnGatewayConnectionsLocalCidrOptions removeVpnGatewayConnectionsLocalCidrOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(removeVpnGatewayConnectionsLocalCidrOptions, - "removeVpnGatewayConnectionsLocalCidrOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", removeVpnGatewayConnectionsLocalCidrOptions.vpnGatewayId()); - pathParamsMap.put("id", removeVpnGatewayConnectionsLocalCidrOptions.id()); - pathParamsMap.put("cidr", removeVpnGatewayConnectionsLocalCidrOptions.cidr()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeVpnGatewayConnectionsLocalCidr"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Check if the specified local CIDR exists on a VPN gateway connection. - * - * This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. - * - * This request is only supported for policy mode VPN gateways. - * - * @param checkVpnGatewayConnectionsLocalCidrOptions the {@link CheckVpnGatewayConnectionsLocalCidrOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param replaceSubnetRoutingTableOptions the {@link ReplaceSubnetRoutingTableOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RoutingTable} */ - public ServiceCall checkVpnGatewayConnectionsLocalCidr(CheckVpnGatewayConnectionsLocalCidrOptions checkVpnGatewayConnectionsLocalCidrOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(checkVpnGatewayConnectionsLocalCidrOptions, - "checkVpnGatewayConnectionsLocalCidrOptions cannot be null"); + public ServiceCall replaceSubnetRoutingTable(ReplaceSubnetRoutingTableOptions replaceSubnetRoutingTableOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(replaceSubnetRoutingTableOptions, + "replaceSubnetRoutingTableOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", checkVpnGatewayConnectionsLocalCidrOptions.vpnGatewayId()); - pathParamsMap.put("id", checkVpnGatewayConnectionsLocalCidrOptions.id()); - pathParamsMap.put("cidr", checkVpnGatewayConnectionsLocalCidrOptions.cidr()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "checkVpnGatewayConnectionsLocalCidr"); + pathParamsMap.put("id", replaceSubnetRoutingTableOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{id}/routing_table", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "replaceSubnetRoutingTable"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(replaceSubnetRoutingTableOptions.routingTableIdentity()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Set a local CIDR on a VPN gateway connection. - * - * This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the - * specified CIDR already exists. A request body is not required, and if provided, is ignored. + * List reserved IPs in a subnet. * - * This request is only supported for policy mode VPN gateways. + * This request lists reserved IPs in a subnet. A reserved IP resource will exist for every address in the subnet + * which is not available for use. * - * @param addVpnGatewayConnectionsLocalCidrOptions the {@link AddVpnGatewayConnectionsLocalCidrOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listSubnetReservedIpsOptions the {@link ListSubnetReservedIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollection} */ - public ServiceCall addVpnGatewayConnectionsLocalCidr(AddVpnGatewayConnectionsLocalCidrOptions addVpnGatewayConnectionsLocalCidrOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(addVpnGatewayConnectionsLocalCidrOptions, - "addVpnGatewayConnectionsLocalCidrOptions cannot be null"); + public ServiceCall listSubnetReservedIps(ListSubnetReservedIpsOptions listSubnetReservedIpsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listSubnetReservedIpsOptions, + "listSubnetReservedIpsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", addVpnGatewayConnectionsLocalCidrOptions.vpnGatewayId()); - pathParamsMap.put("id", addVpnGatewayConnectionsLocalCidrOptions.id()); - pathParamsMap.put("cidr", addVpnGatewayConnectionsLocalCidrOptions.cidr()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addVpnGatewayConnectionsLocalCidr"); + pathParamsMap.put("subnet_id", listSubnetReservedIpsOptions.subnetId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listSubnetReservedIps"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listSubnetReservedIpsOptions.start() != null) { + builder.query("start", String.valueOf(listSubnetReservedIpsOptions.start())); + } + if (listSubnetReservedIpsOptions.limit() != null) { + builder.query("limit", String.valueOf(listSubnetReservedIpsOptions.limit())); + } + if (listSubnetReservedIpsOptions.sort() != null) { + builder.query("sort", String.valueOf(listSubnetReservedIpsOptions.sort())); + } + if (listSubnetReservedIpsOptions.targetId() != null) { + builder.query("target.id", String.valueOf(listSubnetReservedIpsOptions.targetId())); + } + if (listSubnetReservedIpsOptions.targetCrn() != null) { + builder.query("target.crn", String.valueOf(listSubnetReservedIpsOptions.targetCrn())); + } + if (listSubnetReservedIpsOptions.targetName() != null) { + builder.query("target.name", String.valueOf(listSubnetReservedIpsOptions.targetName())); + } + if (listSubnetReservedIpsOptions.targetResourceType() != null) { + builder.query("target.resource_type", String.valueOf(listSubnetReservedIpsOptions.targetResourceType())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List peer CIDRs for a VPN gateway connection. - * - * This request lists peer CIDRs for a VPN gateway connection. + * Reserve an IP in a subnet. * - * This request is only supported for policy mode VPN gateways. + * This request reserves an IP address in a subnet. If the provided prototype object includes an `address`, the + * address must not already be reserved. * - * @param listVpnGatewayConnectionsPeerCidrsOptions the {@link ListVpnGatewayConnectionsPeerCidrsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnectionCIDRs} + * @param createSubnetReservedIpOptions the {@link CreateSubnetReservedIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIP} */ - public ServiceCall listVpnGatewayConnectionsPeerCidrs(ListVpnGatewayConnectionsPeerCidrsOptions listVpnGatewayConnectionsPeerCidrsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnGatewayConnectionsPeerCidrsOptions, - "listVpnGatewayConnectionsPeerCidrsOptions cannot be null"); + public ServiceCall createSubnetReservedIp(CreateSubnetReservedIpOptions createSubnetReservedIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createSubnetReservedIpOptions, + "createSubnetReservedIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", listVpnGatewayConnectionsPeerCidrsOptions.vpnGatewayId()); - pathParamsMap.put("id", listVpnGatewayConnectionsPeerCidrsOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGatewayConnectionsPeerCidrs"); + pathParamsMap.put("subnet_id", createSubnetReservedIpOptions.subnetId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createSubnetReservedIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + if (createSubnetReservedIpOptions.address() != null) { + contentJson.addProperty("address", createSubnetReservedIpOptions.address()); + } + if (createSubnetReservedIpOptions.autoDelete() != null) { + contentJson.addProperty("auto_delete", createSubnetReservedIpOptions.autoDelete()); + } + if (createSubnetReservedIpOptions.name() != null) { + contentJson.addProperty("name", createSubnetReservedIpOptions.name()); + } + if (createSubnetReservedIpOptions.target() != null) { + contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createSubnetReservedIpOptions.target())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Remove a peer CIDR from a VPN gateway connection. + * Delete a reserved IP. * - * This request removes a CIDR from a VPN gateway connection. + * This request releases a reserved IP. This operation cannot be reversed. * - * This request is only supported for policy mode VPN gateways. + * For this request to succeed, the reserved IP must not be required by another resource, such as a bare metal server + * network interface, instance network interface or virtual network interface for which it is the primary IP. A + * provider-owned reserved IP is not allowed to be deleted. * - * @param removeVpnGatewayConnectionsPeerCidrOptions the {@link RemoveVpnGatewayConnectionsPeerCidrOptions} containing the options for the call + * @param deleteSubnetReservedIpOptions the {@link DeleteSubnetReservedIpOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall removeVpnGatewayConnectionsPeerCidr(RemoveVpnGatewayConnectionsPeerCidrOptions removeVpnGatewayConnectionsPeerCidrOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(removeVpnGatewayConnectionsPeerCidrOptions, - "removeVpnGatewayConnectionsPeerCidrOptions cannot be null"); + public ServiceCall deleteSubnetReservedIp(DeleteSubnetReservedIpOptions deleteSubnetReservedIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteSubnetReservedIpOptions, + "deleteSubnetReservedIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", removeVpnGatewayConnectionsPeerCidrOptions.vpnGatewayId()); - pathParamsMap.put("id", removeVpnGatewayConnectionsPeerCidrOptions.id()); - pathParamsMap.put("cidr", removeVpnGatewayConnectionsPeerCidrOptions.cidr()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeVpnGatewayConnectionsPeerCidr"); + pathParamsMap.put("subnet_id", deleteSubnetReservedIpOptions.subnetId()); + pathParamsMap.put("id", deleteSubnetReservedIpOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteSubnetReservedIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -12613,385 +12279,1203 @@ public ServiceCall removeVpnGatewayConnectionsPeerCidr(RemoveVpnGatewayCon } /** - * Check if the specified peer CIDR exists on a VPN gateway connection. - * - * This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. + * Retrieve a reserved IP. * - * This request is only supported for policy mode VPN gateways. + * This request retrieves a single reserved IP specified by the identifier in the URL. * - * @param checkVpnGatewayConnectionsPeerCidrOptions the {@link CheckVpnGatewayConnectionsPeerCidrOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getSubnetReservedIpOptions the {@link GetSubnetReservedIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIP} */ - public ServiceCall checkVpnGatewayConnectionsPeerCidr(CheckVpnGatewayConnectionsPeerCidrOptions checkVpnGatewayConnectionsPeerCidrOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(checkVpnGatewayConnectionsPeerCidrOptions, - "checkVpnGatewayConnectionsPeerCidrOptions cannot be null"); + public ServiceCall getSubnetReservedIp(GetSubnetReservedIpOptions getSubnetReservedIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getSubnetReservedIpOptions, + "getSubnetReservedIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", checkVpnGatewayConnectionsPeerCidrOptions.vpnGatewayId()); - pathParamsMap.put("id", checkVpnGatewayConnectionsPeerCidrOptions.id()); - pathParamsMap.put("cidr", checkVpnGatewayConnectionsPeerCidrOptions.cidr()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "checkVpnGatewayConnectionsPeerCidr"); + pathParamsMap.put("subnet_id", getSubnetReservedIpOptions.subnetId()); + pathParamsMap.put("id", getSubnetReservedIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getSubnetReservedIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Set a peer CIDR on a VPN gateway connection. + * Update a reserved IP. * - * This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the - * specified CIDR already exists. A request body is not required, and if provided, is ignored. + * This request updates a reserved IP with the information in a provided reserved IP patch. The reserved IP patch + * object is structured in the same way as a retrieved reserved IP and contains only the information to be updated. * - * This request is only supported for policy mode VPN gateways. + * A provider-owned reserved IP is not allowed to be updated. * - * @param addVpnGatewayConnectionsPeerCidrOptions the {@link AddVpnGatewayConnectionsPeerCidrOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param updateSubnetReservedIpOptions the {@link UpdateSubnetReservedIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIP} */ - public ServiceCall addVpnGatewayConnectionsPeerCidr(AddVpnGatewayConnectionsPeerCidrOptions addVpnGatewayConnectionsPeerCidrOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(addVpnGatewayConnectionsPeerCidrOptions, - "addVpnGatewayConnectionsPeerCidrOptions cannot be null"); + public ServiceCall updateSubnetReservedIp(UpdateSubnetReservedIpOptions updateSubnetReservedIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateSubnetReservedIpOptions, + "updateSubnetReservedIpOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_gateway_id", addVpnGatewayConnectionsPeerCidrOptions.vpnGatewayId()); - pathParamsMap.put("id", addVpnGatewayConnectionsPeerCidrOptions.id()); - pathParamsMap.put("cidr", addVpnGatewayConnectionsPeerCidrOptions.cidr()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addVpnGatewayConnectionsPeerCidr"); + pathParamsMap.put("subnet_id", updateSubnetReservedIpOptions.subnetId()); + pathParamsMap.put("id", updateSubnetReservedIpOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/subnets/{subnet_id}/reserved_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateSubnetReservedIp"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateSubnetReservedIpOptions.reservedIpPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List VPN servers. + * List virtual network interfaces. * - * This request lists VPN servers. + * This request lists virtual network interfaces in the region. A virtual network interface is a logical abstraction + * of a virtual network interface in a subnet, and may be attached to a target resource. * - * @param listVpnServersOptions the {@link ListVpnServersOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServerCollection} + * The virtual network interfaces will be sorted by their `created_at` property values, with newest virtual network + * interfaces first. Virtual network interfaces with identical + * `created_at` property values will in turn be sorted by ascending `name` property values. + * + * @param listVirtualNetworkInterfacesOptions the {@link ListVirtualNetworkInterfacesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterfaceCollection} */ - public ServiceCall listVpnServers(ListVpnServersOptions listVpnServersOptions) { - if (listVpnServersOptions == null) { - listVpnServersOptions = new ListVpnServersOptions.Builder().build(); + public ServiceCall listVirtualNetworkInterfaces(ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptions) { + if (listVirtualNetworkInterfacesOptions == null) { + listVirtualNetworkInterfacesOptions = new ListVirtualNetworkInterfacesOptions.Builder().build(); } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnServers"); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVirtualNetworkInterfaces"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpnServersOptions.name() != null) { - builder.query("name", String.valueOf(listVpnServersOptions.name())); + if (listVirtualNetworkInterfacesOptions.start() != null) { + builder.query("start", String.valueOf(listVirtualNetworkInterfacesOptions.start())); } - if (listVpnServersOptions.start() != null) { - builder.query("start", String.valueOf(listVpnServersOptions.start())); + if (listVirtualNetworkInterfacesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVirtualNetworkInterfacesOptions.limit())); + } + if (listVirtualNetworkInterfacesOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listVirtualNetworkInterfacesOptions.resourceGroupId())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List virtual network interfaces. + * + * This request lists virtual network interfaces in the region. A virtual network interface is a logical abstraction + * of a virtual network interface in a subnet, and may be attached to a target resource. + * + * The virtual network interfaces will be sorted by their `created_at` property values, with newest virtual network + * interfaces first. Virtual network interfaces with identical + * `created_at` property values will in turn be sorted by ascending `name` property values. + * + * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterfaceCollection} + */ + public ServiceCall listVirtualNetworkInterfaces() { + return listVirtualNetworkInterfaces(null); + } + + /** + * Create a virtual network interface. + * + * This request creates a new virtual network interface from a virtual network interface prototype object. The + * prototype object is structured in the same way as a retrieved virtual network interface, and contains the + * information necessary to create the new virtual network interface. + * + * @param createVirtualNetworkInterfaceOptions the {@link CreateVirtualNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} + */ + public ServiceCall createVirtualNetworkInterface(CreateVirtualNetworkInterfaceOptions createVirtualNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVirtualNetworkInterfaceOptions, + "createVirtualNetworkInterfaceOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVirtualNetworkInterface"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + final JsonObject contentJson = new JsonObject(); + if (createVirtualNetworkInterfaceOptions.allowIpSpoofing() != null) { + contentJson.addProperty("allow_ip_spoofing", createVirtualNetworkInterfaceOptions.allowIpSpoofing()); + } + if (createVirtualNetworkInterfaceOptions.autoDelete() != null) { + contentJson.addProperty("auto_delete", createVirtualNetworkInterfaceOptions.autoDelete()); + } + if (createVirtualNetworkInterfaceOptions.enableInfrastructureNat() != null) { + contentJson.addProperty("enable_infrastructure_nat", createVirtualNetworkInterfaceOptions.enableInfrastructureNat()); + } + if (createVirtualNetworkInterfaceOptions.ips() != null) { + contentJson.add("ips", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.ips())); + } + if (createVirtualNetworkInterfaceOptions.name() != null) { + contentJson.addProperty("name", createVirtualNetworkInterfaceOptions.name()); + } + if (createVirtualNetworkInterfaceOptions.primaryIp() != null) { + contentJson.add("primary_ip", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.primaryIp())); + } + if (createVirtualNetworkInterfaceOptions.protocolStateFilteringMode() != null) { + contentJson.addProperty("protocol_state_filtering_mode", createVirtualNetworkInterfaceOptions.protocolStateFilteringMode()); + } + if (createVirtualNetworkInterfaceOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.resourceGroup())); + } + if (createVirtualNetworkInterfaceOptions.securityGroups() != null) { + contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.securityGroups())); + } + if (createVirtualNetworkInterfaceOptions.subnet() != null) { + contentJson.add("subnet", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVirtualNetworkInterfaceOptions.subnet())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create a virtual network interface. + * + * This request creates a new virtual network interface from a virtual network interface prototype object. The + * prototype object is structured in the same way as a retrieved virtual network interface, and contains the + * information necessary to create the new virtual network interface. + * + * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} + */ + public ServiceCall createVirtualNetworkInterface() { + return createVirtualNetworkInterface(null); + } + + /** + * Delete a virtual network interface. + * + * This request deletes a virtual network interface. This operation cannot be reversed. For this request to succeed, + * the virtual network interface must not be required by another resource, such as the primary network attachment for + * an instance. + * + * @param deleteVirtualNetworkInterfacesOptions the {@link DeleteVirtualNetworkInterfacesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} + */ + public ServiceCall deleteVirtualNetworkInterfaces(DeleteVirtualNetworkInterfacesOptions deleteVirtualNetworkInterfacesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVirtualNetworkInterfacesOptions, + "deleteVirtualNetworkInterfacesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", deleteVirtualNetworkInterfacesOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVirtualNetworkInterfaces"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (deleteVirtualNetworkInterfacesOptions.ifMatch() != null) { + builder.header("If-Match", deleteVirtualNetworkInterfacesOptions.ifMatch()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Retrieve a virtual network interface. + * + * This request retrieves a single virtual network interface specified by the identifier in the URL. + * + * @param getVirtualNetworkInterfaceOptions the {@link GetVirtualNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} + */ + public ServiceCall getVirtualNetworkInterface(GetVirtualNetworkInterfaceOptions getVirtualNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVirtualNetworkInterfaceOptions, + "getVirtualNetworkInterfaceOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getVirtualNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVirtualNetworkInterface"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update a virtual network interface. + * + * This request updates a virtual network interface with the information in a provided virtual network interface + * patch. The virtual network interface patch object is structured in the same way as a retrieved virtual network + * interface and contains only the information to be updated. + * + * @param updateVirtualNetworkInterfaceOptions the {@link UpdateVirtualNetworkInterfaceOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VirtualNetworkInterface} + */ + public ServiceCall updateVirtualNetworkInterface(UpdateVirtualNetworkInterfaceOptions updateVirtualNetworkInterfaceOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVirtualNetworkInterfaceOptions, + "updateVirtualNetworkInterfaceOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", updateVirtualNetworkInterfaceOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVirtualNetworkInterface"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + if (updateVirtualNetworkInterfaceOptions.ifMatch() != null) { + builder.header("If-Match", updateVirtualNetworkInterfaceOptions.ifMatch()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVirtualNetworkInterfaceOptions.virtualNetworkInterfacePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List floating IPs associated with a virtual network interface. + * + * This request lists floating IPs associated with a virtual network interface. + * + * @param listNetworkInterfaceFloatingIpsOptions the {@link ListNetworkInterfaceFloatingIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIPCollectionVirtualNetworkInterfaceContext} + */ + public ServiceCall listNetworkInterfaceFloatingIps(ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listNetworkInterfaceFloatingIpsOptions, + "listNetworkInterfaceFloatingIpsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("virtual_network_interface_id", listNetworkInterfaceFloatingIpsOptions.virtualNetworkInterfaceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listNetworkInterfaceFloatingIps"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + if (listNetworkInterfaceFloatingIpsOptions.start() != null) { + builder.query("start", String.valueOf(listNetworkInterfaceFloatingIpsOptions.start())); + } + if (listNetworkInterfaceFloatingIpsOptions.limit() != null) { + builder.query("limit", String.valueOf(listNetworkInterfaceFloatingIpsOptions.limit())); + } + if (listNetworkInterfaceFloatingIpsOptions.sort() != null) { + builder.query("sort", String.valueOf(listNetworkInterfaceFloatingIpsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Disassociate a floating IP from a virtual network interface. + * + * This request disassociates the specified floating IP from the specified virtual network interface. + * + * @param removeNetworkInterfaceFloatingIpOptions the {@link RemoveNetworkInterfaceFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall removeNetworkInterfaceFloatingIp(RemoveNetworkInterfaceFloatingIpOptions removeNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(removeNetworkInterfaceFloatingIpOptions, + "removeNetworkInterfaceFloatingIpOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("virtual_network_interface_id", removeNetworkInterfaceFloatingIpOptions.virtualNetworkInterfaceId()); + pathParamsMap.put("id", removeNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeNetworkInterfaceFloatingIp"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Retrieve associated floating IP. + * + * This request retrieves a specified floating IP if it is associated with the virtual network interface specified in + * the URL. + * + * @param getNetworkInterfaceFloatingIpOptions the {@link GetNetworkInterfaceFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIPReference} + */ + public ServiceCall getNetworkInterfaceFloatingIp(GetNetworkInterfaceFloatingIpOptions getNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getNetworkInterfaceFloatingIpOptions, + "getNetworkInterfaceFloatingIpOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("virtual_network_interface_id", getNetworkInterfaceFloatingIpOptions.virtualNetworkInterfaceId()); + pathParamsMap.put("id", getNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getNetworkInterfaceFloatingIp"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Add an association between a floating IP and a virtual network interface. + * + * This request adds an association between the specified floating IP and the specified virtual network interface. + * + * If the virtual network interface has `enable_infrastructure_nat` set to `true`, no more than one floating IP can be + * associated, and network address translation is performed between the floating IP address and the virtual network + * interface's `primary_ip` address. + * + * If the virtual network interface has `enable_infrastructure_nat` set to `false`, packets are passed unchanged + * to/from the virtual network interface. + * + * The floating IP must: + * - be in the same `zone` as the virtual network interface + * - not currently be associated with another resource + * + * The virtual network interface's `target` must not currently be a file share mount target. + * + * A request body is not required, and if provided, is ignored. + * + * @param addNetworkInterfaceFloatingIpOptions the {@link AddNetworkInterfaceFloatingIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link FloatingIPReference} + */ + public ServiceCall addNetworkInterfaceFloatingIp(AddNetworkInterfaceFloatingIpOptions addNetworkInterfaceFloatingIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(addNetworkInterfaceFloatingIpOptions, + "addNetworkInterfaceFloatingIpOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("virtual_network_interface_id", addNetworkInterfaceFloatingIpOptions.virtualNetworkInterfaceId()); + pathParamsMap.put("id", addNetworkInterfaceFloatingIpOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/floating_ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addNetworkInterfaceFloatingIp"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List reserved IPs bound to a virtual network interface. + * + * This request lists reserved IPs bound to a virtual network interface. + * + * @param listVirtualNetworkInterfaceIpsOptions the {@link ListVirtualNetworkInterfaceIpsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionVirtualNetworkInterfaceContext} + */ + public ServiceCall listVirtualNetworkInterfaceIps(ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVirtualNetworkInterfaceIpsOptions, + "listVirtualNetworkInterfaceIpsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("virtual_network_interface_id", listVirtualNetworkInterfaceIpsOptions.virtualNetworkInterfaceId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/ips", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVirtualNetworkInterfaceIps"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + if (listVirtualNetworkInterfaceIpsOptions.start() != null) { + builder.query("start", String.valueOf(listVirtualNetworkInterfaceIpsOptions.start())); + } + if (listVirtualNetworkInterfaceIpsOptions.limit() != null) { + builder.query("limit", String.valueOf(listVirtualNetworkInterfaceIpsOptions.limit())); + } + if (listVirtualNetworkInterfaceIpsOptions.sort() != null) { + builder.query("sort", String.valueOf(listVirtualNetworkInterfaceIpsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Unbind a reserved IP from a virtual network interface. + * + * This request unbinds the specified reserved IP from the specified virtual network interface. If the reserved IP has + * `auto_delete` set to `true`, the reserved IP will be deleted. + * + * The reserved IP for the `primary_ip` cannot be unbound. + * + * @param removeVirtualNetworkInterfaceIpOptions the {@link RemoveVirtualNetworkInterfaceIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall removeVirtualNetworkInterfaceIp(RemoveVirtualNetworkInterfaceIpOptions removeVirtualNetworkInterfaceIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(removeVirtualNetworkInterfaceIpOptions, + "removeVirtualNetworkInterfaceIpOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("virtual_network_interface_id", removeVirtualNetworkInterfaceIpOptions.virtualNetworkInterfaceId()); + pathParamsMap.put("id", removeVirtualNetworkInterfaceIpOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeVirtualNetworkInterfaceIp"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Retrieve bound reserved IP. + * + * This request retrieves the specified reserved IP address if it is bound to the virtual network interface specified + * in the URL. + * + * @param getVirtualNetworkInterfaceIpOptions the {@link GetVirtualNetworkInterfaceIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIPReference} + */ + public ServiceCall getVirtualNetworkInterfaceIp(GetVirtualNetworkInterfaceIpOptions getVirtualNetworkInterfaceIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVirtualNetworkInterfaceIpOptions, + "getVirtualNetworkInterfaceIpOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("virtual_network_interface_id", getVirtualNetworkInterfaceIpOptions.virtualNetworkInterfaceId()); + pathParamsMap.put("id", getVirtualNetworkInterfaceIpOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVirtualNetworkInterfaceIp"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Bind a reserved IP to a virtual network interface. + * + * This request binds the specified reserved IP to the specified virtual network interface. + * + * The reserved IP must currently be unbound and in the primary IP's subnet. The virtual network interface's `target` + * must not currently be a file share mount target. + * + * @param addVirtualNetworkInterfaceIpOptions the {@link AddVirtualNetworkInterfaceIpOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ReservedIPReference} + */ + public ServiceCall addVirtualNetworkInterfaceIp(AddVirtualNetworkInterfaceIpOptions addVirtualNetworkInterfaceIpOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(addVirtualNetworkInterfaceIpOptions, + "addVirtualNetworkInterfaceIpOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("virtual_network_interface_id", addVirtualNetworkInterfaceIpOptions.virtualNetworkInterfaceId()); + pathParamsMap.put("id", addVirtualNetworkInterfaceIpOptions.id()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/virtual_network_interfaces/{virtual_network_interface_id}/ips/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addVirtualNetworkInterfaceIp"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List volume profiles. + * + * This request lists [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available in + * the region. A volume profile specifies the performance characteristics and pricing model for a volume. + * + * @param listVolumeProfilesOptions the {@link ListVolumeProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VolumeProfileCollection} + */ + public ServiceCall listVolumeProfiles(ListVolumeProfilesOptions listVolumeProfilesOptions) { + if (listVolumeProfilesOptions == null) { + listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volume/profiles")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVolumeProfiles"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + if (listVolumeProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listVolumeProfilesOptions.start())); + } + if (listVolumeProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVolumeProfilesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List volume profiles. + * + * This request lists [volume profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles) available in + * the region. A volume profile specifies the performance characteristics and pricing model for a volume. + * + * @return a {@link ServiceCall} with a result of type {@link VolumeProfileCollection} + */ + public ServiceCall listVolumeProfiles() { + return listVolumeProfiles(null); + } + + /** + * Retrieve a volume profile. + * + * This request retrieves a single volume profile specified by the name in the URL. + * + * @param getVolumeProfileOptions the {@link GetVolumeProfileOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VolumeProfile} + */ + public ServiceCall getVolumeProfile(GetVolumeProfileOptions getVolumeProfileOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVolumeProfileOptions, + "getVolumeProfileOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("name", getVolumeProfileOptions.name()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volume/profiles/{name}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVolumeProfile"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List volumes. + * + * This request lists volumes in the region. Volumes are network-connected block storage devices that may be attached + * to one or more instances in the same region. + * + * @param listVolumesOptions the {@link ListVolumesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VolumeCollection} + */ + public ServiceCall listVolumes(ListVolumesOptions listVolumesOptions) { + if (listVolumesOptions == null) { + listVolumesOptions = new ListVolumesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVolumes"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + if (listVolumesOptions.start() != null) { + builder.query("start", String.valueOf(listVolumesOptions.start())); + } + if (listVolumesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVolumesOptions.limit())); + } + 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.tag() != null) { + builder.query("tag", String.valueOf(listVolumesOptions.tag())); + } + if (listVolumesOptions.zoneName() != null) { + builder.query("zone.name", String.valueOf(listVolumesOptions.zoneName())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List volumes. + * + * This request lists volumes in the region. Volumes are network-connected block storage devices that may be attached + * to one or more instances in the same region. + * + * @return a {@link ServiceCall} with a result of type {@link VolumeCollection} + */ + public ServiceCall listVolumes() { + return listVolumes(null); + } + + /** + * Create a volume. + * + * This request creates a new volume from a volume prototype object. The prototype object is structured in the same + * way as a retrieved volume, and contains the information necessary to create the new volume. + * + * @param createVolumeOptions the {@link CreateVolumeOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Volume} + */ + public ServiceCall createVolume(CreateVolumeOptions createVolumeOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVolumeOptions, + "createVolumeOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVolume"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createVolumeOptions.volumePrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Delete a volume. + * + * This request deletes a volume. This operation cannot be reversed. For this request to succeed, the volume must not + * be attached to any instances. + * + * @param deleteVolumeOptions the {@link DeleteVolumeOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall deleteVolume(DeleteVolumeOptions deleteVolumeOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVolumeOptions, + "deleteVolumeOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", deleteVolumeOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVolume"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } - if (listVpnServersOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpnServersOptions.limit())); + if (deleteVolumeOptions.ifMatch() != null) { + builder.header("If-Match", deleteVolumeOptions.ifMatch()); } - if (listVpnServersOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listVpnServersOptions.resourceGroupId())); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Retrieve a volume. + * + * This request retrieves a single volume specified by the identifier in the URL. + * + * @param getVolumeOptions the {@link GetVolumeOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Volume} + */ + public ServiceCall getVolume(GetVolumeOptions getVolumeOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVolumeOptions, + "getVolumeOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", getVolumeOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVolume"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } - if (listVpnServersOptions.sort() != null) { - builder.query("sort", String.valueOf(listVpnServersOptions.sort())); + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update a volume. + * + * This request updates a volume with the information in a provided volume patch. The volume patch object is + * structured in the same way as a retrieved volume and contains only the information to be updated. + * + * @param updateVolumeOptions the {@link UpdateVolumeOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Volume} + */ + public ServiceCall updateVolume(UpdateVolumeOptions updateVolumeOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVolumeOptions, + "updateVolumeOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", updateVolumeOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVolume"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.header("Accept", "application/json"); + if (updateVolumeOptions.ifMatch() != null) { + builder.header("If-Match", updateVolumeOptions.ifMatch()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVolumeOptions.volumePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List VPN servers. + * List instance profiles compatible with a volume. * - * This request lists VPN servers. + * This request lists instance profiles compatible with a volume's + * `allowed_use.instance`, `operating_system.architecture` and + * `operating_system.user_data_format` properties, sorted by ascending `name` property values. The specified volume + * must be bootable (have an `operating_system` property). * - * @return a {@link ServiceCall} with a result of type {@link VPNServerCollection} + * @param listVolumeInstanceProfilesOptions the {@link ListVolumeInstanceProfilesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VolumeInstanceProfileCollection} */ - public ServiceCall listVpnServers() { - return listVpnServers(null); + public ServiceCall listVolumeInstanceProfiles(ListVolumeInstanceProfilesOptions listVolumeInstanceProfilesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVolumeInstanceProfilesOptions, + "listVolumeInstanceProfilesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", listVolumeInstanceProfilesOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/volumes/{id}/instance_profiles", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVolumeInstanceProfiles"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + if (listVolumeInstanceProfilesOptions.start() != null) { + builder.query("start", String.valueOf(listVolumeInstanceProfilesOptions.start())); + } + if (listVolumeInstanceProfilesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVolumeInstanceProfilesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); } /** - * Create a VPN server. + * List VPCs. * - * This request creates a new VPN server. + * This request lists VPCs in the region. A VPC is a virtual network that belongs to an account and provides logical + * isolation from other networks. A VPC is made up of resources in one or more zones. VPCs are regional, and each VPC + * can contain resources in multiple zones in a region. * - * @param createVpnServerOptions the {@link CreateVpnServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServer} + * @param listVpcsOptions the {@link ListVpcsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPCCollection} */ - public ServiceCall createVpnServer(CreateVpnServerOptions createVpnServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpnServerOptions, - "createVpnServerOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpnServer"); + public ServiceCall listVpcs(ListVpcsOptions listVpcsOptions) { + if (listVpcsOptions == null) { + listVpcsOptions = new ListVpcsOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcs"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("certificate", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.certificate())); - contentJson.add("client_authentication", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.clientAuthentication())); - contentJson.addProperty("client_ip_pool", createVpnServerOptions.clientIpPool()); - contentJson.add("subnets", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.subnets())); - if (createVpnServerOptions.clientDnsServerIps() != null) { - contentJson.add("client_dns_server_ips", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.clientDnsServerIps())); + if (listVpcsOptions.start() != null) { + builder.query("start", String.valueOf(listVpcsOptions.start())); } - if (createVpnServerOptions.clientIdleTimeout() != null) { - contentJson.addProperty("client_idle_timeout", createVpnServerOptions.clientIdleTimeout()); + if (listVpcsOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpcsOptions.limit())); } - if (createVpnServerOptions.enableSplitTunneling() != null) { - contentJson.addProperty("enable_split_tunneling", createVpnServerOptions.enableSplitTunneling()); + if (listVpcsOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listVpcsOptions.resourceGroupId())); } - if (createVpnServerOptions.name() != null) { - contentJson.addProperty("name", createVpnServerOptions.name()); + if (listVpcsOptions.classicAccess() != null) { + builder.query("classic_access", String.valueOf(listVpcsOptions.classicAccess())); } - if (createVpnServerOptions.port() != null) { - contentJson.addProperty("port", createVpnServerOptions.port()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List VPCs. + * + * This request lists VPCs in the region. A VPC is a virtual network that belongs to an account and provides logical + * isolation from other networks. A VPC is made up of resources in one or more zones. VPCs are regional, and each VPC + * can contain resources in multiple zones in a region. + * + * @return a {@link ServiceCall} with a result of type {@link VPCCollection} + */ + public ServiceCall listVpcs() { + return listVpcs(null); + } + + /** + * Create a VPC. + * + * This request creates a new VPC from a VPC prototype object. The prototype object is structured in the same way as a + * retrieved VPC, and contains the information necessary to create the new VPC. + * + * The system will automatically create the following additional resources for the VPC: + * - Unless `address_prefix_management` is `manual`, a [default address + * prefix](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-address-prefix) for each zone + * - A [default network + * ACL](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-network-acl) + * - A [default routing + * table](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-routing-table) + * - A [default security + * group](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-security-group). + * + * @param createVpcOptions the {@link CreateVpcOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPC} + */ + public ServiceCall createVpc(CreateVpcOptions createVpcOptions) { + boolean skipBody = false; + if (createVpcOptions == null) { + createVpcOptions = new CreateVpcOptions.Builder().build(); + skipBody = true; } - if (createVpnServerOptions.protocol() != null) { - contentJson.addProperty("protocol", createVpnServerOptions.protocol()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpc"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } - if (createVpnServerOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.resourceGroup())); + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + if (!skipBody) { + final JsonObject contentJson = new JsonObject(); + if (createVpcOptions.addressPrefixManagement() != null) { + contentJson.addProperty("address_prefix_management", createVpcOptions.addressPrefixManagement()); + } + if (createVpcOptions.classicAccess() != null) { + contentJson.addProperty("classic_access", createVpcOptions.classicAccess()); + } + if (createVpcOptions.dns() != null) { + contentJson.add("dns", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcOptions.dns())); + } + if (createVpcOptions.name() != null) { + contentJson.addProperty("name", createVpcOptions.name()); + } + if (createVpcOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcOptions.resourceGroup())); + } + builder.bodyJson(contentJson); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create a VPC. + * + * This request creates a new VPC from a VPC prototype object. The prototype object is structured in the same way as a + * retrieved VPC, and contains the information necessary to create the new VPC. + * + * The system will automatically create the following additional resources for the VPC: + * - Unless `address_prefix_management` is `manual`, a [default address + * prefix](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-address-prefix) for each zone + * - A [default network + * ACL](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-network-acl) + * - A [default routing + * table](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-routing-table) + * - A [default security + * group](https://cloud.ibm.com/apidocs/vpc/latest#get-vpc-default-security-group). + * + * @return a {@link ServiceCall} with a result of type {@link VPC} + */ + public ServiceCall createVpc() { + return createVpc(null); + } + + /** + * Delete a VPC. + * + * This request deletes a VPC. This operation cannot be reversed. + * + * For this request to succeed: + * - Instances, subnets, public gateways, endpoint gateways, and private path service + * gateways must not reside in this VPC + * - The VPC must not be providing DNS resolution for any other VPCs + * - If `dns.enable_hub` is `true`, `dns.resolution_binding_count` must be zero + * + * All security groups and network ACLs associated with the VPC are automatically deleted. All flow log collectors + * with `auto_delete` set to `true` targeting the VPC or any resource in the VPC are automatically deleted. All public + * address ranges attached to the VPC are automatically detached. + * + * @param deleteVpcOptions the {@link DeleteVpcOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall deleteVpc(DeleteVpcOptions deleteVpcOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcOptions, + "deleteVpcOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", deleteVpcOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpc"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } - if (createVpnServerOptions.securityGroups() != null) { - contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.securityGroups())); + if (deleteVpcOptions.ifMatch() != null) { + builder.header("If-Match", deleteVpcOptions.ifMatch()); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a VPN server. + * Retrieve a VPC. * - * This request deletes a VPN server. This operation cannot be reversed. + * This request retrieves a single VPC specified by the identifier in the URL. * - * @param deleteVpnServerOptions the {@link DeleteVpnServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getVpcOptions the {@link GetVpcOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPC} */ - public ServiceCall deleteVpnServer(DeleteVpnServerOptions deleteVpnServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnServerOptions, - "deleteVpnServerOptions cannot be null"); + public ServiceCall getVpc(GetVpcOptions getVpcOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcOptions, + "getVpcOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteVpnServerOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnServer"); + pathParamsMap.put("id", getVpcOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpc"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - if (deleteVpnServerOptions.ifMatch() != null) { - builder.header("If-Match", deleteVpnServerOptions.ifMatch()); - } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a VPN server. + * Update a VPC. * - * This request retrieves a single VPN server specified by the identifier in the URL. + * This request updates a VPC with the information provided in a VPC patch object. The patch object is structured in + * the same way as a retrieved VPC and needs to contain only the information to be updated. * - * @param getVpnServerOptions the {@link GetVpnServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServer} + * @param updateVpcOptions the {@link UpdateVpcOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPC} */ - public ServiceCall getVpnServer(GetVpnServerOptions getVpnServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnServerOptions, - "getVpnServerOptions cannot be null"); + public ServiceCall updateVpc(UpdateVpcOptions updateVpcOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcOptions, + "updateVpcOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVpnServerOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnServer"); + pathParamsMap.put("id", updateVpcOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpc"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateVpcOptions.ifMatch() != null) { + builder.header("If-Match", updateVpcOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcOptions.vpcPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a VPN server. + * Retrieve a VPC's default network ACL. * - * This request updates the properties of an existing VPN server. Any updates other than to `name` will cause all - * connected VPN clients to be disconnected. + * This request retrieves the default network ACL for the VPC specified by the identifier in the URL. The default + * network ACL is applied to any new subnets in the VPC which do not specify a network ACL. * - * @param updateVpnServerOptions the {@link UpdateVpnServerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServer} + * @param getVpcDefaultNetworkAclOptions the {@link GetVpcDefaultNetworkAclOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DefaultNetworkACL} */ - public ServiceCall updateVpnServer(UpdateVpnServerOptions updateVpnServerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpnServerOptions, - "updateVpnServerOptions cannot be null"); + public ServiceCall getVpcDefaultNetworkAcl(GetVpcDefaultNetworkAclOptions getVpcDefaultNetworkAclOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcDefaultNetworkAclOptions, + "getVpcDefaultNetworkAclOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateVpnServerOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpnServer"); + pathParamsMap.put("id", getVpcDefaultNetworkAclOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}/default_network_acl", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcDefaultNetworkAcl"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateVpnServerOptions.ifMatch() != null) { - builder.header("If-Match", updateVpnServerOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpnServerOptions.vpnServerPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve client configuration. + * Retrieve a VPC's default routing table. * - * This request retrieves OpenVPN client configuration on a single VPN server specified by the identifier in the URL. - * This configuration includes directives compatible with OpenVPN releases 2.4 and 2.5. + * This request retrieves the default routing table for the VPC specified by the identifier in the URL. The default + * routing table is associated with any subnets in the VPC which have not been explicitly associated with another + * routing table. * - * @param getVpnServerClientConfigurationOptions the {@link GetVpnServerClientConfigurationOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link String} + * @param getVpcDefaultRoutingTableOptions the {@link GetVpcDefaultRoutingTableOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DefaultRoutingTable} */ - public ServiceCall getVpnServerClientConfiguration(GetVpnServerClientConfigurationOptions getVpnServerClientConfigurationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnServerClientConfigurationOptions, - "getVpnServerClientConfigurationOptions cannot be null"); + public ServiceCall getVpcDefaultRoutingTable(GetVpcDefaultRoutingTableOptions getVpcDefaultRoutingTableOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcDefaultRoutingTableOptions, + "getVpcDefaultRoutingTableOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getVpnServerClientConfigurationOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{id}/client_configuration", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnServerClientConfiguration"); + pathParamsMap.put("id", getVpcDefaultRoutingTableOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}/default_routing_table", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcDefaultRoutingTable"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "text/plain"); + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getString(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List VPN clients for a VPN server. + * Retrieve a VPC's default security group. * - * This request retrieves connected VPN clients, and any disconnected VPN clients that the VPN server has not yet - * deleted based on its auto-deletion policy. + * This request retrieves the default security group for the VPC specified by the identifier in the URL. Resources + * created in this VPC that allow a security group to be optionally specified will use this security group by default. * - * @param listVpnServerClientsOptions the {@link ListVpnServerClientsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServerClientCollection} + * @param getVpcDefaultSecurityGroupOptions the {@link GetVpcDefaultSecurityGroupOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link DefaultSecurityGroup} */ - public ServiceCall listVpnServerClients(ListVpnServerClientsOptions listVpnServerClientsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnServerClientsOptions, - "listVpnServerClientsOptions cannot be null"); + public ServiceCall getVpcDefaultSecurityGroup(GetVpcDefaultSecurityGroupOptions getVpcDefaultSecurityGroupOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcDefaultSecurityGroupOptions, + "getVpcDefaultSecurityGroupOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", listVpnServerClientsOptions.vpnServerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/clients", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnServerClients"); + pathParamsMap.put("id", getVpcDefaultSecurityGroupOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{id}/default_security_group", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcDefaultSecurityGroup"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpnServerClientsOptions.start() != null) { - builder.query("start", String.valueOf(listVpnServerClientsOptions.start())); - } - if (listVpnServerClientsOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpnServerClientsOptions.limit())); - } - if (listVpnServerClientsOptions.sort() != null) { - builder.query("sort", String.valueOf(listVpnServerClientsOptions.sort())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a VPN client. + * List address prefixes for a VPC. * - * This request disconnects and deletes the VPN client from the VPN server. The VPN client may reconnect unless its - * authentication permissions for the configured authentication methods (such as its client certificate) have been - * revoked. + * This request lists address pool prefixes for a VPC. * - * @param deleteVpnServerClientOptions the {@link DeleteVpnServerClientOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listVpcAddressPrefixesOptions the {@link ListVpcAddressPrefixesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AddressPrefixCollection} */ - public ServiceCall deleteVpnServerClient(DeleteVpnServerClientOptions deleteVpnServerClientOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnServerClientOptions, - "deleteVpnServerClientOptions cannot be null"); + public ServiceCall listVpcAddressPrefixes(ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcAddressPrefixesOptions, + "listVpcAddressPrefixesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", deleteVpnServerClientOptions.vpnServerId()); - pathParamsMap.put("id", deleteVpnServerClientOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/clients/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnServerClient"); + pathParamsMap.put("vpc_id", listVpcAddressPrefixesOptions.vpcId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcAddressPrefixes"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listVpcAddressPrefixesOptions.start() != null) { + builder.query("start", String.valueOf(listVpcAddressPrefixesOptions.start())); + } + if (listVpcAddressPrefixesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpcAddressPrefixesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a VPN client. + * Create an address prefix for a VPC. * - * This request retrieves a single VPN client specified by the identifier in the URL. + * This request creates a new prefix from a prefix prototype object. The prototype object is structured in the same + * way as a retrieved prefix, and contains the information necessary to create the new prefix. * - * @param getVpnServerClientOptions the {@link GetVpnServerClientOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServerClient} + * @param createVpcAddressPrefixOptions the {@link CreateVpcAddressPrefixOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AddressPrefix} */ - public ServiceCall getVpnServerClient(GetVpnServerClientOptions getVpnServerClientOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnServerClientOptions, - "getVpnServerClientOptions cannot be null"); + public ServiceCall createVpcAddressPrefix(CreateVpcAddressPrefixOptions createVpcAddressPrefixOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcAddressPrefixOptions, + "createVpcAddressPrefixOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", getVpnServerClientOptions.vpnServerId()); - pathParamsMap.put("id", getVpnServerClientOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/clients/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnServerClient"); + pathParamsMap.put("vpc_id", createVpcAddressPrefixOptions.vpcId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcAddressPrefix"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("cidr", createVpcAddressPrefixOptions.cidr()); + contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcAddressPrefixOptions.zone())); + if (createVpcAddressPrefixOptions.isDefault() != null) { + contentJson.addProperty("is_default", createVpcAddressPrefixOptions.isDefault()); + } + if (createVpcAddressPrefixOptions.name() != null) { + contentJson.addProperty("name", createVpcAddressPrefixOptions.name()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Disconnect a VPN client. + * Delete an address prefix. * - * This request disconnects the specified VPN client, and deletes the client according to the VPN server's - * auto-deletion policy. The VPN client may reconnect unless its authentication permissions for the configured - * authentication methods (such as its client certificate) have been revoked. + * This request deletes a prefix. This operation cannot be reversed. The request will fail if any subnets use + * addresses from this prefix. * - * @param disconnectVpnClientOptions the {@link DisconnectVpnClientOptions} containing the options for the call + * @param deleteVpcAddressPrefixOptions the {@link DeleteVpcAddressPrefixOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall disconnectVpnClient(DisconnectVpnClientOptions disconnectVpnClientOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(disconnectVpnClientOptions, - "disconnectVpnClientOptions cannot be null"); + public ServiceCall deleteVpcAddressPrefix(DeleteVpcAddressPrefixOptions deleteVpcAddressPrefixOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcAddressPrefixOptions, + "deleteVpcAddressPrefixOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", disconnectVpnClientOptions.vpnServerId()); - pathParamsMap.put("id", disconnectVpnClientOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/clients/{id}/disconnect", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "disconnectVpnClient"); + pathParamsMap.put("vpc_id", deleteVpcAddressPrefixOptions.vpcId()); + pathParamsMap.put("id", deleteVpcAddressPrefixOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcAddressPrefix"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -13002,285 +13486,322 @@ public ServiceCall disconnectVpnClient(DisconnectVpnClientOptions disconne } /** - * List VPN routes for a VPN server. + * Retrieve an address prefix. * - * This request lists VPN routes in a VPN server. All VPN routes are provided to the VPN client when the connection is - * established. Packets received from the VPN client will be dropped by the VPN server if there is no VPN route - * matching their specified destinations. All VPN routes must be unique within the VPN server. + * This request retrieves a single prefix specified by the identifier in the URL. * - * @param listVpnServerRoutesOptions the {@link ListVpnServerRoutesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServerRouteCollection} + * @param getVpcAddressPrefixOptions the {@link GetVpcAddressPrefixOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AddressPrefix} */ - public ServiceCall listVpnServerRoutes(ListVpnServerRoutesOptions listVpnServerRoutesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnServerRoutesOptions, - "listVpnServerRoutesOptions cannot be null"); + public ServiceCall getVpcAddressPrefix(GetVpcAddressPrefixOptions getVpcAddressPrefixOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcAddressPrefixOptions, + "getVpcAddressPrefixOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", listVpnServerRoutesOptions.vpnServerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnServerRoutes"); + pathParamsMap.put("vpc_id", getVpcAddressPrefixOptions.vpcId()); + pathParamsMap.put("id", getVpcAddressPrefixOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcAddressPrefix"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listVpnServerRoutesOptions.start() != null) { - builder.query("start", String.valueOf(listVpnServerRoutesOptions.start())); - } - if (listVpnServerRoutesOptions.limit() != null) { - builder.query("limit", String.valueOf(listVpnServerRoutesOptions.limit())); - } - if (listVpnServerRoutesOptions.sort() != null) { - builder.query("sort", String.valueOf(listVpnServerRoutesOptions.sort())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a VPN route for a VPN server. + * Update an address prefix. * - * This request creates a new VPN route in the VPN server. All VPN routes are provided to the VPN client when the - * connection is established. Packets received from the VPN client will be dropped by the VPN server if there is no - * VPN route matching their specified destinations. All VPN routes must be unique within the VPN server. + * This request updates a prefix with the information in a provided prefix patch. The prefix patch object is + * structured in the same way as a retrieved prefix and contains only the information to be updated. * - * @param createVpnServerRouteOptions the {@link CreateVpnServerRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServerRoute} + * @param updateVpcAddressPrefixOptions the {@link UpdateVpcAddressPrefixOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link AddressPrefix} */ - public ServiceCall createVpnServerRoute(CreateVpnServerRouteOptions createVpnServerRouteOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createVpnServerRouteOptions, - "createVpnServerRouteOptions cannot be null"); + public ServiceCall updateVpcAddressPrefix(UpdateVpcAddressPrefixOptions updateVpcAddressPrefixOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcAddressPrefixOptions, + "updateVpcAddressPrefixOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", createVpnServerRouteOptions.vpnServerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpnServerRoute"); + pathParamsMap.put("vpc_id", updateVpcAddressPrefixOptions.vpcId()); + pathParamsMap.put("id", updateVpcAddressPrefixOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/address_prefixes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcAddressPrefix"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("destination", createVpnServerRouteOptions.destination()); - if (createVpnServerRouteOptions.action() != null) { - contentJson.addProperty("action", createVpnServerRouteOptions.action()); - } - if (createVpnServerRouteOptions.name() != null) { - contentJson.addProperty("name", createVpnServerRouteOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcAddressPrefixOptions.addressPrefixPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a VPN route. + * List DNS resolution bindings for a VPC. * - * This request deletes a VPN route. This operation cannot be reversed. + * This request lists DNS resolution bindings for a VPC. A DNS resolution binding represents an association with + * another VPC for centralizing DNS name resolution. * - * @param deleteVpnServerRouteOptions the {@link DeleteVpnServerRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * If the VPC specified by the identifier in the URL is a DNS hub VPC (has `dns.enable_hub` set to `true`) then there + * is one binding for each VPC bound to the hub VPC. The endpoint gateways in the bound VPCs can allow (using + * `dns_resolution_binding_mode`) the hub VPC to centralize resolution of their DNS names. + * + * If the VPC specified by the identifier in the URL is not a DNS hub VPC, then there is at most one binding (to a hub + * VPC). The endpoint gateways in the VPC specified by the identifier in the URL can allow (using + * `dns_resolution_binding_mode`) its hub VPC to centralize resolution of their DNS names. + * + * To make use of centralized DNS resolution, a VPC bound to a DNS hub VPC must delegate DNS resolution to its hub VPC + * by setting `dns.resolver.type` to `delegate`. + * + * @param listVpcDnsResolutionBindingsOptions the {@link ListVpcDnsResolutionBindingsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBindingCollection} */ - public ServiceCall deleteVpnServerRoute(DeleteVpnServerRouteOptions deleteVpnServerRouteOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnServerRouteOptions, - "deleteVpnServerRouteOptions cannot be null"); + public ServiceCall listVpcDnsResolutionBindings(ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcDnsResolutionBindingsOptions, + "listVpcDnsResolutionBindingsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", deleteVpnServerRouteOptions.vpnServerId()); - pathParamsMap.put("id", deleteVpnServerRouteOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnServerRoute"); + pathParamsMap.put("vpc_id", listVpcDnsResolutionBindingsOptions.vpcId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcDnsResolutionBindings"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listVpcDnsResolutionBindingsOptions.sort() != null) { + builder.query("sort", String.valueOf(listVpcDnsResolutionBindingsOptions.sort())); + } + if (listVpcDnsResolutionBindingsOptions.start() != null) { + builder.query("start", String.valueOf(listVpcDnsResolutionBindingsOptions.start())); + } + if (listVpcDnsResolutionBindingsOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpcDnsResolutionBindingsOptions.limit())); + } + if (listVpcDnsResolutionBindingsOptions.name() != null) { + builder.query("name", String.valueOf(listVpcDnsResolutionBindingsOptions.name())); + } + if (listVpcDnsResolutionBindingsOptions.vpcCrn() != null) { + builder.query("vpc.crn", String.valueOf(listVpcDnsResolutionBindingsOptions.vpcCrn())); + } + if (listVpcDnsResolutionBindingsOptions.vpcName() != null) { + builder.query("vpc.name", String.valueOf(listVpcDnsResolutionBindingsOptions.vpcName())); + } + if (listVpcDnsResolutionBindingsOptions.accountId() != null) { + builder.query("account.id", String.valueOf(listVpcDnsResolutionBindingsOptions.accountId())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve a VPN route. + * Create a DNS resolution binding. * - * This request retrieves a single VPN route specified by the identifier in the URL. + * This request creates a new DNS resolution binding from a DNS resolution binding prototype object. The prototype + * object is structured in the same way as a retrieved DNS resolution binding, and contains the information necessary + * to create the new DNS resolution binding. * - * @param getVpnServerRouteOptions the {@link GetVpnServerRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServerRoute} + * For this request to succeed: + * - The VPC specified by the identifier in the URL must not already have a DNS resolution + * binding + * - The VPC specified by the identifier in the URL must have `dns.enable_hub` set to + * `false` + * - The updated DNS sharing connected topology must not contain more than one endpoint + * gateway with `dns_resolution_binding_mode` set to `primary` targeting the same service. + * + * Additionally, if the VPC specified by the identifier in the URL has endpoint gateways that have + * `dns_resolution_binding_mode` set to `per_resource_binding`, then those endpoint gateways will participate in [DNS + * sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) with all VPCs in the connected topology. If this VPC contains an + * endpoint gateway targeting a service that has resource binding enabled, then for this request to succeed: + * - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + * gateway with the same `target` as the endpoint gateway in this VPC, and with + * `dns_resolution_binding_mode` set to `primary`. + * - No other VPC in the topology can have an endpoint gateway with a resource binding + * using the same `service_endpoint` as a resource binding for the endpoint gateway in + * this VPC. + * + * See [About DNS sharing for VPE gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) for more information. + * + * @param createVpcDnsResolutionBindingOptions the {@link CreateVpcDnsResolutionBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBinding} */ - public ServiceCall getVpnServerRoute(GetVpnServerRouteOptions getVpnServerRouteOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnServerRouteOptions, - "getVpnServerRouteOptions cannot be null"); + public ServiceCall createVpcDnsResolutionBinding(CreateVpcDnsResolutionBindingOptions createVpcDnsResolutionBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcDnsResolutionBindingOptions, + "createVpcDnsResolutionBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", getVpnServerRouteOptions.vpnServerId()); - pathParamsMap.put("id", getVpnServerRouteOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnServerRoute"); + pathParamsMap.put("vpc_id", createVpcDnsResolutionBindingOptions.vpcId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcDnsResolutionBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcDnsResolutionBindingOptions.vpc())); + if (createVpcDnsResolutionBindingOptions.name() != null) { + contentJson.addProperty("name", createVpcDnsResolutionBindingOptions.name()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a VPN route. + * Delete a DNS resolution binding. * - * This request updates a VPN route with the information in a provided VPN route patch. The VPN route patch object is - * structured in the same way as a retrieved VPN route and contains only the information to be updated. + * This request deletes a DNS resolution binding. This operation cannot be reversed. * - * @param updateVpnServerRouteOptions the {@link UpdateVpnServerRouteOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link VPNServerRoute} + * For this request to succeed, the VPC specified by the identifier in the URL must not have + * `dns.resolver.type` set to `delegated`. + * + * @param deleteVpcDnsResolutionBindingOptions the {@link DeleteVpcDnsResolutionBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBinding} */ - public ServiceCall updateVpnServerRoute(UpdateVpnServerRouteOptions updateVpnServerRouteOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpnServerRouteOptions, - "updateVpnServerRouteOptions cannot be null"); + public ServiceCall deleteVpcDnsResolutionBinding(DeleteVpcDnsResolutionBindingOptions deleteVpcDnsResolutionBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcDnsResolutionBindingOptions, + "deleteVpcDnsResolutionBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("vpn_server_id", updateVpnServerRouteOptions.vpnServerId()); - pathParamsMap.put("id", updateVpnServerRouteOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpnServerRoute"); + pathParamsMap.put("vpc_id", deleteVpcDnsResolutionBindingOptions.vpcId()); + pathParamsMap.put("id", deleteVpcDnsResolutionBindingOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcDnsResolutionBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpnServerRouteOptions.vpnServerRoutePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List load balancer profiles. + * Retrieve a DNS resolution binding. * - * This request lists load balancer profiles available in the region. A load balancer profile specifies the - * performance characteristics and pricing model for a load balancer. + * This request retrieves a single DNS resolution binding specified by the identifier in the URL. * - * @param listLoadBalancerProfilesOptions the {@link ListLoadBalancerProfilesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerProfileCollection} + * @param getVpcDnsResolutionBindingOptions the {@link GetVpcDnsResolutionBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBinding} */ - public ServiceCall listLoadBalancerProfiles(ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions) { - if (listLoadBalancerProfilesOptions == null) { - listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancer/profiles")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerProfiles"); + public ServiceCall getVpcDnsResolutionBinding(GetVpcDnsResolutionBindingOptions getVpcDnsResolutionBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcDnsResolutionBindingOptions, + "getVpcDnsResolutionBindingOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpc_id", getVpcDnsResolutionBindingOptions.vpcId()); + pathParamsMap.put("id", getVpcDnsResolutionBindingOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcDnsResolutionBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listLoadBalancerProfilesOptions.start() != null) { - builder.query("start", String.valueOf(listLoadBalancerProfilesOptions.start())); - } - if (listLoadBalancerProfilesOptions.limit() != null) { - builder.query("limit", String.valueOf(listLoadBalancerProfilesOptions.limit())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List load balancer profiles. - * - * This request lists load balancer profiles available in the region. A load balancer profile specifies the - * performance characteristics and pricing model for a load balancer. - * - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerProfileCollection} - */ - public ServiceCall listLoadBalancerProfiles() { - return listLoadBalancerProfiles(null); - } - - /** - * Retrieve a load balancer profile. + * Update a DNS resolution binding. * - * This request retrieves a load balancer profile specified by the name in the URL. + * This request updates a DNS resolution binding with the information in a provided DNS resolution binding patch. The + * DNS resolution binding patch object is structured in the same way as a retrieved DNS resolution binding and + * contains only the information to be updated. * - * @param getLoadBalancerProfileOptions the {@link GetLoadBalancerProfileOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerProfile} + * @param updateVpcDnsResolutionBindingOptions the {@link UpdateVpcDnsResolutionBindingOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPCDNSResolutionBinding} */ - public ServiceCall getLoadBalancerProfile(GetLoadBalancerProfileOptions getLoadBalancerProfileOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerProfileOptions, - "getLoadBalancerProfileOptions cannot be null"); + public ServiceCall updateVpcDnsResolutionBinding(UpdateVpcDnsResolutionBindingOptions updateVpcDnsResolutionBindingOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcDnsResolutionBindingOptions, + "updateVpcDnsResolutionBindingOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("name", getLoadBalancerProfileOptions.name()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancer/profiles/{name}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerProfile"); + pathParamsMap.put("vpc_id", updateVpcDnsResolutionBindingOptions.vpcId()); + pathParamsMap.put("id", updateVpcDnsResolutionBindingOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/dns_resolution_bindings/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcDnsResolutionBinding"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcDnsResolutionBindingOptions.vpcdnsResolutionBindingPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List load balancers. + * List routes in a VPC's default routing table. * - * This request lists load balancers in the region. + * This request lists routes in the VPC's default routing table. Each route is zone-specific and directs any packets + * matching its destination CIDR block to a `next_hop` IP address. The most specific route matching a packet's + * destination will be used. If multiple equally-specific routes exist, traffic will be distributed across them. * - * @param listLoadBalancersOptions the {@link ListLoadBalancersOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerCollection} + * @param listVpcRoutesOptions the {@link ListVpcRoutesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RouteCollectionVPCContext} + * @deprecated this method is deprecated and may be removed in a future release */ - public ServiceCall listLoadBalancers(ListLoadBalancersOptions listLoadBalancersOptions) { - if (listLoadBalancersOptions == null) { - listLoadBalancersOptions = new ListLoadBalancersOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancers"); + @Deprecated + public ServiceCall listVpcRoutes(ListVpcRoutesOptions listVpcRoutesOptions) { + LOGGER.warning("A deprecated operation has been invoked: listVpcRoutes"); + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcRoutesOptions, + "listVpcRoutesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpc_id", listVpcRoutesOptions.vpcId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcRoutes"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listLoadBalancersOptions.start() != null) { - builder.query("start", String.valueOf(listLoadBalancersOptions.start())); + if (listVpcRoutesOptions.zoneName() != null) { + builder.query("zone.name", String.valueOf(listVpcRoutesOptions.zoneName())); } - if (listLoadBalancersOptions.limit() != null) { - builder.query("limit", String.valueOf(listLoadBalancersOptions.limit())); + if (listVpcRoutesOptions.start() != null) { + builder.query("start", String.valueOf(listVpcRoutesOptions.start())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listVpcRoutesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpcRoutesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List load balancers. - * - * This request lists load balancers in the region. - * - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerCollection} - */ - public ServiceCall listLoadBalancers() { - return listLoadBalancers(null); - } - - /** - * Create a load balancer. + * Create a route in a VPC's default routing table. * - * This request creates and provisions a new load balancer. + * This request creates a new route in the VPC's default routing table. The route prototype object is structured in + * the same way as a retrieved route, and contains the information necessary to create the new route. The request will + * fail if the new route will cause a loop. * - * @param createLoadBalancerOptions the {@link CreateLoadBalancerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancer} + * @param createVpcRouteOptions the {@link CreateVpcRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Route} + * @deprecated this method is deprecated and may be removed in a future release */ - public ServiceCall createLoadBalancer(CreateLoadBalancerOptions createLoadBalancerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerOptions, - "createLoadBalancerOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancer"); + @Deprecated + public ServiceCall createVpcRoute(CreateVpcRouteOptions createVpcRouteOptions) { + LOGGER.warning("A deprecated operation has been invoked: createVpcRoute"); + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcRouteOptions, + "createVpcRouteOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpc_id", createVpcRouteOptions.vpcId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -13288,66 +13809,51 @@ public ServiceCall createLoadBalancer(CreateLoadBalancerOptions cr builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("is_public", createLoadBalancerOptions.isPublic()); - contentJson.add("subnets", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.subnets())); - if (createLoadBalancerOptions.dns() != null) { - contentJson.add("dns", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.dns())); - } - if (createLoadBalancerOptions.isPrivatePath() != null) { - contentJson.addProperty("is_private_path", createLoadBalancerOptions.isPrivatePath()); - } - if (createLoadBalancerOptions.listeners() != null) { - contentJson.add("listeners", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.listeners())); - } - if (createLoadBalancerOptions.logging() != null) { - contentJson.add("logging", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.logging())); - } - if (createLoadBalancerOptions.name() != null) { - contentJson.addProperty("name", createLoadBalancerOptions.name()); - } - if (createLoadBalancerOptions.pools() != null) { - contentJson.add("pools", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.pools())); + contentJson.addProperty("destination", createVpcRouteOptions.destination()); + contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRouteOptions.zone())); + if (createVpcRouteOptions.action() != null) { + contentJson.addProperty("action", createVpcRouteOptions.action()); } - if (createLoadBalancerOptions.profile() != null) { - contentJson.add("profile", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.profile())); + if (createVpcRouteOptions.advertise() != null) { + contentJson.addProperty("advertise", createVpcRouteOptions.advertise()); } - if (createLoadBalancerOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.resourceGroup())); + if (createVpcRouteOptions.name() != null) { + contentJson.addProperty("name", createVpcRouteOptions.name()); } - if (createLoadBalancerOptions.routeMode() != null) { - contentJson.addProperty("route_mode", createLoadBalancerOptions.routeMode()); + if (createVpcRouteOptions.nextHop() != null) { + contentJson.add("next_hop", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRouteOptions.nextHop())); } - if (createLoadBalancerOptions.securityGroups() != null) { - contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerOptions.securityGroups())); + if (createVpcRouteOptions.priority() != null) { + contentJson.addProperty("priority", createVpcRouteOptions.priority()); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a load balancer. + * Delete a VPC route. * - * This request deletes a load balancer. This operation cannot be reversed. A load balancer cannot be deleted if its - * `provisioning_status` is `delete_pending` or it is referenced by a resource. + * This request deletes a route. This operation cannot be reversed. * - * @param deleteLoadBalancerOptions the {@link DeleteLoadBalancerOptions} containing the options for the call + * @param deleteVpcRouteOptions the {@link DeleteVpcRouteOptions} containing the options for the call * @return a {@link ServiceCall} with a void result + * @deprecated this method is deprecated and may be removed in a future release */ - public ServiceCall deleteLoadBalancer(DeleteLoadBalancerOptions deleteLoadBalancerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerOptions, - "deleteLoadBalancerOptions cannot be null"); + @Deprecated + public ServiceCall deleteVpcRoute(DeleteVpcRouteOptions deleteVpcRouteOptions) { + LOGGER.warning("A deprecated operation has been invoked: deleteVpcRoute"); + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcRouteOptions, + "deleteVpcRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteLoadBalancerOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancer"); + pathParamsMap.put("vpc_id", deleteVpcRouteOptions.vpcId()); + pathParamsMap.put("id", deleteVpcRouteOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - if (deleteLoadBalancerOptions.ifMatch() != null) { - builder.header("If-Match", deleteLoadBalancerOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); @@ -13355,130 +13861,124 @@ public ServiceCall deleteLoadBalancer(DeleteLoadBalancerOptions deleteLoad } /** - * Retrieve a load balancer. - * - * This request retrieves a single load balancer specified by the identifier in the URL path. - * - * @param getLoadBalancerOptions the {@link GetLoadBalancerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancer} - */ - public ServiceCall getLoadBalancer(GetLoadBalancerOptions getLoadBalancerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerOptions, - "getLoadBalancerOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getLoadBalancerOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancer"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update a load balancer. + * Retrieve a VPC route. * - * This request updates a load balancer with the information in a provided load balancer patch. The load balancer - * patch object is structured in the same way as a retrieved load balancer and contains only the information to be - * updated. A load balancer can only be updated if its `provisioning_status` is `active`. + * This request retrieves a single route specified by the identifier in the URL. * - * @param updateLoadBalancerOptions the {@link UpdateLoadBalancerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancer} + * @param getVpcRouteOptions the {@link GetVpcRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Route} + * @deprecated this method is deprecated and may be removed in a future release */ - public ServiceCall updateLoadBalancer(UpdateLoadBalancerOptions updateLoadBalancerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerOptions, - "updateLoadBalancerOptions cannot be null"); + @Deprecated + public ServiceCall getVpcRoute(GetVpcRouteOptions getVpcRouteOptions) { + LOGGER.warning("A deprecated operation has been invoked: getVpcRoute"); + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcRouteOptions, + "getVpcRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateLoadBalancerOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancer"); + pathParamsMap.put("vpc_id", getVpcRouteOptions.vpcId()); + pathParamsMap.put("id", getVpcRouteOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); - if (updateLoadBalancerOptions.ifMatch() != null) { - builder.header("If-Match", updateLoadBalancerOptions.ifMatch()); - } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerOptions.loadBalancerPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List statistics of a load balancer. + * Update a VPC route. * - * This request lists statistics of a load balancer. + * This request updates a route with the information in a provided route patch. The route patch object is structured + * in the same way as a retrieved route and contains only the information to be updated. * - * @param getLoadBalancerStatisticsOptions the {@link GetLoadBalancerStatisticsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerStatistics} + * @param updateVpcRouteOptions the {@link UpdateVpcRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Route} + * @deprecated this method is deprecated and may be removed in a future release */ - public ServiceCall getLoadBalancerStatistics(GetLoadBalancerStatisticsOptions getLoadBalancerStatisticsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerStatisticsOptions, - "getLoadBalancerStatisticsOptions cannot be null"); + @Deprecated + public ServiceCall updateVpcRoute(UpdateVpcRouteOptions updateVpcRouteOptions) { + LOGGER.warning("A deprecated operation has been invoked: updateVpcRoute"); + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcRouteOptions, + "updateVpcRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getLoadBalancerStatisticsOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{id}/statistics", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerStatistics"); + pathParamsMap.put("vpc_id", updateVpcRouteOptions.vpcId()); + pathParamsMap.put("id", updateVpcRouteOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcRouteOptions.routePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List listeners for a load balancer. + * List routing tables for a VPC. * - * This request lists listeners for a load balancer. + * This request lists routing tables for a VPC. Each subnet in a VPC is associated with a routing table, which + * controls delivery of packets sent on that subnet according to the action of the most specific matching route in the + * table. If multiple equally-specific routes exist, traffic will be distributed across them. If no routes match, + * delivery will be controlled by the system's built-in routes. * - * @param listLoadBalancerListenersOptions the {@link ListLoadBalancerListenersOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerCollection} + * @param listVpcRoutingTablesOptions the {@link ListVpcRoutingTablesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RoutingTableCollection} */ - public ServiceCall listLoadBalancerListeners(ListLoadBalancerListenersOptions listLoadBalancerListenersOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerListenersOptions, - "listLoadBalancerListenersOptions cannot be null"); + public ServiceCall listVpcRoutingTables(ListVpcRoutingTablesOptions listVpcRoutingTablesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcRoutingTablesOptions, + "listVpcRoutingTablesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", listLoadBalancerListenersOptions.loadBalancerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerListeners"); + pathParamsMap.put("vpc_id", listVpcRoutingTablesOptions.vpcId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcRoutingTables"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listVpcRoutingTablesOptions.start() != null) { + builder.query("start", String.valueOf(listVpcRoutingTablesOptions.start())); + } + if (listVpcRoutingTablesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpcRoutingTablesOptions.limit())); + } + if (listVpcRoutingTablesOptions.isDefault() != null) { + builder.query("is_default", String.valueOf(listVpcRoutingTablesOptions.isDefault())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a listener for a load balancer. + * Create a routing table for a VPC. * - * This request creates a new listener for a load balancer. + * This request creates a routing table from a routing table prototype object. The prototype object is structured in + * the same way as a retrieved routing table, and contains the information necessary to create the new routing table. * - * @param createLoadBalancerListenerOptions the {@link CreateLoadBalancerListenerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListener} + * At present, the routing table's `resource_group` will be inherited from its VPC, but may be specifiable in the + * future. + * + * @param createVpcRoutingTableOptions the {@link CreateVpcRoutingTableOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RoutingTable} */ - public ServiceCall createLoadBalancerListener(CreateLoadBalancerListenerOptions createLoadBalancerListenerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerListenerOptions, - "createLoadBalancerListenerOptions cannot be null"); + public ServiceCall createVpcRoutingTable(CreateVpcRoutingTableOptions createVpcRoutingTableOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcRoutingTableOptions, + "createVpcRoutingTableOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", createLoadBalancerListenerOptions.loadBalancerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerListener"); + pathParamsMap.put("vpc_id", createVpcRoutingTableOptions.vpcId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcRoutingTable"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -13486,63 +13986,59 @@ public ServiceCall createLoadBalancerListener(CreateLoadBa builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("protocol", createLoadBalancerListenerOptions.protocol()); - if (createLoadBalancerListenerOptions.acceptProxyProtocol() != null) { - contentJson.addProperty("accept_proxy_protocol", createLoadBalancerListenerOptions.acceptProxyProtocol()); - } - if (createLoadBalancerListenerOptions.certificateInstance() != null) { - contentJson.add("certificate_instance", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerOptions.certificateInstance())); - } - if (createLoadBalancerListenerOptions.connectionLimit() != null) { - contentJson.addProperty("connection_limit", createLoadBalancerListenerOptions.connectionLimit()); + if (createVpcRoutingTableOptions.acceptRoutesFrom() != null) { + contentJson.add("accept_routes_from", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableOptions.acceptRoutesFrom())); } - if (createLoadBalancerListenerOptions.defaultPool() != null) { - contentJson.add("default_pool", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerOptions.defaultPool())); + if (createVpcRoutingTableOptions.advertiseRoutesTo() != null) { + contentJson.add("advertise_routes_to", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableOptions.advertiseRoutesTo())); } - if (createLoadBalancerListenerOptions.httpsRedirect() != null) { - contentJson.add("https_redirect", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerOptions.httpsRedirect())); + if (createVpcRoutingTableOptions.name() != null) { + contentJson.addProperty("name", createVpcRoutingTableOptions.name()); } - if (createLoadBalancerListenerOptions.idleConnectionTimeout() != null) { - contentJson.addProperty("idle_connection_timeout", createLoadBalancerListenerOptions.idleConnectionTimeout()); + if (createVpcRoutingTableOptions.routeDirectLinkIngress() != null) { + contentJson.addProperty("route_direct_link_ingress", createVpcRoutingTableOptions.routeDirectLinkIngress()); } - if (createLoadBalancerListenerOptions.policies() != null) { - contentJson.add("policies", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerOptions.policies())); + if (createVpcRoutingTableOptions.routeInternetIngress() != null) { + contentJson.addProperty("route_internet_ingress", createVpcRoutingTableOptions.routeInternetIngress()); } - if (createLoadBalancerListenerOptions.port() != null) { - contentJson.addProperty("port", createLoadBalancerListenerOptions.port()); + if (createVpcRoutingTableOptions.routeTransitGatewayIngress() != null) { + contentJson.addProperty("route_transit_gateway_ingress", createVpcRoutingTableOptions.routeTransitGatewayIngress()); } - if (createLoadBalancerListenerOptions.portMax() != null) { - contentJson.addProperty("port_max", createLoadBalancerListenerOptions.portMax()); + if (createVpcRoutingTableOptions.routeVpcZoneIngress() != null) { + contentJson.addProperty("route_vpc_zone_ingress", createVpcRoutingTableOptions.routeVpcZoneIngress()); } - if (createLoadBalancerListenerOptions.portMin() != null) { - contentJson.addProperty("port_min", createLoadBalancerListenerOptions.portMin()); + if (createVpcRoutingTableOptions.routes() != null) { + contentJson.add("routes", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableOptions.routes())); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a load balancer listener. + * Delete a VPC routing table. * - * This request deletes a load balancer listener. This operation cannot be reversed. For this operation to succeed, - * the listener must not be the target of another load balancer listener. + * This request deletes a routing table. A routing table cannot be deleted if it is associated with any subnets in + * the VPC. Additionally, a VPC's default routing table cannot be deleted. This operation cannot be reversed. * - * @param deleteLoadBalancerListenerOptions the {@link DeleteLoadBalancerListenerOptions} containing the options for the call + * @param deleteVpcRoutingTableOptions the {@link DeleteVpcRoutingTableOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteLoadBalancerListener(DeleteLoadBalancerListenerOptions deleteLoadBalancerListenerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerListenerOptions, - "deleteLoadBalancerListenerOptions cannot be null"); + public ServiceCall deleteVpcRoutingTable(DeleteVpcRoutingTableOptions deleteVpcRoutingTableOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcRoutingTableOptions, + "deleteVpcRoutingTableOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", deleteLoadBalancerListenerOptions.loadBalancerId()); - pathParamsMap.put("id", deleteLoadBalancerListenerOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerListener"); + pathParamsMap.put("vpc_id", deleteVpcRoutingTableOptions.vpcId()); + pathParamsMap.put("id", deleteVpcRoutingTableOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcRoutingTable"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + if (deleteVpcRoutingTableOptions.ifMatch() != null) { + builder.header("If-Match", deleteVpcRoutingTableOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); @@ -13550,106 +14046,118 @@ public ServiceCall deleteLoadBalancerListener(DeleteLoadBalancerListenerOp } /** - * Retrieve a load balancer listener. + * Retrieve a VPC routing table. * - * This request retrieves a single listener specified by the identifier in the URL path. + * This request retrieves a single routing table specified by the identifier in the URL. * - * @param getLoadBalancerListenerOptions the {@link GetLoadBalancerListenerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListener} + * @param getVpcRoutingTableOptions the {@link GetVpcRoutingTableOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RoutingTable} */ - public ServiceCall getLoadBalancerListener(GetLoadBalancerListenerOptions getLoadBalancerListenerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerListenerOptions, - "getLoadBalancerListenerOptions cannot be null"); + public ServiceCall getVpcRoutingTable(GetVpcRoutingTableOptions getVpcRoutingTableOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcRoutingTableOptions, + "getVpcRoutingTableOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", getLoadBalancerListenerOptions.loadBalancerId()); - pathParamsMap.put("id", getLoadBalancerListenerOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerListener"); + pathParamsMap.put("vpc_id", getVpcRoutingTableOptions.vpcId()); + pathParamsMap.put("id", getVpcRoutingTableOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcRoutingTable"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a load balancer listener. + * Update a VPC routing table. * - * This request updates a load balancer listener from a listener patch. + * This request updates a routing table with the information in a provided routing table patch. The patch object is + * structured in the same way as a retrieved table and contains only the information to be updated. * - * @param updateLoadBalancerListenerOptions the {@link UpdateLoadBalancerListenerOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListener} + * @param updateVpcRoutingTableOptions the {@link UpdateVpcRoutingTableOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RoutingTable} */ - public ServiceCall updateLoadBalancerListener(UpdateLoadBalancerListenerOptions updateLoadBalancerListenerOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerListenerOptions, - "updateLoadBalancerListenerOptions cannot be null"); + public ServiceCall updateVpcRoutingTable(UpdateVpcRoutingTableOptions updateVpcRoutingTableOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcRoutingTableOptions, + "updateVpcRoutingTableOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", updateLoadBalancerListenerOptions.loadBalancerId()); - pathParamsMap.put("id", updateLoadBalancerListenerOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerListener"); + pathParamsMap.put("vpc_id", updateVpcRoutingTableOptions.vpcId()); + pathParamsMap.put("id", updateVpcRoutingTableOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcRoutingTable"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateVpcRoutingTableOptions.ifMatch() != null) { + builder.header("If-Match", updateVpcRoutingTableOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerListenerOptions.loadBalancerListenerPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcRoutingTableOptions.routingTablePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List policies for a load balancer listener. + * List routes in a VPC routing table. * - * This request lists policies for a load balancer listener. A policy consists of rules to match against each incoming - * request, and an action to apply to the request if a rule matches. + * This request lists routes in a VPC routing table. If subnets are associated with this routing table, delivery of + * packets sent on a subnet is performed according to the action of the most specific matching route in the table + * (provided the subnet and route are in the same zone). If multiple equally-specific routes exist, the route with the + * highest priority will be used. If two matching routes have the same destination and priority, traffic will be + * distributed between them. If no routes match, delivery will be controlled by the system's built-in routes. * - * @param listLoadBalancerListenerPoliciesOptions the {@link ListLoadBalancerListenerPoliciesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyCollection} + * @param listVpcRoutingTableRoutesOptions the {@link ListVpcRoutingTableRoutesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link RouteCollection} */ - public ServiceCall listLoadBalancerListenerPolicies(ListLoadBalancerListenerPoliciesOptions listLoadBalancerListenerPoliciesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerListenerPoliciesOptions, - "listLoadBalancerListenerPoliciesOptions cannot be null"); + public ServiceCall listVpcRoutingTableRoutes(ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpcRoutingTableRoutesOptions, + "listVpcRoutingTableRoutesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", listLoadBalancerListenerPoliciesOptions.loadBalancerId()); - pathParamsMap.put("listener_id", listLoadBalancerListenerPoliciesOptions.listenerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerListenerPolicies"); + pathParamsMap.put("vpc_id", listVpcRoutingTableRoutesOptions.vpcId()); + pathParamsMap.put("routing_table_id", listVpcRoutingTableRoutesOptions.routingTableId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpcRoutingTableRoutes"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listVpcRoutingTableRoutesOptions.start() != null) { + builder.query("start", String.valueOf(listVpcRoutingTableRoutesOptions.start())); + } + if (listVpcRoutingTableRoutesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpcRoutingTableRoutesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a policy for a load balancer listener. + * Create a route in a VPC routing table. * - * 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 load balancer must be in the `application` family. + * This request creates a new VPC route from a VPC route prototype object. The prototype object is structured in the + * same way as a retrieved VPC route and contains the information necessary to create the route. * - * @param createLoadBalancerListenerPolicyOptions the {@link CreateLoadBalancerListenerPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy} + * @param createVpcRoutingTableRouteOptions the {@link CreateVpcRoutingTableRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Route} */ - public ServiceCall createLoadBalancerListenerPolicy(CreateLoadBalancerListenerPolicyOptions createLoadBalancerListenerPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerListenerPolicyOptions, - "createLoadBalancerListenerPolicyOptions cannot be null"); + public ServiceCall createVpcRoutingTableRoute(CreateVpcRoutingTableRouteOptions createVpcRoutingTableRouteOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpcRoutingTableRouteOptions, + "createVpcRoutingTableRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", createLoadBalancerListenerPolicyOptions.loadBalancerId()); - pathParamsMap.put("listener_id", createLoadBalancerListenerPolicyOptions.listenerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerListenerPolicy"); + pathParamsMap.put("vpc_id", createVpcRoutingTableRouteOptions.vpcId()); + pathParamsMap.put("routing_table_id", createVpcRoutingTableRouteOptions.routingTableId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpcRoutingTableRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -13657,40 +14165,47 @@ public ServiceCall createLoadBalancerListenerPolicy( builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("action", createLoadBalancerListenerPolicyOptions.action()); - contentJson.addProperty("priority", createLoadBalancerListenerPolicyOptions.priority()); - if (createLoadBalancerListenerPolicyOptions.name() != null) { - contentJson.addProperty("name", createLoadBalancerListenerPolicyOptions.name()); + contentJson.addProperty("destination", createVpcRoutingTableRouteOptions.destination()); + contentJson.add("zone", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableRouteOptions.zone())); + if (createVpcRoutingTableRouteOptions.action() != null) { + contentJson.addProperty("action", createVpcRoutingTableRouteOptions.action()); + } + if (createVpcRoutingTableRouteOptions.advertise() != null) { + contentJson.addProperty("advertise", createVpcRoutingTableRouteOptions.advertise()); } - if (createLoadBalancerListenerPolicyOptions.rules() != null) { - contentJson.add("rules", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerPolicyOptions.rules())); + if (createVpcRoutingTableRouteOptions.name() != null) { + contentJson.addProperty("name", createVpcRoutingTableRouteOptions.name()); } - if (createLoadBalancerListenerPolicyOptions.target() != null) { - contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerListenerPolicyOptions.target())); + if (createVpcRoutingTableRouteOptions.nextHop() != null) { + contentJson.add("next_hop", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpcRoutingTableRouteOptions.nextHop())); + } + if (createVpcRoutingTableRouteOptions.priority() != null) { + contentJson.addProperty("priority", createVpcRoutingTableRouteOptions.priority()); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a load balancer listener policy. + * Delete a VPC routing table route. * - * Deletes a policy of the load balancer listener. This operation cannot be reversed. + * This request deletes a VPC route. This operation cannot be reversed. Only VPC routes with an `origin` of `user` are + * allowed to be deleted. * - * @param deleteLoadBalancerListenerPolicyOptions the {@link DeleteLoadBalancerListenerPolicyOptions} containing the options for the call + * @param deleteVpcRoutingTableRouteOptions the {@link DeleteVpcRoutingTableRouteOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteLoadBalancerListenerPolicy(DeleteLoadBalancerListenerPolicyOptions deleteLoadBalancerListenerPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerListenerPolicyOptions, - "deleteLoadBalancerListenerPolicyOptions cannot be null"); + public ServiceCall deleteVpcRoutingTableRoute(DeleteVpcRoutingTableRouteOptions deleteVpcRoutingTableRouteOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpcRoutingTableRouteOptions, + "deleteVpcRoutingTableRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", deleteLoadBalancerListenerPolicyOptions.loadBalancerId()); - pathParamsMap.put("listener_id", deleteLoadBalancerListenerPolicyOptions.listenerId()); - pathParamsMap.put("id", deleteLoadBalancerListenerPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerListenerPolicy"); + pathParamsMap.put("vpc_id", deleteVpcRoutingTableRouteOptions.vpcId()); + pathParamsMap.put("routing_table_id", deleteVpcRoutingTableRouteOptions.routingTableId()); + pathParamsMap.put("id", deleteVpcRoutingTableRouteOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpcRoutingTableRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -13701,108 +14216,119 @@ public ServiceCall deleteLoadBalancerListenerPolicy(DeleteLoadBalancerList } /** - * Retrieve a load balancer listener policy. + * Retrieve a VPC routing table route. * - * Retrieve a single policy specified by the identifier in the URL path. + * This request retrieves a single VPC route specified by the identifier in the URL path. * - * @param getLoadBalancerListenerPolicyOptions the {@link GetLoadBalancerListenerPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy} + * @param getVpcRoutingTableRouteOptions the {@link GetVpcRoutingTableRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Route} */ - public ServiceCall getLoadBalancerListenerPolicy(GetLoadBalancerListenerPolicyOptions getLoadBalancerListenerPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerListenerPolicyOptions, - "getLoadBalancerListenerPolicyOptions cannot be null"); + public ServiceCall getVpcRoutingTableRoute(GetVpcRoutingTableRouteOptions getVpcRoutingTableRouteOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpcRoutingTableRouteOptions, + "getVpcRoutingTableRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", getLoadBalancerListenerPolicyOptions.loadBalancerId()); - pathParamsMap.put("listener_id", getLoadBalancerListenerPolicyOptions.listenerId()); - pathParamsMap.put("id", getLoadBalancerListenerPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerListenerPolicy"); + pathParamsMap.put("vpc_id", getVpcRoutingTableRouteOptions.vpcId()); + pathParamsMap.put("routing_table_id", getVpcRoutingTableRouteOptions.routingTableId()); + pathParamsMap.put("id", getVpcRoutingTableRouteOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpcRoutingTableRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a load balancer listener policy. + * Update a VPC routing table route. * - * This request updates a load balancer listener policy with the information in a provided policy patch. The policy - * patch object is structured in the same way as a retrieved policy and contains only the information to be updated. + * This request updates a VPC route with the information provided in a route patch object. The patch object is + * structured in the same way as a retrieved VPC route and needs to contain only the information to be updated. Only + * VPC routes with an `origin` of `user` are allowed to be updated. * - * @param updateLoadBalancerListenerPolicyOptions the {@link UpdateLoadBalancerListenerPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicy} + * @param updateVpcRoutingTableRouteOptions the {@link UpdateVpcRoutingTableRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Route} */ - public ServiceCall updateLoadBalancerListenerPolicy(UpdateLoadBalancerListenerPolicyOptions updateLoadBalancerListenerPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerListenerPolicyOptions, - "updateLoadBalancerListenerPolicyOptions cannot be null"); + public ServiceCall updateVpcRoutingTableRoute(UpdateVpcRoutingTableRouteOptions updateVpcRoutingTableRouteOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpcRoutingTableRouteOptions, + "updateVpcRoutingTableRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", updateLoadBalancerListenerPolicyOptions.loadBalancerId()); - pathParamsMap.put("listener_id", updateLoadBalancerListenerPolicyOptions.listenerId()); - pathParamsMap.put("id", updateLoadBalancerListenerPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerListenerPolicy"); + pathParamsMap.put("vpc_id", updateVpcRoutingTableRouteOptions.vpcId()); + pathParamsMap.put("routing_table_id", updateVpcRoutingTableRouteOptions.routingTableId()); + pathParamsMap.put("id", updateVpcRoutingTableRouteOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpcs/{vpc_id}/routing_tables/{routing_table_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpcRoutingTableRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerListenerPolicyOptions.loadBalancerListenerPolicyPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpcRoutingTableRouteOptions.routePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List rules of a load balancer listener policy. + * List IKE policies. * - * This request lists rules of a load balancer listener policy. + * This request lists IKE policies in the region. * - * @param listLoadBalancerListenerPolicyRulesOptions the {@link ListLoadBalancerListenerPolicyRulesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyRuleCollection} + * @param listIkePoliciesOptions the {@link ListIkePoliciesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IKEPolicyCollection} */ - public ServiceCall listLoadBalancerListenerPolicyRules(ListLoadBalancerListenerPolicyRulesOptions listLoadBalancerListenerPolicyRulesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerListenerPolicyRulesOptions, - "listLoadBalancerListenerPolicyRulesOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", listLoadBalancerListenerPolicyRulesOptions.loadBalancerId()); - pathParamsMap.put("listener_id", listLoadBalancerListenerPolicyRulesOptions.listenerId()); - pathParamsMap.put("policy_id", listLoadBalancerListenerPolicyRulesOptions.policyId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerListenerPolicyRules"); + public ServiceCall listIkePolicies(ListIkePoliciesOptions listIkePoliciesOptions) { + if (listIkePoliciesOptions == null) { + listIkePoliciesOptions = new ListIkePoliciesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listIkePolicies"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listIkePoliciesOptions.start() != null) { + builder.query("start", String.valueOf(listIkePoliciesOptions.start())); + } + if (listIkePoliciesOptions.limit() != null) { + builder.query("limit", String.valueOf(listIkePoliciesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a rule for a load balancer listener policy. + * List IKE policies. * - * Creates a new rule for the load balancer listener policy. + * This request lists IKE policies in the region. * - * @param createLoadBalancerListenerPolicyRuleOptions the {@link CreateLoadBalancerListenerPolicyRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyRule} + * @return a {@link ServiceCall} with a result of type {@link IKEPolicyCollection} */ - public ServiceCall createLoadBalancerListenerPolicyRule(CreateLoadBalancerListenerPolicyRuleOptions createLoadBalancerListenerPolicyRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerListenerPolicyRuleOptions, - "createLoadBalancerListenerPolicyRuleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", createLoadBalancerListenerPolicyRuleOptions.loadBalancerId()); - pathParamsMap.put("listener_id", createLoadBalancerListenerPolicyRuleOptions.listenerId()); - pathParamsMap.put("policy_id", createLoadBalancerListenerPolicyRuleOptions.policyId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerListenerPolicyRule"); + public ServiceCall listIkePolicies() { + return listIkePolicies(null); + } + + /** + * Create an IKE policy. + * + * This request creates a new IKE policy. + * + * @param createIkePolicyOptions the {@link CreateIkePolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IKEPolicy} + */ + public ServiceCall createIkePolicy(CreateIkePolicyOptions createIkePolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createIkePolicyOptions, + "createIkePolicyOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createIkePolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -13810,36 +14336,41 @@ public ServiceCall createLoadBalancerListenerPol builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("condition", createLoadBalancerListenerPolicyRuleOptions.condition()); - contentJson.addProperty("type", createLoadBalancerListenerPolicyRuleOptions.type()); - contentJson.addProperty("value", createLoadBalancerListenerPolicyRuleOptions.value()); - if (createLoadBalancerListenerPolicyRuleOptions.field() != null) { - contentJson.addProperty("field", createLoadBalancerListenerPolicyRuleOptions.field()); + contentJson.addProperty("authentication_algorithm", createIkePolicyOptions.authenticationAlgorithm()); + contentJson.addProperty("dh_group", createIkePolicyOptions.dhGroup()); + contentJson.addProperty("encryption_algorithm", createIkePolicyOptions.encryptionAlgorithm()); + contentJson.addProperty("ike_version", createIkePolicyOptions.ikeVersion()); + if (createIkePolicyOptions.keyLifetime() != null) { + contentJson.addProperty("key_lifetime", createIkePolicyOptions.keyLifetime()); + } + if (createIkePolicyOptions.name() != null) { + contentJson.addProperty("name", createIkePolicyOptions.name()); + } + if (createIkePolicyOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createIkePolicyOptions.resourceGroup())); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a load balancer listener policy rule. + * Delete an IKE policy. * - * Deletes a rule from the load balancer listener policy. This operation cannot be reversed. + * This request deletes an IKE policy. This operation cannot be reversed. For this request to succeed, there must not + * be any VPN gateway connections using this policy. * - * @param deleteLoadBalancerListenerPolicyRuleOptions the {@link DeleteLoadBalancerListenerPolicyRuleOptions} containing the options for the call + * @param deleteIkePolicyOptions the {@link DeleteIkePolicyOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteLoadBalancerListenerPolicyRule(DeleteLoadBalancerListenerPolicyRuleOptions deleteLoadBalancerListenerPolicyRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerListenerPolicyRuleOptions, - "deleteLoadBalancerListenerPolicyRuleOptions cannot be null"); + public ServiceCall deleteIkePolicy(DeleteIkePolicyOptions deleteIkePolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteIkePolicyOptions, + "deleteIkePolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", deleteLoadBalancerListenerPolicyRuleOptions.loadBalancerId()); - pathParamsMap.put("listener_id", deleteLoadBalancerListenerPolicyRuleOptions.listenerId()); - pathParamsMap.put("policy_id", deleteLoadBalancerListenerPolicyRuleOptions.policyId()); - pathParamsMap.put("id", deleteLoadBalancerListenerPolicyRuleOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerListenerPolicyRule"); + pathParamsMap.put("id", deleteIkePolicyOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteIkePolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -13850,105 +14381,145 @@ public ServiceCall deleteLoadBalancerListenerPolicyRule(DeleteLoadBalancer } /** - * Retrieve a load balancer listener policy rule. + * Retrieve an IKE policy. * - * Retrieves a single rule specified by the identifier in the URL path. + * This request retrieves a single IKE policy specified by the identifier in the URL. * - * @param getLoadBalancerListenerPolicyRuleOptions the {@link GetLoadBalancerListenerPolicyRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyRule} + * @param getIkePolicyOptions the {@link GetIkePolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IKEPolicy} */ - public ServiceCall getLoadBalancerListenerPolicyRule(GetLoadBalancerListenerPolicyRuleOptions getLoadBalancerListenerPolicyRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerListenerPolicyRuleOptions, - "getLoadBalancerListenerPolicyRuleOptions cannot be null"); + public ServiceCall getIkePolicy(GetIkePolicyOptions getIkePolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getIkePolicyOptions, + "getIkePolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", getLoadBalancerListenerPolicyRuleOptions.loadBalancerId()); - pathParamsMap.put("listener_id", getLoadBalancerListenerPolicyRuleOptions.listenerId()); - pathParamsMap.put("policy_id", getLoadBalancerListenerPolicyRuleOptions.policyId()); - pathParamsMap.put("id", getLoadBalancerListenerPolicyRuleOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerListenerPolicyRule"); + pathParamsMap.put("id", getIkePolicyOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getIkePolicy"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Update an IKE policy. + * + * This request updates the properties of an existing IKE policy. + * + * @param updateIkePolicyOptions the {@link UpdateIkePolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IKEPolicy} + */ + public ServiceCall updateIkePolicy(UpdateIkePolicyOptions updateIkePolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateIkePolicyOptions, + "updateIkePolicyOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("id", updateIkePolicyOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateIkePolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateIkePolicyOptions.ikePolicyPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a load balancer listener policy rule. + * List VPN gateway connections that use a specified IKE policy. * - * Updates a rule of the load balancer listener policy. + * This request lists VPN gateway connections that use an IKE policy. * - * @param updateLoadBalancerListenerPolicyRuleOptions the {@link UpdateLoadBalancerListenerPolicyRuleOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerListenerPolicyRule} + * @param listIkePolicyConnectionsOptions the {@link ListIkePolicyConnectionsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IKEPolicyConnectionCollection} */ - public ServiceCall updateLoadBalancerListenerPolicyRule(UpdateLoadBalancerListenerPolicyRuleOptions updateLoadBalancerListenerPolicyRuleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerListenerPolicyRuleOptions, - "updateLoadBalancerListenerPolicyRuleOptions cannot be null"); + public ServiceCall listIkePolicyConnections(ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listIkePolicyConnectionsOptions, + "listIkePolicyConnectionsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", updateLoadBalancerListenerPolicyRuleOptions.loadBalancerId()); - pathParamsMap.put("listener_id", updateLoadBalancerListenerPolicyRuleOptions.listenerId()); - pathParamsMap.put("policy_id", updateLoadBalancerListenerPolicyRuleOptions.policyId()); - pathParamsMap.put("id", updateLoadBalancerListenerPolicyRuleOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerListenerPolicyRule"); + pathParamsMap.put("id", listIkePolicyConnectionsOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ike_policies/{id}/connections", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listIkePolicyConnections"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerListenerPolicyRuleOptions.loadBalancerListenerPolicyRulePatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listIkePolicyConnectionsOptions.start() != null) { + builder.query("start", String.valueOf(listIkePolicyConnectionsOptions.start())); + } + if (listIkePolicyConnectionsOptions.limit() != null) { + builder.query("limit", String.valueOf(listIkePolicyConnectionsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List pools of a load balancer. + * List IPsec policies. * - * This request lists pools of a load balancer. + * This request lists IPsec policies in the region. * - * @param listLoadBalancerPoolsOptions the {@link ListLoadBalancerPoolsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolCollection} + * @param listIpsecPoliciesOptions the {@link ListIpsecPoliciesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IPsecPolicyCollection} */ - public ServiceCall listLoadBalancerPools(ListLoadBalancerPoolsOptions listLoadBalancerPoolsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerPoolsOptions, - "listLoadBalancerPoolsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", listLoadBalancerPoolsOptions.loadBalancerId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerPools"); + public ServiceCall listIpsecPolicies(ListIpsecPoliciesOptions listIpsecPoliciesOptions) { + if (listIpsecPoliciesOptions == null) { + listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listIpsecPolicies"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listIpsecPoliciesOptions.start() != null) { + builder.query("start", String.valueOf(listIpsecPoliciesOptions.start())); + } + if (listIpsecPoliciesOptions.limit() != null) { + builder.query("limit", String.valueOf(listIpsecPoliciesOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a load balancer pool. + * List IPsec policies. * - * This request creates a new pool from a pool prototype object. + * This request lists IPsec policies in the region. * - * @param createLoadBalancerPoolOptions the {@link CreateLoadBalancerPoolOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPool} + * @return a {@link ServiceCall} with a result of type {@link IPsecPolicyCollection} */ - public ServiceCall createLoadBalancerPool(CreateLoadBalancerPoolOptions createLoadBalancerPoolOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerPoolOptions, - "createLoadBalancerPoolOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", createLoadBalancerPoolOptions.loadBalancerId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerPool"); + public ServiceCall listIpsecPolicies() { + return listIpsecPolicies(null); + } + + /** + * Create an IPsec policy. + * + * This request creates a new IPsec policy. + * + * @param createIpsecPolicyOptions the {@link CreateIpsecPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IPsecPolicy} + */ + public ServiceCall createIpsecPolicy(CreateIpsecPolicyOptions createIpsecPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createIpsecPolicyOptions, + "createIpsecPolicyOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createIpsecPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -13956,48 +14527,40 @@ public ServiceCall createLoadBalancerPool(CreateLoadBalancerPo builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("algorithm", createLoadBalancerPoolOptions.algorithm()); - contentJson.add("health_monitor", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolOptions.healthMonitor())); - contentJson.addProperty("protocol", createLoadBalancerPoolOptions.protocol()); - if (createLoadBalancerPoolOptions.failsafePolicy() != null) { - contentJson.add("failsafe_policy", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolOptions.failsafePolicy())); - } - if (createLoadBalancerPoolOptions.members() != null) { - contentJson.add("members", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolOptions.members())); - } - if (createLoadBalancerPoolOptions.name() != null) { - contentJson.addProperty("name", createLoadBalancerPoolOptions.name()); + contentJson.addProperty("authentication_algorithm", createIpsecPolicyOptions.authenticationAlgorithm()); + contentJson.addProperty("encryption_algorithm", createIpsecPolicyOptions.encryptionAlgorithm()); + contentJson.addProperty("pfs", createIpsecPolicyOptions.pfs()); + if (createIpsecPolicyOptions.keyLifetime() != null) { + contentJson.addProperty("key_lifetime", createIpsecPolicyOptions.keyLifetime()); } - if (createLoadBalancerPoolOptions.proxyProtocol() != null) { - contentJson.addProperty("proxy_protocol", createLoadBalancerPoolOptions.proxyProtocol()); + if (createIpsecPolicyOptions.name() != null) { + contentJson.addProperty("name", createIpsecPolicyOptions.name()); } - if (createLoadBalancerPoolOptions.sessionPersistence() != null) { - contentJson.add("session_persistence", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolOptions.sessionPersistence())); + if (createIpsecPolicyOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createIpsecPolicyOptions.resourceGroup())); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a load balancer pool. + * Delete an IPsec policy. * - * This request deletes a load balancer pool. This operation cannot be reversed. The pool must not currently be the - * default pool for any listener in the load balancer, nor be the target pool in the failsafe policy for any other - * pool. + * This request deletes an IPsec policy. This operation cannot be reversed. For this request to succeed, there must + * not be any VPN gateway connections using this policy. * - * @param deleteLoadBalancerPoolOptions the {@link DeleteLoadBalancerPoolOptions} containing the options for the call + * @param deleteIpsecPolicyOptions the {@link DeleteIpsecPolicyOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteLoadBalancerPool(DeleteLoadBalancerPoolOptions deleteLoadBalancerPoolOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerPoolOptions, - "deleteLoadBalancerPoolOptions cannot be null"); + public ServiceCall deleteIpsecPolicy(DeleteIpsecPolicyOptions deleteIpsecPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteIpsecPolicyOptions, + "deleteIpsecPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", deleteLoadBalancerPoolOptions.loadBalancerId()); - pathParamsMap.put("id", deleteLoadBalancerPoolOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerPool"); + pathParamsMap.put("id", deleteIpsecPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteIpsecPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -14008,171 +14571,183 @@ public ServiceCall deleteLoadBalancerPool(DeleteLoadBalancerPoolOptions de } /** - * Retrieve a load balancer pool. + * Retrieve an IPsec policy. * - * This request retrieves a single pool specified by the identifier in the URL path. + * This request retrieves a single IPsec policy specified by the identifier in the URL. * - * @param getLoadBalancerPoolOptions the {@link GetLoadBalancerPoolOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPool} + * @param getIpsecPolicyOptions the {@link GetIpsecPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IPsecPolicy} */ - public ServiceCall getLoadBalancerPool(GetLoadBalancerPoolOptions getLoadBalancerPoolOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerPoolOptions, - "getLoadBalancerPoolOptions cannot be null"); + public ServiceCall getIpsecPolicy(GetIpsecPolicyOptions getIpsecPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getIpsecPolicyOptions, + "getIpsecPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", getLoadBalancerPoolOptions.loadBalancerId()); - pathParamsMap.put("id", getLoadBalancerPoolOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerPool"); + pathParamsMap.put("id", getIpsecPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getIpsecPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a load balancer pool. + * Update an IPsec policy. * - * This request updates a load balancer pool from a pool patch. + * This request updates the properties of an existing IPsec policy. * - * @param updateLoadBalancerPoolOptions the {@link UpdateLoadBalancerPoolOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPool} + * @param updateIpsecPolicyOptions the {@link UpdateIpsecPolicyOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IPsecPolicy} */ - public ServiceCall updateLoadBalancerPool(UpdateLoadBalancerPoolOptions updateLoadBalancerPoolOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerPoolOptions, - "updateLoadBalancerPoolOptions cannot be null"); + public ServiceCall updateIpsecPolicy(UpdateIpsecPolicyOptions updateIpsecPolicyOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateIpsecPolicyOptions, + "updateIpsecPolicyOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", updateLoadBalancerPoolOptions.loadBalancerId()); - pathParamsMap.put("id", updateLoadBalancerPoolOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerPool"); + pathParamsMap.put("id", updateIpsecPolicyOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateIpsecPolicy"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerPoolOptions.loadBalancerPoolPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateIpsecPolicyOptions.iPsecPolicyPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List members of a load balancer pool. + * List VPN gateway connections that use a specified IPsec policy. * - * This request lists members of a load balancer pool. + * This request lists VPN gateway connections that use an IPsec policy. * - * @param listLoadBalancerPoolMembersOptions the {@link ListLoadBalancerPoolMembersOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMemberCollection} + * @param listIpsecPolicyConnectionsOptions the {@link ListIpsecPolicyConnectionsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link IPsecPolicyConnectionCollection} */ - public ServiceCall listLoadBalancerPoolMembers(ListLoadBalancerPoolMembersOptions listLoadBalancerPoolMembersOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listLoadBalancerPoolMembersOptions, - "listLoadBalancerPoolMembersOptions cannot be null"); + public ServiceCall listIpsecPolicyConnections(ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listIpsecPolicyConnectionsOptions, + "listIpsecPolicyConnectionsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", listLoadBalancerPoolMembersOptions.loadBalancerId()); - pathParamsMap.put("pool_id", listLoadBalancerPoolMembersOptions.poolId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listLoadBalancerPoolMembers"); + pathParamsMap.put("id", listIpsecPolicyConnectionsOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/ipsec_policies/{id}/connections", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listIpsecPolicyConnections"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listIpsecPolicyConnectionsOptions.start() != null) { + builder.query("start", String.valueOf(listIpsecPolicyConnectionsOptions.start())); + } + if (listIpsecPolicyConnectionsOptions.limit() != null) { + builder.query("limit", String.valueOf(listIpsecPolicyConnectionsOptions.limit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create a member in a load balancer pool. - * - * This request creates a new member and adds the member to the pool. + * List VPN gateways. * - * The pool must not already have a member targeting a load balancer. + * This request lists VPN gateways in the region. * - * @param createLoadBalancerPoolMemberOptions the {@link CreateLoadBalancerPoolMemberOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember} + * @param listVpnGatewaysOptions the {@link ListVpnGatewaysOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayCollection} */ - public ServiceCall createLoadBalancerPoolMember(CreateLoadBalancerPoolMemberOptions createLoadBalancerPoolMemberOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createLoadBalancerPoolMemberOptions, - "createLoadBalancerPoolMemberOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", createLoadBalancerPoolMemberOptions.loadBalancerId()); - pathParamsMap.put("pool_id", createLoadBalancerPoolMemberOptions.poolId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createLoadBalancerPoolMember"); + public ServiceCall listVpnGateways(ListVpnGatewaysOptions listVpnGatewaysOptions) { + if (listVpnGatewaysOptions == null) { + listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGateways"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("port", createLoadBalancerPoolMemberOptions.port()); - contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createLoadBalancerPoolMemberOptions.target())); - if (createLoadBalancerPoolMemberOptions.weight() != null) { - contentJson.addProperty("weight", createLoadBalancerPoolMemberOptions.weight()); + if (listVpnGatewaysOptions.start() != null) { + builder.query("start", String.valueOf(listVpnGatewaysOptions.start())); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listVpnGatewaysOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpnGatewaysOptions.limit())); + } + if (listVpnGatewaysOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listVpnGatewaysOptions.resourceGroupId())); + } + if (listVpnGatewaysOptions.sort() != null) { + builder.query("sort", String.valueOf(listVpnGatewaysOptions.sort())); + } + if (listVpnGatewaysOptions.mode() != null) { + builder.query("mode", String.valueOf(listVpnGatewaysOptions.mode())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Replace load balancer pool members. + * List VPN gateways. * - * This request replaces the existing members of the load balancer pool with new members created from the collection - * of member prototype objects. + * This request lists VPN gateways in the region. * - * @param replaceLoadBalancerPoolMembersOptions the {@link ReplaceLoadBalancerPoolMembersOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMemberCollection} + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayCollection} */ - public ServiceCall replaceLoadBalancerPoolMembers(ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(replaceLoadBalancerPoolMembersOptions, - "replaceLoadBalancerPoolMembersOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", replaceLoadBalancerPoolMembersOptions.loadBalancerId()); - pathParamsMap.put("pool_id", replaceLoadBalancerPoolMembersOptions.poolId()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "replaceLoadBalancerPoolMembers"); + public ServiceCall listVpnGateways() { + return listVpnGateways(null); + } + + /** + * Create a VPN gateway. + * + * This request creates a new VPN gateway. + * + * @param createVpnGatewayOptions the {@link CreateVpnGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGateway} + */ + public ServiceCall createVpnGateway(CreateVpnGatewayOptions createVpnGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpnGatewayOptions, + "createVpnGatewayOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpnGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("members", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceLoadBalancerPoolMembersOptions.members())); - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createVpnGatewayOptions.vpnGatewayPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a load balancer pool member. + * Delete a VPN gateway. * - * This request deletes a member from the pool. This operation cannot be reversed. + * This request deletes a VPN gateway. This operation cannot be reversed. For this request to succeed, the VPN gateway + * must not have a `status` of `pending`, and there must not be any VPC routes using the VPN gateway's connections as + * a next hop. * - * @param deleteLoadBalancerPoolMemberOptions the {@link DeleteLoadBalancerPoolMemberOptions} containing the options for the call + * @param deleteVpnGatewayOptions the {@link DeleteVpnGatewayOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteLoadBalancerPoolMember(DeleteLoadBalancerPoolMemberOptions deleteLoadBalancerPoolMemberOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteLoadBalancerPoolMemberOptions, - "deleteLoadBalancerPoolMemberOptions cannot be null"); + public ServiceCall deleteVpnGateway(DeleteVpnGatewayOptions deleteVpnGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnGatewayOptions, + "deleteVpnGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", deleteLoadBalancerPoolMemberOptions.loadBalancerId()); - pathParamsMap.put("pool_id", deleteLoadBalancerPoolMemberOptions.poolId()); - pathParamsMap.put("id", deleteLoadBalancerPoolMemberOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteLoadBalancerPoolMember"); + pathParamsMap.put("id", deleteVpnGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -14183,223 +14758,159 @@ public ServiceCall deleteLoadBalancerPoolMember(DeleteLoadBalancerPoolMemb } /** - * Retrieve a load balancer pool member. + * Retrieve a VPN gateway. * - * This request retrieves a single member specified by the identifier in the URL path. + * This request retrieves a single VPN gateway specified by the identifier in the URL. * - * @param getLoadBalancerPoolMemberOptions the {@link GetLoadBalancerPoolMemberOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember} + * @param getVpnGatewayOptions the {@link GetVpnGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGateway} */ - public ServiceCall getLoadBalancerPoolMember(GetLoadBalancerPoolMemberOptions getLoadBalancerPoolMemberOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getLoadBalancerPoolMemberOptions, - "getLoadBalancerPoolMemberOptions cannot be null"); + public ServiceCall getVpnGateway(GetVpnGatewayOptions getVpnGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnGatewayOptions, + "getVpnGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", getLoadBalancerPoolMemberOptions.loadBalancerId()); - pathParamsMap.put("pool_id", getLoadBalancerPoolMemberOptions.poolId()); - pathParamsMap.put("id", getLoadBalancerPoolMemberOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getLoadBalancerPoolMember"); + pathParamsMap.put("id", getVpnGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a load balancer pool member. + * Update a VPN gateway. * - * This request updates an existing member from a member patch. + * This request updates the properties of an existing VPN gateway. * - * @param updateLoadBalancerPoolMemberOptions the {@link UpdateLoadBalancerPoolMemberOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LoadBalancerPoolMember} + * @param updateVpnGatewayOptions the {@link UpdateVpnGatewayOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGateway} */ - public ServiceCall updateLoadBalancerPoolMember(UpdateLoadBalancerPoolMemberOptions updateLoadBalancerPoolMemberOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateLoadBalancerPoolMemberOptions, - "updateLoadBalancerPoolMemberOptions cannot be null"); + public ServiceCall updateVpnGateway(UpdateVpnGatewayOptions updateVpnGatewayOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpnGatewayOptions, + "updateVpnGatewayOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("load_balancer_id", updateLoadBalancerPoolMemberOptions.loadBalancerId()); - pathParamsMap.put("pool_id", updateLoadBalancerPoolMemberOptions.poolId()); - pathParamsMap.put("id", updateLoadBalancerPoolMemberOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/load_balancers/{load_balancer_id}/pools/{pool_id}/members/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateLoadBalancerPoolMember"); + pathParamsMap.put("id", updateVpnGatewayOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpnGateway"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateLoadBalancerPoolMemberOptions.loadBalancerPoolMemberPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpnGatewayOptions.vpnGatewayPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List endpoint gateways. + * List advertised CIDRs for a VPN gateway. * - * This request lists endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to a - * target outside the VPC. + * This request lists advertised CIDRs for a VPN gateway. * - * @param listEndpointGatewaysOptions the {@link ListEndpointGatewaysOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link EndpointGatewayCollection} + * This request is only supported for route mode VPN gateways. + * + * @param listVpnGatewayAdvertisedCidrsOptions the {@link ListVpnGatewayAdvertisedCidrsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayAdvertisedCIDRCollection} */ - public ServiceCall listEndpointGateways(ListEndpointGatewaysOptions listEndpointGatewaysOptions) { - if (listEndpointGatewaysOptions == null) { - listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listEndpointGateways"); + public ServiceCall listVpnGatewayAdvertisedCidrs(ListVpnGatewayAdvertisedCidrsOptions listVpnGatewayAdvertisedCidrsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnGatewayAdvertisedCidrsOptions, + "listVpnGatewayAdvertisedCidrsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", listVpnGatewayAdvertisedCidrsOptions.vpnGatewayId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/advertised_cidrs", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGatewayAdvertisedCidrs"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listEndpointGatewaysOptions.name() != null) { - builder.query("name", String.valueOf(listEndpointGatewaysOptions.name())); - } - if (listEndpointGatewaysOptions.start() != null) { - builder.query("start", String.valueOf(listEndpointGatewaysOptions.start())); - } - if (listEndpointGatewaysOptions.limit() != null) { - builder.query("limit", String.valueOf(listEndpointGatewaysOptions.limit())); - } - if (listEndpointGatewaysOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listEndpointGatewaysOptions.resourceGroupId())); - } - if (listEndpointGatewaysOptions.lifecycleState() != null) { - builder.query("lifecycle_state", RequestUtils.join(listEndpointGatewaysOptions.lifecycleState(), ",")); - } - if (listEndpointGatewaysOptions.vpcId() != null) { - builder.query("vpc.id", String.valueOf(listEndpointGatewaysOptions.vpcId())); - } - if (listEndpointGatewaysOptions.vpcCrn() != null) { - builder.query("vpc.crn", String.valueOf(listEndpointGatewaysOptions.vpcCrn())); - } - if (listEndpointGatewaysOptions.vpcName() != null) { - builder.query("vpc.name", String.valueOf(listEndpointGatewaysOptions.vpcName())); - } - if (listEndpointGatewaysOptions.allowDnsResolutionBinding() != null) { - builder.query("allow_dns_resolution_binding", String.valueOf(listEndpointGatewaysOptions.allowDnsResolutionBinding())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List endpoint gateways. - * - * This request lists endpoint gateways in the region. An endpoint gateway maps one or more reserved IPs in a VPC to a - * target outside the VPC. + * Remove an advertised CIDR from a VPN gateway. * - * @return a {@link ServiceCall} with a result of type {@link EndpointGatewayCollection} - */ - public ServiceCall listEndpointGateways() { - return listEndpointGateways(null); - } - - /** - * Create an endpoint gateway. + * This request removes a CIDR from a VPN gateway advertised CIDRs. * - * This request creates a new endpoint gateway. An endpoint gateway maps one or more reserved IPs in a VPC to a target - * outside the VPC. + * This request is only supported for route mode VPN gateways. * - * @param createEndpointGatewayOptions the {@link CreateEndpointGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link EndpointGateway} + * @param removeVpnGatewayAdvertisedCidrOptions the {@link RemoveVpnGatewayAdvertisedCidrOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall createEndpointGateway(CreateEndpointGatewayOptions createEndpointGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createEndpointGatewayOptions, - "createEndpointGatewayOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createEndpointGateway"); + public ServiceCall removeVpnGatewayAdvertisedCidr(RemoveVpnGatewayAdvertisedCidrOptions removeVpnGatewayAdvertisedCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(removeVpnGatewayAdvertisedCidrOptions, + "removeVpnGatewayAdvertisedCidrOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", removeVpnGatewayAdvertisedCidrOptions.vpnGatewayId()); + pathParamsMap.put("cidr", removeVpnGatewayAdvertisedCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/advertised_cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeVpnGatewayAdvertisedCidr"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.target())); - contentJson.add("vpc", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.vpc())); - if (createEndpointGatewayOptions.allowDnsResolutionBinding() != null) { - contentJson.addProperty("allow_dns_resolution_binding", createEndpointGatewayOptions.allowDnsResolutionBinding()); - } - if (createEndpointGatewayOptions.ips() != null) { - contentJson.add("ips", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.ips())); - } - if (createEndpointGatewayOptions.name() != null) { - contentJson.addProperty("name", createEndpointGatewayOptions.name()); - } - if (createEndpointGatewayOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.resourceGroup())); - } - if (createEndpointGatewayOptions.securityGroups() != null) { - contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEndpointGatewayOptions.securityGroups())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List reserved IPs bound to an endpoint gateway. + * Check if the specified advertised CIDR exists on a VPN gateway. * - * This request lists reserved IPs bound to an endpoint gateway. + * This request succeeds if an advertised CIDR exists on the specified VPN gateway, and fails otherwise. * - * @param listEndpointGatewayIpsOptions the {@link ListEndpointGatewayIpsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIPCollectionEndpointGatewayContext} - */ - public ServiceCall listEndpointGatewayIps(ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listEndpointGatewayIpsOptions, - "listEndpointGatewayIpsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("endpoint_gateway_id", listEndpointGatewayIpsOptions.endpointGatewayId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/ips", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listEndpointGatewayIps"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - if (listEndpointGatewayIpsOptions.start() != null) { - builder.query("start", String.valueOf(listEndpointGatewayIpsOptions.start())); - } - if (listEndpointGatewayIpsOptions.limit() != null) { - builder.query("limit", String.valueOf(listEndpointGatewayIpsOptions.limit())); - } - if (listEndpointGatewayIpsOptions.sort() != null) { - builder.query("sort", String.valueOf(listEndpointGatewayIpsOptions.sort())); + * This request is only supported for route mode VPN gateways. + * + * @param checkVpnGatewayAdvertisedCidrOptions the {@link CheckVpnGatewayAdvertisedCidrOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall checkVpnGatewayAdvertisedCidr(CheckVpnGatewayAdvertisedCidrOptions checkVpnGatewayAdvertisedCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(checkVpnGatewayAdvertisedCidrOptions, + "checkVpnGatewayAdvertisedCidrOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", checkVpnGatewayAdvertisedCidrOptions.vpnGatewayId()); + pathParamsMap.put("cidr", checkVpnGatewayAdvertisedCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/advertised_cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "checkVpnGatewayAdvertisedCidr"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Unbind a reserved IP from an endpoint gateway. + * Set an advertised CIDR on a VPN gateway. * - * This request unbinds the specified reserved IP from the specified endpoint gateway. If the reserved IP has - * `auto_delete` set to `true`, the reserved IP will be deleted. + * This request adds the specified CIDR to the specified VPN gateway advertised CIDRs. This request succeeds if the + * specified CIDR already exists. A request body is not required, and if provided, is ignored. * - * @param removeEndpointGatewayIpOptions the {@link RemoveEndpointGatewayIpOptions} containing the options for the call + * This request is only supported for route mode VPN gateways. + * + * @param addVpnGatewayAdvertisedCidrOptions the {@link AddVpnGatewayAdvertisedCidrOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall removeEndpointGatewayIp(RemoveEndpointGatewayIpOptions removeEndpointGatewayIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(removeEndpointGatewayIpOptions, - "removeEndpointGatewayIpOptions cannot be null"); + public ServiceCall addVpnGatewayAdvertisedCidr(AddVpnGatewayAdvertisedCidrOptions addVpnGatewayAdvertisedCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(addVpnGatewayAdvertisedCidrOptions, + "addVpnGatewayAdvertisedCidrOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("endpoint_gateway_id", removeEndpointGatewayIpOptions.endpointGatewayId()); - pathParamsMap.put("id", removeEndpointGatewayIpOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeEndpointGatewayIp"); + pathParamsMap.put("vpn_gateway_id", addVpnGatewayAdvertisedCidrOptions.vpnGatewayId()); + pathParamsMap.put("cidr", addVpnGatewayAdvertisedCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/advertised_cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addVpnGatewayAdvertisedCidr"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -14410,84 +14921,90 @@ public ServiceCall removeEndpointGatewayIp(RemoveEndpointGatewayIpOptions } /** - * Retrieve a reserved IP bound to an endpoint gateway. + * List connections of a VPN gateway. * - * This request retrieves the specified reserved IP address if it is bound to the endpoint gateway specified in the - * URL. + * This request lists connections of a VPN gateway. * - * @param getEndpointGatewayIpOptions the {@link GetEndpointGatewayIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIP} + * @param listVpnGatewayConnectionsOptions the {@link ListVpnGatewayConnectionsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnectionCollection} */ - public ServiceCall getEndpointGatewayIp(GetEndpointGatewayIpOptions getEndpointGatewayIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getEndpointGatewayIpOptions, - "getEndpointGatewayIpOptions cannot be null"); + public ServiceCall listVpnGatewayConnections(ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnGatewayConnectionsOptions, + "listVpnGatewayConnectionsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("endpoint_gateway_id", getEndpointGatewayIpOptions.endpointGatewayId()); - pathParamsMap.put("id", getEndpointGatewayIpOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getEndpointGatewayIp"); + pathParamsMap.put("vpn_gateway_id", listVpnGatewayConnectionsOptions.vpnGatewayId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGatewayConnections"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listVpnGatewayConnectionsOptions.start() != null) { + builder.query("start", String.valueOf(listVpnGatewayConnectionsOptions.start())); + } + if (listVpnGatewayConnectionsOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpnGatewayConnectionsOptions.limit())); + } + if (listVpnGatewayConnectionsOptions.status() != null) { + builder.query("status", String.valueOf(listVpnGatewayConnectionsOptions.status())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Bind a reserved IP to an endpoint gateway. - * - * This request binds the specified reserved IP to the specified endpoint gateway. The reserved IP: + * Create a connection for a VPN gateway. * - * - must currently be unbound, or not required by its target - * - must not be in the same zone as any other reserved IP bound to the endpoint gateway. + * This request creates a new VPN gateway connection. * - * @param addEndpointGatewayIpOptions the {@link AddEndpointGatewayIpOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ReservedIP} + * @param createVpnGatewayConnectionOptions the {@link CreateVpnGatewayConnectionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnection} */ - public ServiceCall addEndpointGatewayIp(AddEndpointGatewayIpOptions addEndpointGatewayIpOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(addEndpointGatewayIpOptions, - "addEndpointGatewayIpOptions cannot be null"); + public ServiceCall createVpnGatewayConnection(CreateVpnGatewayConnectionOptions createVpnGatewayConnectionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpnGatewayConnectionOptions, + "createVpnGatewayConnectionOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("endpoint_gateway_id", addEndpointGatewayIpOptions.endpointGatewayId()); - pathParamsMap.put("id", addEndpointGatewayIpOptions.id()); - RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{endpoint_gateway_id}/ips/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addEndpointGatewayIp"); + pathParamsMap.put("vpn_gateway_id", createVpnGatewayConnectionOptions.vpnGatewayId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpnGatewayConnection"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createVpnGatewayConnectionOptions.vpnGatewayConnectionPrototype()), "application/json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an endpoint gateway. - * - * This request deletes an endpoint gateway. This operation cannot be reversed. + * Delete a VPN gateway connection. * - * Reserved IPs that were bound to the endpoint gateway will be released if their - * `auto_delete` property is set to true. + * This request deletes a VPN gateway connection. This operation cannot be reversed. For this request to succeed, + * there must not be VPC routes using this VPN connection as a next hop. * - * @param deleteEndpointGatewayOptions the {@link DeleteEndpointGatewayOptions} containing the options for the call + * @param deleteVpnGatewayConnectionOptions the {@link DeleteVpnGatewayConnectionOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteEndpointGateway(DeleteEndpointGatewayOptions deleteEndpointGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteEndpointGatewayOptions, - "deleteEndpointGatewayOptions cannot be null"); + public ServiceCall deleteVpnGatewayConnection(DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnGatewayConnectionOptions, + "deleteVpnGatewayConnectionOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteEndpointGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteEndpointGateway"); + pathParamsMap.put("vpn_gateway_id", deleteVpnGatewayConnectionOptions.vpnGatewayId()); + pathParamsMap.put("id", deleteVpnGatewayConnectionOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnGatewayConnection"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + if (deleteVpnGatewayConnectionOptions.ifMatch() != null) { + builder.header("If-Match", deleteVpnGatewayConnectionOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); @@ -14495,185 +15012,225 @@ public ServiceCall deleteEndpointGateway(DeleteEndpointGatewayOptions dele } /** - * Retrieve an endpoint gateway. + * Retrieve a VPN gateway connection. * - * This request retrieves a single endpoint gateway specified by the identifier in the URL. + * This request retrieves a single VPN gateway connection specified by the identifier in the URL. * - * @param getEndpointGatewayOptions the {@link GetEndpointGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link EndpointGateway} + * @param getVpnGatewayConnectionOptions the {@link GetVpnGatewayConnectionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnection} */ - public ServiceCall getEndpointGateway(GetEndpointGatewayOptions getEndpointGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getEndpointGatewayOptions, - "getEndpointGatewayOptions cannot be null"); + public ServiceCall getVpnGatewayConnection(GetVpnGatewayConnectionOptions getVpnGatewayConnectionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnGatewayConnectionOptions, + "getVpnGatewayConnectionOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getEndpointGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getEndpointGateway"); + pathParamsMap.put("vpn_gateway_id", getVpnGatewayConnectionOptions.vpnGatewayId()); + pathParamsMap.put("id", getVpnGatewayConnectionOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnGatewayConnection"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an endpoint gateway. + * Update a VPN gateway connection. * - * This request updates an endpoint gateway's name. + * This request updates the properties of an existing VPN gateway connection. * - * @param updateEndpointGatewayOptions the {@link UpdateEndpointGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link EndpointGateway} + * @param updateVpnGatewayConnectionOptions the {@link UpdateVpnGatewayConnectionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnection} */ - public ServiceCall updateEndpointGateway(UpdateEndpointGatewayOptions updateEndpointGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateEndpointGatewayOptions, - "updateEndpointGatewayOptions cannot be null"); + public ServiceCall updateVpnGatewayConnection(UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpnGatewayConnectionOptions, + "updateVpnGatewayConnectionOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateEndpointGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/endpoint_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateEndpointGateway"); + pathParamsMap.put("vpn_gateway_id", updateVpnGatewayConnectionOptions.vpnGatewayId()); + pathParamsMap.put("id", updateVpnGatewayConnectionOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpnGatewayConnection"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateVpnGatewayConnectionOptions.ifMatch() != null) { + builder.header("If-Match", updateVpnGatewayConnectionOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateEndpointGatewayOptions.endpointGatewayPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpnGatewayConnectionOptions.vpnGatewayConnectionPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List flow log collectors. + * List local CIDRs for a VPN gateway connection. * - * This request lists flow log collectors in the region. A [flow log - * collector](https://cloud.ibm.com/docs/vpc?topic=vpc-flow-logs) summarizes TCP and UDP data sent over the instance - * network interfaces and instance network attachments contained within its target. The collected flow logs are - * written to a cloud object storage bucket, where they can be - * [viewed](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). + * This request lists local CIDRs for a VPN gateway connection. * - * @param listFlowLogCollectorsOptions the {@link ListFlowLogCollectorsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FlowLogCollectorCollection} + * This request is only supported for policy mode VPN gateways. + * + * @param listVpnGatewayConnectionsLocalCidrsOptions the {@link ListVpnGatewayConnectionsLocalCidrsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnectionCIDRs} */ - public ServiceCall listFlowLogCollectors(ListFlowLogCollectorsOptions listFlowLogCollectorsOptions) { - if (listFlowLogCollectorsOptions == null) { - listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listFlowLogCollectors"); + public ServiceCall listVpnGatewayConnectionsLocalCidrs(ListVpnGatewayConnectionsLocalCidrsOptions listVpnGatewayConnectionsLocalCidrsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnGatewayConnectionsLocalCidrsOptions, + "listVpnGatewayConnectionsLocalCidrsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", listVpnGatewayConnectionsLocalCidrsOptions.vpnGatewayId()); + pathParamsMap.put("id", listVpnGatewayConnectionsLocalCidrsOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGatewayConnectionsLocalCidrs"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listFlowLogCollectorsOptions.start() != null) { - builder.query("start", String.valueOf(listFlowLogCollectorsOptions.start())); - } - if (listFlowLogCollectorsOptions.limit() != null) { - builder.query("limit", String.valueOf(listFlowLogCollectorsOptions.limit())); - } - if (listFlowLogCollectorsOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listFlowLogCollectorsOptions.resourceGroupId())); - } - if (listFlowLogCollectorsOptions.name() != null) { - builder.query("name", String.valueOf(listFlowLogCollectorsOptions.name())); - } - if (listFlowLogCollectorsOptions.vpcId() != null) { - builder.query("vpc.id", String.valueOf(listFlowLogCollectorsOptions.vpcId())); - } - if (listFlowLogCollectorsOptions.vpcCrn() != null) { - builder.query("vpc.crn", String.valueOf(listFlowLogCollectorsOptions.vpcCrn())); - } - if (listFlowLogCollectorsOptions.vpcName() != null) { - builder.query("vpc.name", String.valueOf(listFlowLogCollectorsOptions.vpcName())); - } - if (listFlowLogCollectorsOptions.targetId() != null) { - builder.query("target.id", String.valueOf(listFlowLogCollectorsOptions.targetId())); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Remove a local CIDR from a VPN gateway connection. + * + * This request removes a CIDR from a VPN gateway connection. + * + * This request is only supported for policy mode VPN gateways. + * + * @param removeVpnGatewayConnectionsLocalCidrOptions the {@link RemoveVpnGatewayConnectionsLocalCidrOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall removeVpnGatewayConnectionsLocalCidr(RemoveVpnGatewayConnectionsLocalCidrOptions removeVpnGatewayConnectionsLocalCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(removeVpnGatewayConnectionsLocalCidrOptions, + "removeVpnGatewayConnectionsLocalCidrOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", removeVpnGatewayConnectionsLocalCidrOptions.vpnGatewayId()); + pathParamsMap.put("id", removeVpnGatewayConnectionsLocalCidrOptions.id()); + pathParamsMap.put("cidr", removeVpnGatewayConnectionsLocalCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeVpnGatewayConnectionsLocalCidr"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } - if (listFlowLogCollectorsOptions.targetResourceType() != null) { - builder.query("target.resource_type", String.valueOf(listFlowLogCollectorsOptions.targetResourceType())); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Check if the specified local CIDR exists on a VPN gateway connection. + * + * This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. + * + * This request is only supported for policy mode VPN gateways. + * + * @param checkVpnGatewayConnectionsLocalCidrOptions the {@link CheckVpnGatewayConnectionsLocalCidrOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result + */ + public ServiceCall checkVpnGatewayConnectionsLocalCidr(CheckVpnGatewayConnectionsLocalCidrOptions checkVpnGatewayConnectionsLocalCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(checkVpnGatewayConnectionsLocalCidrOptions, + "checkVpnGatewayConnectionsLocalCidrOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", checkVpnGatewayConnectionsLocalCidrOptions.vpnGatewayId()); + pathParamsMap.put("id", checkVpnGatewayConnectionsLocalCidrOptions.id()); + pathParamsMap.put("cidr", checkVpnGatewayConnectionsLocalCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "checkVpnGatewayConnectionsLocalCidr"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List flow log collectors. + * Set a local CIDR on a VPN gateway connection. * - * This request lists flow log collectors in the region. A [flow log - * collector](https://cloud.ibm.com/docs/vpc?topic=vpc-flow-logs) summarizes TCP and UDP data sent over the instance - * network interfaces and instance network attachments contained within its target. The collected flow logs are - * written to a cloud object storage bucket, where they can be - * [viewed](https://cloud.ibm.com/docs/vpc?topic=vpc-fl-analyze). + * This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the + * specified CIDR already exists. A request body is not required, and if provided, is ignored. * - * @return a {@link ServiceCall} with a result of type {@link FlowLogCollectorCollection} + * This request is only supported for policy mode VPN gateways. + * + * @param addVpnGatewayConnectionsLocalCidrOptions the {@link AddVpnGatewayConnectionsLocalCidrOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall listFlowLogCollectors() { - return listFlowLogCollectors(null); + public ServiceCall addVpnGatewayConnectionsLocalCidr(AddVpnGatewayConnectionsLocalCidrOptions addVpnGatewayConnectionsLocalCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(addVpnGatewayConnectionsLocalCidrOptions, + "addVpnGatewayConnectionsLocalCidrOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", addVpnGatewayConnectionsLocalCidrOptions.vpnGatewayId()); + pathParamsMap.put("id", addVpnGatewayConnectionsLocalCidrOptions.id()); + pathParamsMap.put("cidr", addVpnGatewayConnectionsLocalCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/local/cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addVpnGatewayConnectionsLocalCidr"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + return createServiceCall(builder.build(), responseConverter); } /** - * Create a flow log collector. + * List peer CIDRs for a VPN gateway connection. * - * This request creates and starts a new flow log collector from a flow log collector prototype object. The prototype - * object is structured in the same way as a retrieved flow log collector, and contains the information necessary to - * create and start the new flow log collector. + * This request lists peer CIDRs for a VPN gateway connection. * - * @param createFlowLogCollectorOptions the {@link CreateFlowLogCollectorOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FlowLogCollector} + * This request is only supported for policy mode VPN gateways. + * + * @param listVpnGatewayConnectionsPeerCidrsOptions the {@link ListVpnGatewayConnectionsPeerCidrsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayConnectionCIDRs} */ - public ServiceCall createFlowLogCollector(CreateFlowLogCollectorOptions createFlowLogCollectorOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createFlowLogCollectorOptions, - "createFlowLogCollectorOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createFlowLogCollector"); + public ServiceCall listVpnGatewayConnectionsPeerCidrs(ListVpnGatewayConnectionsPeerCidrsOptions listVpnGatewayConnectionsPeerCidrsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnGatewayConnectionsPeerCidrsOptions, + "listVpnGatewayConnectionsPeerCidrsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", listVpnGatewayConnectionsPeerCidrsOptions.vpnGatewayId()); + pathParamsMap.put("id", listVpnGatewayConnectionsPeerCidrsOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGatewayConnectionsPeerCidrs"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("storage_bucket", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createFlowLogCollectorOptions.storageBucket())); - contentJson.add("target", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createFlowLogCollectorOptions.target())); - if (createFlowLogCollectorOptions.active() != null) { - contentJson.addProperty("active", createFlowLogCollectorOptions.active()); - } - if (createFlowLogCollectorOptions.name() != null) { - contentJson.addProperty("name", createFlowLogCollectorOptions.name()); - } - if (createFlowLogCollectorOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createFlowLogCollectorOptions.resourceGroup())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a flow log collector. + * Remove a peer CIDR from a VPN gateway connection. * - * This request stops and deletes a flow log collector. This operation cannot be reversed. + * This request removes a CIDR from a VPN gateway connection. * - * Collected flow logs remain available within the flow log collector's Cloud Object Storage bucket. + * This request is only supported for policy mode VPN gateways. * - * @param deleteFlowLogCollectorOptions the {@link DeleteFlowLogCollectorOptions} containing the options for the call + * @param removeVpnGatewayConnectionsPeerCidrOptions the {@link RemoveVpnGatewayConnectionsPeerCidrOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall deleteFlowLogCollector(DeleteFlowLogCollectorOptions deleteFlowLogCollectorOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deleteFlowLogCollectorOptions, - "deleteFlowLogCollectorOptions cannot be null"); + public ServiceCall removeVpnGatewayConnectionsPeerCidr(RemoveVpnGatewayConnectionsPeerCidrOptions removeVpnGatewayConnectionsPeerCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(removeVpnGatewayConnectionsPeerCidrOptions, + "removeVpnGatewayConnectionsPeerCidrOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deleteFlowLogCollectorOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteFlowLogCollector"); + pathParamsMap.put("vpn_gateway_id", removeVpnGatewayConnectionsPeerCidrOptions.vpnGatewayId()); + pathParamsMap.put("id", removeVpnGatewayConnectionsPeerCidrOptions.id()); + pathParamsMap.put("cidr", removeVpnGatewayConnectionsPeerCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "removeVpnGatewayConnectionsPeerCidr"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -14684,545 +15241,546 @@ public ServiceCall deleteFlowLogCollector(DeleteFlowLogCollectorOptions de } /** - * Retrieve a flow log collector. + * Check if the specified peer CIDR exists on a VPN gateway connection. * - * This request retrieves a single flow log collector specified by the identifier in the URL. + * This request succeeds if a CIDR exists on the specified VPN gateway connection, and fails otherwise. * - * @param getFlowLogCollectorOptions the {@link GetFlowLogCollectorOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FlowLogCollector} + * This request is only supported for policy mode VPN gateways. + * + * @param checkVpnGatewayConnectionsPeerCidrOptions the {@link CheckVpnGatewayConnectionsPeerCidrOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getFlowLogCollector(GetFlowLogCollectorOptions getFlowLogCollectorOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getFlowLogCollectorOptions, - "getFlowLogCollectorOptions cannot be null"); + public ServiceCall checkVpnGatewayConnectionsPeerCidr(CheckVpnGatewayConnectionsPeerCidrOptions checkVpnGatewayConnectionsPeerCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(checkVpnGatewayConnectionsPeerCidrOptions, + "checkVpnGatewayConnectionsPeerCidrOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getFlowLogCollectorOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getFlowLogCollector"); + pathParamsMap.put("vpn_gateway_id", checkVpnGatewayConnectionsPeerCidrOptions.vpnGatewayId()); + pathParamsMap.put("id", checkVpnGatewayConnectionsPeerCidrOptions.id()); + pathParamsMap.put("cidr", checkVpnGatewayConnectionsPeerCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "checkVpnGatewayConnectionsPeerCidr"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Update a flow log collector. + * Set a peer CIDR on a VPN gateway connection. * - * This request updates a flow log collector with the information in a provided flow log collector patch. The flow log - * collector patch object is structured in the same way as a retrieved flow log collector and contains only the - * information to be updated. + * This request adds the specified CIDR to the specified VPN gateway connection. This request succeeds if the + * specified CIDR already exists. A request body is not required, and if provided, is ignored. * - * @param updateFlowLogCollectorOptions the {@link UpdateFlowLogCollectorOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link FlowLogCollector} + * This request is only supported for policy mode VPN gateways. + * + * @param addVpnGatewayConnectionsPeerCidrOptions the {@link AddVpnGatewayConnectionsPeerCidrOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updateFlowLogCollector(UpdateFlowLogCollectorOptions updateFlowLogCollectorOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updateFlowLogCollectorOptions, - "updateFlowLogCollectorOptions cannot be null"); + public ServiceCall addVpnGatewayConnectionsPeerCidr(AddVpnGatewayConnectionsPeerCidrOptions addVpnGatewayConnectionsPeerCidrOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(addVpnGatewayConnectionsPeerCidrOptions, + "addVpnGatewayConnectionsPeerCidrOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updateFlowLogCollectorOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/flow_log_collectors/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateFlowLogCollector"); + pathParamsMap.put("vpn_gateway_id", addVpnGatewayConnectionsPeerCidrOptions.vpnGatewayId()); + pathParamsMap.put("id", addVpnGatewayConnectionsPeerCidrOptions.id()); + pathParamsMap.put("cidr", addVpnGatewayConnectionsPeerCidrOptions.cidr()); + RequestBuilder builder = RequestBuilder.put(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer/cidrs/{cidr}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "addVpnGatewayConnectionsPeerCidr"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateFlowLogCollectorOptions.flowLogCollectorPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List private path service gateways. + * List VPN gateway service connections. * - * This request lists private path service gateways in the region. Private path service gateways allow - * [service - * providers](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components) - * to make their services available using - * [private path - * connectivity](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components). - * Private path service gateways are used to facilitate and manage the private path connectivity between private path - * network load balancers and their associated endpoint gateways. + * This request lists service connections on a VPN gateway. The VPN gateway service connections will be sorted by + * ascending `created_at` property values. A VPN gateway service connection connects services such as transit gateway + * to a VPN gateway. This facilitates the propagation of routes learned from VPN gateway peer connections to the + * connected service (for example, a transit gateway). * - * @param listPrivatePathServiceGatewaysOptions the {@link ListPrivatePathServiceGatewaysOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayCollection} + * @param listVpnGatewayServiceConnectionsOptions the {@link ListVpnGatewayServiceConnectionsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayServiceConnectionCollection} */ - public ServiceCall listPrivatePathServiceGateways(ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptions) { - if (listPrivatePathServiceGatewaysOptions == null) { - listPrivatePathServiceGatewaysOptions = new ListPrivatePathServiceGatewaysOptions.Builder().build(); - } - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPrivatePathServiceGateways"); + public ServiceCall listVpnGatewayServiceConnections(ListVpnGatewayServiceConnectionsOptions listVpnGatewayServiceConnectionsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnGatewayServiceConnectionsOptions, + "listVpnGatewayServiceConnectionsOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", listVpnGatewayServiceConnectionsOptions.vpnGatewayId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/service_connections", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnGatewayServiceConnections"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listPrivatePathServiceGatewaysOptions.start() != null) { - builder.query("start", String.valueOf(listPrivatePathServiceGatewaysOptions.start())); - } - if (listPrivatePathServiceGatewaysOptions.limit() != null) { - builder.query("limit", String.valueOf(listPrivatePathServiceGatewaysOptions.limit())); + if (listVpnGatewayServiceConnectionsOptions.start() != null) { + builder.query("start", String.valueOf(listVpnGatewayServiceConnectionsOptions.start())); } - if (listPrivatePathServiceGatewaysOptions.resourceGroupId() != null) { - builder.query("resource_group.id", String.valueOf(listPrivatePathServiceGatewaysOptions.resourceGroupId())); + if (listVpnGatewayServiceConnectionsOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpnGatewayServiceConnectionsOptions.limit())); } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * List private path service gateways. + * Retrieve a VPN gateway service connection. * - * This request lists private path service gateways in the region. Private path service gateways allow - * [service - * providers](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components) - * to make their services available using - * [private path - * connectivity](https://cloud.ibm.com/docs/private-path?topic=private-path-private-path-service-architecture#private-path-service-components). - * Private path service gateways are used to facilitate and manage the private path connectivity between private path - * network load balancers and their associated endpoint gateways. + * This request retrieves VPN gateway service connection specified by the identifier in the URL. * - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayCollection} + * @param getVpnGatewayServiceConnectionOptions the {@link GetVpnGatewayServiceConnectionOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNGatewayServiceConnection} */ - public ServiceCall listPrivatePathServiceGateways() { - return listPrivatePathServiceGateways(null); + public ServiceCall getVpnGatewayServiceConnection(GetVpnGatewayServiceConnectionOptions getVpnGatewayServiceConnectionOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnGatewayServiceConnectionOptions, + "getVpnGatewayServiceConnectionOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("vpn_gateway_id", getVpnGatewayServiceConnectionOptions.vpnGatewayId()); + pathParamsMap.put("id", getVpnGatewayServiceConnectionOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_gateways/{vpn_gateway_id}/service_connections/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnGatewayServiceConnection"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + builder.query("generation", String.valueOf(this.generation)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + return createServiceCall(builder.build(), responseConverter); } /** - * Create a private path service gateway. + * List VPN servers. * - * This request creates a private path service gateway from a private path service gateway prototype object. The - * prototype object is structured in the same way as a retrieved private path service gateway, and contains the - * information necessary to create the new private path service gateway. + * This request lists VPN servers. * - * @param createPrivatePathServiceGatewayOptions the {@link CreatePrivatePathServiceGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGateway} + * @param listVpnServersOptions the {@link ListVpnServersOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServerCollection} */ - public ServiceCall createPrivatePathServiceGateway(CreatePrivatePathServiceGatewayOptions createPrivatePathServiceGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createPrivatePathServiceGatewayOptions, - "createPrivatePathServiceGatewayOptions cannot be null"); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways")); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPrivatePathServiceGateway"); + public ServiceCall listVpnServers(ListVpnServersOptions listVpnServersOptions) { + if (listVpnServersOptions == null) { + listVpnServersOptions = new ListVpnServersOptions.Builder().build(); + } + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnServers"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("load_balancer", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPrivatePathServiceGatewayOptions.loadBalancer())); - contentJson.add("service_endpoints", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPrivatePathServiceGatewayOptions.serviceEndpoints())); - if (createPrivatePathServiceGatewayOptions.defaultAccessPolicy() != null) { - contentJson.addProperty("default_access_policy", createPrivatePathServiceGatewayOptions.defaultAccessPolicy()); + if (listVpnServersOptions.name() != null) { + builder.query("name", String.valueOf(listVpnServersOptions.name())); } - if (createPrivatePathServiceGatewayOptions.name() != null) { - contentJson.addProperty("name", createPrivatePathServiceGatewayOptions.name()); + if (listVpnServersOptions.start() != null) { + builder.query("start", String.valueOf(listVpnServersOptions.start())); } - if (createPrivatePathServiceGatewayOptions.resourceGroup() != null) { - contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPrivatePathServiceGatewayOptions.resourceGroup())); + if (listVpnServersOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpnServersOptions.limit())); } - if (createPrivatePathServiceGatewayOptions.zonalAffinity() != null) { - contentJson.addProperty("zonal_affinity", createPrivatePathServiceGatewayOptions.zonalAffinity()); + if (listVpnServersOptions.resourceGroupId() != null) { + builder.query("resource_group.id", String.valueOf(listVpnServersOptions.resourceGroupId())); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listVpnServersOptions.sort() != null) { + builder.query("sort", String.valueOf(listVpnServersOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete a private path service gateway. + * List VPN servers. * - * This request deletes a private path service gateway. For this request to succeed, the value of - * `endpoint_gateway_count` must be `0`. This operation cannot be reversed. + * This request lists VPN servers. * - * @param deletePrivatePathServiceGatewayOptions the {@link DeletePrivatePathServiceGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @return a {@link ServiceCall} with a result of type {@link VPNServerCollection} */ - public ServiceCall deletePrivatePathServiceGateway(DeletePrivatePathServiceGatewayOptions deletePrivatePathServiceGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deletePrivatePathServiceGatewayOptions, - "deletePrivatePathServiceGatewayOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", deletePrivatePathServiceGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePrivatePathServiceGateway"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); + public ServiceCall listVpnServers() { + return listVpnServers(null); } /** - * Retrieve a private path service gateway. + * Create a VPN server. * - * This request retrieves the private path service gateway specified by the identifier in the URL. + * This request creates a new VPN server. * - * @param getPrivatePathServiceGatewayOptions the {@link GetPrivatePathServiceGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGateway} + * @param createVpnServerOptions the {@link CreateVpnServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServer} */ - public ServiceCall getPrivatePathServiceGateway(GetPrivatePathServiceGatewayOptions getPrivatePathServiceGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getPrivatePathServiceGatewayOptions, - "getPrivatePathServiceGatewayOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", getPrivatePathServiceGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPrivatePathServiceGateway"); + public ServiceCall createVpnServer(CreateVpnServerOptions createVpnServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpnServerOptions, + "createVpnServerOptions cannot be null"); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers")); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpnServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + final JsonObject contentJson = new JsonObject(); + contentJson.add("certificate", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.certificate())); + contentJson.add("client_authentication", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.clientAuthentication())); + contentJson.addProperty("client_ip_pool", createVpnServerOptions.clientIpPool()); + contentJson.add("subnets", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.subnets())); + if (createVpnServerOptions.clientDnsServerIps() != null) { + contentJson.add("client_dns_server_ips", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.clientDnsServerIps())); + } + if (createVpnServerOptions.clientIdleTimeout() != null) { + contentJson.addProperty("client_idle_timeout", createVpnServerOptions.clientIdleTimeout()); + } + if (createVpnServerOptions.enableSplitTunneling() != null) { + contentJson.addProperty("enable_split_tunneling", createVpnServerOptions.enableSplitTunneling()); + } + if (createVpnServerOptions.name() != null) { + contentJson.addProperty("name", createVpnServerOptions.name()); + } + if (createVpnServerOptions.port() != null) { + contentJson.addProperty("port", createVpnServerOptions.port()); + } + if (createVpnServerOptions.protocol() != null) { + contentJson.addProperty("protocol", createVpnServerOptions.protocol()); + } + if (createVpnServerOptions.resourceGroup() != null) { + contentJson.add("resource_group", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.resourceGroup())); + } + if (createVpnServerOptions.securityGroups() != null) { + contentJson.add("security_groups", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createVpnServerOptions.securityGroups())); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update a private path service gateway. + * Delete a VPN server. * - * This request updates a private path service gateway with the information provided in a private path service gateway - * patch object. The private path service gateway patch object is structured in the same way as a retrieved private - * path service gateway and contains only the information to be updated. + * This request deletes a VPN server. This operation cannot be reversed. * - * @param updatePrivatePathServiceGatewayOptions the {@link UpdatePrivatePathServiceGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGateway} + * @param deleteVpnServerOptions the {@link DeleteVpnServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updatePrivatePathServiceGateway(UpdatePrivatePathServiceGatewayOptions updatePrivatePathServiceGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updatePrivatePathServiceGatewayOptions, - "updatePrivatePathServiceGatewayOptions cannot be null"); + public ServiceCall deleteVpnServer(DeleteVpnServerOptions deleteVpnServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnServerOptions, + "deleteVpnServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("id", updatePrivatePathServiceGatewayOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePrivatePathServiceGateway"); + pathParamsMap.put("id", deleteVpnServerOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); + if (deleteVpnServerOptions.ifMatch() != null) { + builder.header("If-Match", deleteVpnServerOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePrivatePathServiceGatewayOptions.privatePathServiceGatewayPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List account policies for a private path service gateway. - * - * This request lists account policies for a private path service gateway. Each policy defines how requests to use the - * private path service gateway from that account will be handled. + * Retrieve a VPN server. * - * The account policies will be sorted by their `created_at` property values, with newest account policies first. - * Account policies with identical `created_at` property values will in turn be sorted by ascending `id` property - * values. + * This request retrieves a single VPN server specified by the identifier in the URL. * - * @param listPrivatePathServiceGatewayAccountPoliciesOptions the {@link ListPrivatePathServiceGatewayAccountPoliciesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayAccountPolicyCollection} + * @param getVpnServerOptions the {@link GetVpnServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServer} */ - public ServiceCall listPrivatePathServiceGatewayAccountPolicies(ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listPrivatePathServiceGatewayAccountPoliciesOptions, - "listPrivatePathServiceGatewayAccountPoliciesOptions cannot be null"); + public ServiceCall getVpnServer(GetVpnServerOptions getVpnServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnServerOptions, + "getVpnServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", listPrivatePathServiceGatewayAccountPoliciesOptions.privatePathServiceGatewayId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPrivatePathServiceGatewayAccountPolicies"); + pathParamsMap.put("id", getVpnServerOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listPrivatePathServiceGatewayAccountPoliciesOptions.start() != null) { - builder.query("start", String.valueOf(listPrivatePathServiceGatewayAccountPoliciesOptions.start())); - } - if (listPrivatePathServiceGatewayAccountPoliciesOptions.limit() != null) { - builder.query("limit", String.valueOf(listPrivatePathServiceGatewayAccountPoliciesOptions.limit())); - } - if (listPrivatePathServiceGatewayAccountPoliciesOptions.accountId() != null) { - builder.query("account.id", String.valueOf(listPrivatePathServiceGatewayAccountPoliciesOptions.accountId())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Create an account policy for a private path service gateway. + * Update a VPN server. * - * This request creates an account policy from an account policy prototype object. The prototype object is structured - * in the same way as a retrieved account policy, and contains the information necessary to create the new account - * policy. + * This request updates the properties of an existing VPN server. Any updates other than to `name` will cause all + * connected VPN clients to be disconnected. * - * @param createPrivatePathServiceGatewayAccountPolicyOptions the {@link CreatePrivatePathServiceGatewayAccountPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayAccountPolicy} + * @param updateVpnServerOptions the {@link UpdateVpnServerOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServer} */ - public ServiceCall createPrivatePathServiceGatewayAccountPolicy(CreatePrivatePathServiceGatewayAccountPolicyOptions createPrivatePathServiceGatewayAccountPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(createPrivatePathServiceGatewayAccountPolicyOptions, - "createPrivatePathServiceGatewayAccountPolicyOptions cannot be null"); + public ServiceCall updateVpnServer(UpdateVpnServerOptions updateVpnServerOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpnServerOptions, + "updateVpnServerOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", createPrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createPrivatePathServiceGatewayAccountPolicy"); + pathParamsMap.put("id", updateVpnServerOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpnServer"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); + if (updateVpnServerOptions.ifMatch() != null) { + builder.header("If-Match", updateVpnServerOptions.ifMatch()); + } builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("access_policy", createPrivatePathServiceGatewayAccountPolicyOptions.accessPolicy()); - contentJson.add("account", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createPrivatePathServiceGatewayAccountPolicyOptions.account())); - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpnServerOptions.vpnServerPatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Delete an account policy for a private path service gateway. + * Retrieve client configuration. * - * This request deletes an account policy. This operation cannot be reversed and it does not affect the `status` of - * any existing endpoint gateway bindings. + * This request retrieves OpenVPN client configuration on a single VPN server specified by the identifier in the URL. + * This configuration includes directives compatible with OpenVPN releases 2.4 and 2.5. * - * @param deletePrivatePathServiceGatewayAccountPolicyOptions the {@link DeletePrivatePathServiceGatewayAccountPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getVpnServerClientConfigurationOptions the {@link GetVpnServerClientConfigurationOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link String} */ - public ServiceCall deletePrivatePathServiceGatewayAccountPolicy(DeletePrivatePathServiceGatewayAccountPolicyOptions deletePrivatePathServiceGatewayAccountPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(deletePrivatePathServiceGatewayAccountPolicyOptions, - "deletePrivatePathServiceGatewayAccountPolicyOptions cannot be null"); + public ServiceCall getVpnServerClientConfiguration(GetVpnServerClientConfigurationOptions getVpnServerClientConfigurationOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnServerClientConfigurationOptions, + "getVpnServerClientConfigurationOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", deletePrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayId()); - pathParamsMap.put("id", deletePrivatePathServiceGatewayAccountPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deletePrivatePathServiceGatewayAccountPolicy"); + pathParamsMap.put("id", getVpnServerClientConfigurationOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{id}/client_configuration", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnServerClientConfiguration"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "text/plain"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = ResponseConverterUtils.getString(); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an account policy for a private path service gateway. + * List VPN clients for a VPN server. * - * This request retrieves a single account policy specified by the identifier in the URL. + * This request retrieves connected VPN clients, and any disconnected VPN clients that the VPN server has not yet + * deleted based on its auto-deletion policy. * - * @param getPrivatePathServiceGatewayAccountPolicyOptions the {@link GetPrivatePathServiceGatewayAccountPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayAccountPolicy} + * @param listVpnServerClientsOptions the {@link ListVpnServerClientsOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServerClientCollection} */ - public ServiceCall getPrivatePathServiceGatewayAccountPolicy(GetPrivatePathServiceGatewayAccountPolicyOptions getPrivatePathServiceGatewayAccountPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getPrivatePathServiceGatewayAccountPolicyOptions, - "getPrivatePathServiceGatewayAccountPolicyOptions cannot be null"); + public ServiceCall listVpnServerClients(ListVpnServerClientsOptions listVpnServerClientsOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnServerClientsOptions, + "listVpnServerClientsOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", getPrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayId()); - pathParamsMap.put("id", getPrivatePathServiceGatewayAccountPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPrivatePathServiceGatewayAccountPolicy"); + pathParamsMap.put("vpn_server_id", listVpnServerClientsOptions.vpnServerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/clients", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnServerClients"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + if (listVpnServerClientsOptions.start() != null) { + builder.query("start", String.valueOf(listVpnServerClientsOptions.start())); + } + if (listVpnServerClientsOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpnServerClientsOptions.limit())); + } + if (listVpnServerClientsOptions.sort() != null) { + builder.query("sort", String.valueOf(listVpnServerClientsOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Update an account policy for a private path service gateway. + * Delete a VPN client. * - * This request updates an account policy with the information in a provided account policy patch. The account policy - * patch object is structured in the same way as a retrieved account policy and contains only the information to be - * updated. + * This request disconnects and deletes the VPN client from the VPN server. The VPN client may reconnect unless its + * authentication permissions for the configured authentication methods (such as its client certificate) have been + * revoked. * - * @param updatePrivatePathServiceGatewayAccountPolicyOptions the {@link UpdatePrivatePathServiceGatewayAccountPolicyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayAccountPolicy} + * @param deleteVpnServerClientOptions the {@link DeleteVpnServerClientOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall updatePrivatePathServiceGatewayAccountPolicy(UpdatePrivatePathServiceGatewayAccountPolicyOptions updatePrivatePathServiceGatewayAccountPolicyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(updatePrivatePathServiceGatewayAccountPolicyOptions, - "updatePrivatePathServiceGatewayAccountPolicyOptions cannot be null"); + public ServiceCall deleteVpnServerClient(DeleteVpnServerClientOptions deleteVpnServerClientOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnServerClientOptions, + "deleteVpnServerClientOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", updatePrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayId()); - pathParamsMap.put("id", updatePrivatePathServiceGatewayAccountPolicyOptions.id()); - RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/account_policies/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updatePrivatePathServiceGatewayAccountPolicy"); + pathParamsMap.put("vpn_server_id", deleteVpnServerClientOptions.vpnServerId()); + pathParamsMap.put("id", deleteVpnServerClientOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/clients/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnServerClient"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updatePrivatePathServiceGatewayAccountPolicyOptions.privatePathServiceGatewayAccountPolicyPatch()), "application/merge-patch+json"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * List endpoint gateway bindings for a private path service gateway. - * - * This request lists endpoint gateway bindings for a private path service gateway. Each endpoint gateway binding is - * implicitly created when an endpoint gateway is created targeting the private path service gateway. The associated - * account policy is applied to all new endpoint gateway bindings. If an associated account policy doesn't exist, the - * private path service gateway's `default_access_policy` is used. + * Retrieve a VPN client. * - * The endpoint gateway bindings will be sorted by their `created_at` property values, with newest endpoint gateway - * bindings first. Endpoint gateway bindings with identical - * `created_at` property values will in turn be sorted by ascending `name` property values. + * This request retrieves a single VPN client specified by the identifier in the URL. * - * @param listPrivatePathServiceGatewayEndpointGatewayBindingsOptions the {@link ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayEndpointGatewayBindingCollection} + * @param getVpnServerClientOptions the {@link GetVpnServerClientOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServerClient} */ - public ServiceCall listPrivatePathServiceGatewayEndpointGatewayBindings(ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions, - "listPrivatePathServiceGatewayEndpointGatewayBindingsOptions cannot be null"); + public ServiceCall getVpnServerClient(GetVpnServerClientOptions getVpnServerClientOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnServerClientOptions, + "getVpnServerClientOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.privatePathServiceGatewayId()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listPrivatePathServiceGatewayEndpointGatewayBindings"); + pathParamsMap.put("vpn_server_id", getVpnServerClientOptions.vpnServerId()); + pathParamsMap.put("id", getVpnServerClientOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/clients/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnServerClient"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - if (listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.start() != null) { - builder.query("start", String.valueOf(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.start())); - } - if (listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.limit() != null) { - builder.query("limit", String.valueOf(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.limit())); - } - if (listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.status() != null) { - builder.query("status", String.valueOf(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.status())); - } - if (listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.accountId() != null) { - builder.query("account.id", String.valueOf(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions.accountId())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Retrieve an endpoint gateway binding for a private path service gateway. + * Disconnect a VPN client. * - * This request retrieves a single endpoint gateway binding specified by the identifier in the URL. + * This request disconnects the specified VPN client, and deletes the client according to the VPN server's + * auto-deletion policy. The VPN client may reconnect unless its authentication permissions for the configured + * authentication methods (such as its client certificate) have been revoked. * - * @param getPrivatePathServiceGatewayEndpointGatewayBindingOptions the {@link GetPrivatePathServiceGatewayEndpointGatewayBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link PrivatePathServiceGatewayEndpointGatewayBinding} + * @param disconnectVpnClientOptions the {@link DisconnectVpnClientOptions} containing the options for the call + * @return a {@link ServiceCall} with a void result */ - public ServiceCall getPrivatePathServiceGatewayEndpointGatewayBinding(GetPrivatePathServiceGatewayEndpointGatewayBindingOptions getPrivatePathServiceGatewayEndpointGatewayBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(getPrivatePathServiceGatewayEndpointGatewayBindingOptions, - "getPrivatePathServiceGatewayEndpointGatewayBindingOptions cannot be null"); + public ServiceCall disconnectVpnClient(DisconnectVpnClientOptions disconnectVpnClientOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(disconnectVpnClientOptions, + "disconnectVpnClientOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", getPrivatePathServiceGatewayEndpointGatewayBindingOptions.privatePathServiceGatewayId()); - pathParamsMap.put("id", getPrivatePathServiceGatewayEndpointGatewayBindingOptions.id()); - RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getPrivatePathServiceGatewayEndpointGatewayBinding"); + pathParamsMap.put("vpn_server_id", disconnectVpnClientOptions.vpnServerId()); + pathParamsMap.put("id", disconnectVpnClientOptions.id()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/clients/{id}/disconnect", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "disconnectVpnClient"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } - builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); + ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); return createServiceCall(builder.build(), responseConverter); } /** - * Deny an endpoint gateway binding for a private path service gateway. + * List VPN routes for a VPN server. * - * This request denies a `pending` endpoint gateway request, and optionally sets the policy to deny future requests - * from the same account. + * This request lists VPN routes in a VPN server. All VPN routes are provided to the VPN client when the connection is + * established. Packets received from the VPN client will be dropped by the VPN server if there is no VPN route + * matching their specified destinations. All VPN routes must be unique within the VPN server. * - * @param denyPrivatePathServiceGatewayEndpointGatewayBindingOptions the {@link DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param listVpnServerRoutesOptions the {@link ListVpnServerRoutesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServerRouteCollection} */ - public ServiceCall denyPrivatePathServiceGatewayEndpointGatewayBinding(DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions denyPrivatePathServiceGatewayEndpointGatewayBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(denyPrivatePathServiceGatewayEndpointGatewayBindingOptions, - "denyPrivatePathServiceGatewayEndpointGatewayBindingOptions cannot be null"); + public ServiceCall listVpnServerRoutes(ListVpnServerRoutesOptions listVpnServerRoutesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(listVpnServerRoutesOptions, + "listVpnServerRoutesOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", denyPrivatePathServiceGatewayEndpointGatewayBindingOptions.privatePathServiceGatewayId()); - pathParamsMap.put("id", denyPrivatePathServiceGatewayEndpointGatewayBindingOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}/deny", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "denyPrivatePathServiceGatewayEndpointGatewayBinding"); + pathParamsMap.put("vpn_server_id", listVpnServerRoutesOptions.vpnServerId()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "listVpnServerRoutes"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - if (denyPrivatePathServiceGatewayEndpointGatewayBindingOptions.setAccountPolicy() != null) { - contentJson.addProperty("set_account_policy", denyPrivatePathServiceGatewayEndpointGatewayBindingOptions.setAccountPolicy()); + if (listVpnServerRoutesOptions.start() != null) { + builder.query("start", String.valueOf(listVpnServerRoutesOptions.start())); } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + if (listVpnServerRoutesOptions.limit() != null) { + builder.query("limit", String.valueOf(listVpnServerRoutesOptions.limit())); + } + if (listVpnServerRoutesOptions.sort() != null) { + builder.query("sort", String.valueOf(listVpnServerRoutesOptions.sort())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Permit an endpoint gateway binding for a private path service gateway. + * Create a VPN route for a VPN server. * - * This request permits a `pending` endpoint gateway request, and optionally sets the policy to permit future requests - * from the same account. + * This request creates a new VPN route in the VPN server. All VPN routes are provided to the VPN client when the + * connection is established. Packets received from the VPN client will be dropped by the VPN server if there is no + * VPN route matching their specified destinations. All VPN routes must be unique within the VPN server. * - * @param permitPrivatePathServiceGatewayEndpointGatewayBindingOptions the {@link PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param createVpnServerRouteOptions the {@link CreateVpnServerRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServerRoute} */ - public ServiceCall permitPrivatePathServiceGatewayEndpointGatewayBinding(PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions permitPrivatePathServiceGatewayEndpointGatewayBindingOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(permitPrivatePathServiceGatewayEndpointGatewayBindingOptions, - "permitPrivatePathServiceGatewayEndpointGatewayBindingOptions cannot be null"); + public ServiceCall createVpnServerRoute(CreateVpnServerRouteOptions createVpnServerRouteOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(createVpnServerRouteOptions, + "createVpnServerRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", permitPrivatePathServiceGatewayEndpointGatewayBindingOptions.privatePathServiceGatewayId()); - pathParamsMap.put("id", permitPrivatePathServiceGatewayEndpointGatewayBindingOptions.id()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/endpoint_gateway_bindings/{id}/permit", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "permitPrivatePathServiceGatewayEndpointGatewayBinding"); + pathParamsMap.put("vpn_server_id", createVpnServerRouteOptions.vpnServerId()); + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "createVpnServerRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); final JsonObject contentJson = new JsonObject(); - if (permitPrivatePathServiceGatewayEndpointGatewayBindingOptions.setAccountPolicy() != null) { - contentJson.addProperty("set_account_policy", permitPrivatePathServiceGatewayEndpointGatewayBindingOptions.setAccountPolicy()); + contentJson.addProperty("destination", createVpnServerRouteOptions.destination()); + if (createVpnServerRouteOptions.action() != null) { + contentJson.addProperty("action", createVpnServerRouteOptions.action()); + } + if (createVpnServerRouteOptions.name() != null) { + contentJson.addProperty("name", createVpnServerRouteOptions.name()); } builder.bodyJson(contentJson); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Publish a private path service gateway. + * Delete a VPN route. * - * This request publishes a private path service gateway, allowing any account to request access to it. + * This request deletes a VPN route. This operation cannot be reversed. * - * @param publishPrivatePathServiceGatewayOptions the {@link PublishPrivatePathServiceGatewayOptions} containing the options for the call + * @param deleteVpnServerRouteOptions the {@link DeleteVpnServerRouteOptions} containing the options for the call * @return a {@link ServiceCall} with a void result */ - public ServiceCall publishPrivatePathServiceGateway(PublishPrivatePathServiceGatewayOptions publishPrivatePathServiceGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(publishPrivatePathServiceGatewayOptions, - "publishPrivatePathServiceGatewayOptions cannot be null"); + public ServiceCall deleteVpnServerRoute(DeleteVpnServerRouteOptions deleteVpnServerRouteOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteVpnServerRouteOptions, + "deleteVpnServerRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", publishPrivatePathServiceGatewayOptions.privatePathServiceGatewayId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/publish", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "publishPrivatePathServiceGateway"); + pathParamsMap.put("vpn_server_id", deleteVpnServerRouteOptions.vpnServerId()); + pathParamsMap.put("id", deleteVpnServerRouteOptions.id()); + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "deleteVpnServerRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } @@ -15233,58 +15791,58 @@ public ServiceCall publishPrivatePathServiceGateway(PublishPrivatePathServ } /** - * Revoke access to a private path service gateway for an account. + * Retrieve a VPN route. * - * This request revokes a consumer account. This operation cannot be reversed. The `status` of all endpoint gateway - * bindings associated with the specified private path service gateway become `denied`. If the specified account has - * an existing access policy, that policy will be updated to `denied`. Otherwise, a new `deny` access policy will be - * created for the account. + * This request retrieves a single VPN route specified by the identifier in the URL. * - * @param revokeAccountForPrivatePathServiceGatewayOptions the {@link RevokeAccountForPrivatePathServiceGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param getVpnServerRouteOptions the {@link GetVpnServerRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServerRoute} */ - public ServiceCall revokeAccountForPrivatePathServiceGateway(RevokeAccountForPrivatePathServiceGatewayOptions revokeAccountForPrivatePathServiceGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(revokeAccountForPrivatePathServiceGatewayOptions, - "revokeAccountForPrivatePathServiceGatewayOptions cannot be null"); + public ServiceCall getVpnServerRoute(GetVpnServerRouteOptions getVpnServerRouteOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(getVpnServerRouteOptions, + "getVpnServerRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", revokeAccountForPrivatePathServiceGatewayOptions.privatePathServiceGatewayId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/revoke_account", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "revokeAccountForPrivatePathServiceGateway"); + pathParamsMap.put("vpn_server_id", getVpnServerRouteOptions.vpnServerId()); + pathParamsMap.put("id", getVpnServerRouteOptions.id()); + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "getVpnServerRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - final JsonObject contentJson = new JsonObject(); - contentJson.add("account", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(revokeAccountForPrivatePathServiceGatewayOptions.account())); - builder.bodyJson(contentJson); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } /** - * Unpublish a private path service gateway. + * Update a VPN route. * - * This request unpublishes a private path service gateway. For this request to succeed, any existing access from - * other accounts must first be revoked. Once unpublished, access will again be restricted to the account that created - * this private path service gateway. + * This request updates a VPN route with the information in a provided VPN route patch. The VPN route patch object is + * structured in the same way as a retrieved VPN route and contains only the information to be updated. * - * @param unpublishPrivatePathServiceGatewayOptions the {@link UnpublishPrivatePathServiceGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a void result + * @param updateVpnServerRouteOptions the {@link UpdateVpnServerRouteOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link VPNServerRoute} */ - public ServiceCall unpublishPrivatePathServiceGateway(UnpublishPrivatePathServiceGatewayOptions unpublishPrivatePathServiceGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(unpublishPrivatePathServiceGatewayOptions, - "unpublishPrivatePathServiceGatewayOptions cannot be null"); + public ServiceCall updateVpnServerRoute(UpdateVpnServerRouteOptions updateVpnServerRouteOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull(updateVpnServerRouteOptions, + "updateVpnServerRouteOptions cannot be null"); Map pathParamsMap = new HashMap(); - pathParamsMap.put("private_path_service_gateway_id", unpublishPrivatePathServiceGatewayOptions.privatePathServiceGatewayId()); - RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/private_path_service_gateways/{private_path_service_gateway_id}/unpublish", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "unpublishPrivatePathServiceGateway"); + pathParamsMap.put("vpn_server_id", updateVpnServerRouteOptions.vpnServerId()); + pathParamsMap.put("id", updateVpnServerRouteOptions.id()); + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/vpn_servers/{vpn_server_id}/routes/{id}", pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("vpc", "v1", "updateVpnServerRoute"); for (Entry header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } + builder.header("Accept", "application/json"); builder.query("version", String.valueOf(this.version)); builder.query("generation", String.valueOf(this.generation)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateVpnServerRouteOptions.vpnServerRoutePatch()), "application/merge-patch+json"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken() { }.getType()); return createServiceCall(builder.build(), responseConverter); } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayAdvertisedCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayAdvertisedCidrOptions.java new file mode 100644 index 0000000000..3ca5ca54a2 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayAdvertisedCidrOptions.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The addVpnGatewayAdvertisedCidr options. + */ +public class AddVpnGatewayAdvertisedCidrOptions extends GenericModel { + + protected String vpnGatewayId; + protected String cidr; + + /** + * Builder. + */ + public static class Builder { + private String vpnGatewayId; + private String cidr; + + /** + * Instantiates a new Builder from an existing AddVpnGatewayAdvertisedCidrOptions instance. + * + * @param addVpnGatewayAdvertisedCidrOptions the instance to initialize the Builder with + */ + private Builder(AddVpnGatewayAdvertisedCidrOptions addVpnGatewayAdvertisedCidrOptions) { + this.vpnGatewayId = addVpnGatewayAdvertisedCidrOptions.vpnGatewayId; + this.cidr = addVpnGatewayAdvertisedCidrOptions.cidr; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param vpnGatewayId the vpnGatewayId + * @param cidr the cidr + */ + public Builder(String vpnGatewayId, String cidr) { + this.vpnGatewayId = vpnGatewayId; + this.cidr = cidr; + } + + /** + * Builds a AddVpnGatewayAdvertisedCidrOptions. + * + * @return the new AddVpnGatewayAdvertisedCidrOptions instance + */ + public AddVpnGatewayAdvertisedCidrOptions build() { + return new AddVpnGatewayAdvertisedCidrOptions(this); + } + + /** + * Set the vpnGatewayId. + * + * @param vpnGatewayId the vpnGatewayId + * @return the AddVpnGatewayAdvertisedCidrOptions builder + */ + public Builder vpnGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + return this; + } + + /** + * Set the cidr. + * + * @param cidr the cidr + * @return the AddVpnGatewayAdvertisedCidrOptions builder + */ + public Builder cidr(String cidr) { + this.cidr = cidr; + return this; + } + } + + protected AddVpnGatewayAdvertisedCidrOptions() { } + + protected AddVpnGatewayAdvertisedCidrOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, + "vpnGatewayId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.cidr, + "cidr cannot be empty"); + vpnGatewayId = builder.vpnGatewayId; + cidr = builder.cidr; + } + + /** + * New builder. + * + * @return a AddVpnGatewayAdvertisedCidrOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the vpnGatewayId. + * + * The VPN gateway identifier. + * + * @return the vpnGatewayId + */ + public String vpnGatewayId() { + return vpnGatewayId; + } + + /** + * Gets the cidr. + * + * The IP address range in CIDR block notation. + * + * @return the cidr + */ + public String cidr() { + return cidr; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.java index bc5abae897..7e55fc281c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BackupPolicyPrototypeBackupPolicyMatchResourceTypeInstancePrototype.java @@ -34,6 +34,9 @@ public interface IncludedContent { /** * The resource type this backup policy will apply to. Resources that have both a matching type and a matching user * tag will be subject to the backup policy. + * + * A backup policy of type `instance` will create a backup of all volumes with a + * `storage_generation` value of `1` attached to the instance. */ public interface MatchResourceType { /** instance. */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServer.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServer.java index eab6ac5916..c988c57a2b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServer.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServer.java @@ -130,6 +130,8 @@ public interface Status { @SerializedName("lifecycle_state") protected String lifecycleState; protected Long memory; + @SerializedName("metadata_service") + protected BareMetalServerMetadataService metadataService; protected String name; @SerializedName("network_attachments") protected List networkAttachments; @@ -343,6 +345,17 @@ public Long getMemory() { return memory; } + /** + * Gets the metadataService. + * + * The metadata service configuration for the bare metal server. + * + * @return the metadataService + */ + public BareMetalServerMetadataService getMetadataService() { + return metadataService; + } + /** * Gets the name. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDisk.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDisk.java index da42a483d8..ff6ac65a91 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDisk.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDisk.java @@ -49,6 +49,8 @@ public interface ResourceType { String BARE_METAL_SERVER_DISK = "bare_metal_server_disk"; } + @SerializedName("allowed_use") + protected BareMetalServerDiskAllowedUse allowedUse; @SerializedName("created_at") protected Date createdAt; protected String href; @@ -62,6 +64,21 @@ public interface ResourceType { protected BareMetalServerDisk() { } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against the requested bare metal server + * properties to determine compatibility. + * + * Only present for disks which are referenced in a bare metal server's `boot_target` + * property. The value of this property will be inherited from the source image at creation. + * + * @return the allowedUse + */ + public BareMetalServerDiskAllowedUse getAllowedUse() { + return allowedUse; + } + /** * Gets the createdAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskAllowedUse.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskAllowedUse.java new file mode 100644 index 0000000000..ec7a7ba6fe --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskAllowedUse.java @@ -0,0 +1,62 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * BareMetalServerDiskAllowedUse. + */ +public class BareMetalServerDiskAllowedUse extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + + protected BareMetalServerDiskAllowedUse() { } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * If specified, the value must be between `2019-01-01` and today's date (in UTC). If unspecified, the `version` query + * parameter value will be used. + * + * @return the apiVersion + */ + public String getApiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using the image data in + * this disk. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String getBareMetalServer() { + return bareMetalServer; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitialization.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitialization.java index f4a65f32bc..754db1caad 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitialization.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitialization.java @@ -23,6 +23,8 @@ */ public class BareMetalServerInitialization extends GenericModel { + @SerializedName("default_trusted_profile") + protected BareMetalServerInitializationDefaultTrustedProfile defaultTrustedProfile; protected ImageReference image; protected List keys; @SerializedName("user_accounts") @@ -30,6 +32,18 @@ public class BareMetalServerInitialization extends GenericModel { protected BareMetalServerInitialization() { } + /** + * Gets the defaultTrustedProfile. + * + * The default trusted profile configuration specified at bare metal server + * initialization. If absent, no default trusted profile was specified. + * + * @return the defaultTrustedProfile + */ + public BareMetalServerInitializationDefaultTrustedProfile getDefaultTrustedProfile() { + return defaultTrustedProfile; + } + /** * Gets the image. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfile.java new file mode 100644 index 0000000000..0f64a2aa6c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfile.java @@ -0,0 +1,54 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * BareMetalServerInitializationDefaultTrustedProfile. + */ +public class BareMetalServerInitializationDefaultTrustedProfile extends GenericModel { + + @SerializedName("auto_link") + protected Boolean autoLink; + protected TrustedProfileReference target; + + protected BareMetalServerInitializationDefaultTrustedProfile() { } + + /** + * Gets the autoLink. + * + * If set to `true`, the system created a link to the specified `target` trusted profile during server initialization. + * Regardless of whether a link was created by the system or manually using the IAM Identity service, the link will be + * automatically deleted when the server is deleted. + * + * @return the autoLink + */ + public Boolean isAutoLink() { + return autoLink; + } + + /** + * Gets the target. + * + * The default IAM trusted profile to use for this bare metal server. + * + * @return the target + */ + public TrustedProfileReference getTarget() { + return target; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfilePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfilePrototype.java new file mode 100644 index 0000000000..55b4010972 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfilePrototype.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * BareMetalServerInitializationDefaultTrustedProfilePrototype. + */ +public class BareMetalServerInitializationDefaultTrustedProfilePrototype extends GenericModel { + + @SerializedName("auto_link") + protected Boolean autoLink; + protected TrustedProfileIdentity target; + + /** + * Builder. + */ + public static class Builder { + private Boolean autoLink; + private TrustedProfileIdentity target; + + /** + * Instantiates a new Builder from an existing BareMetalServerInitializationDefaultTrustedProfilePrototype instance. + * + * @param bareMetalServerInitializationDefaultTrustedProfilePrototype the instance to initialize the Builder with + */ + private Builder(BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototype) { + this.autoLink = bareMetalServerInitializationDefaultTrustedProfilePrototype.autoLink; + this.target = bareMetalServerInitializationDefaultTrustedProfilePrototype.target; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param target the target + */ + public Builder(TrustedProfileIdentity target) { + this.target = target; + } + + /** + * Builds a BareMetalServerInitializationDefaultTrustedProfilePrototype. + * + * @return the new BareMetalServerInitializationDefaultTrustedProfilePrototype instance + */ + public BareMetalServerInitializationDefaultTrustedProfilePrototype build() { + return new BareMetalServerInitializationDefaultTrustedProfilePrototype(this); + } + + /** + * Set the autoLink. + * + * @param autoLink the autoLink + * @return the BareMetalServerInitializationDefaultTrustedProfilePrototype builder + */ + public Builder autoLink(Boolean autoLink) { + this.autoLink = autoLink; + return this; + } + + /** + * Set the target. + * + * @param target the target + * @return the BareMetalServerInitializationDefaultTrustedProfilePrototype builder + */ + public Builder target(TrustedProfileIdentity target) { + this.target = target; + return this; + } + } + + protected BareMetalServerInitializationDefaultTrustedProfilePrototype() { } + + protected BareMetalServerInitializationDefaultTrustedProfilePrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, + "target cannot be null"); + autoLink = builder.autoLink; + target = builder.target; + } + + /** + * New builder. + * + * @return a BareMetalServerInitializationDefaultTrustedProfilePrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the autoLink. + * + * If set to `true`, the system will create a link to the specified `target` trusted profile during server creation. + * Regardless of whether a link is created by the system or manually using the IAM Identity service, it will be + * automatically deleted when the server is deleted. + * + * @return the autoLink + */ + public Boolean autoLink() { + return autoLink; + } + + /** + * Gets the target. + * + * The default IAM trusted profile to use for this bare metal server. + * + * @return the target + */ + public TrustedProfileIdentity target() { + return target; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java index e86e3c860b..343b24ac49 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototype.java @@ -24,6 +24,8 @@ */ public class BareMetalServerInitializationPrototype extends GenericModel { + @SerializedName("default_trusted_profile") + protected BareMetalServerInitializationDefaultTrustedProfilePrototype defaultTrustedProfile; protected ImageIdentity image; protected List keys; @SerializedName("user_data") @@ -33,6 +35,7 @@ public class BareMetalServerInitializationPrototype extends GenericModel { * Builder. */ public static class Builder { + private BareMetalServerInitializationDefaultTrustedProfilePrototype defaultTrustedProfile; private ImageIdentity image; private List keys; private String userData; @@ -43,6 +46,7 @@ public static class Builder { * @param bareMetalServerInitializationPrototype the instance to initialize the Builder with */ private Builder(BareMetalServerInitializationPrototype bareMetalServerInitializationPrototype) { + this.defaultTrustedProfile = bareMetalServerInitializationPrototype.defaultTrustedProfile; this.image = bareMetalServerInitializationPrototype.image; this.keys = bareMetalServerInitializationPrototype.keys; this.userData = bareMetalServerInitializationPrototype.userData; @@ -90,6 +94,17 @@ public Builder addKeys(KeyIdentity keys) { return this; } + /** + * Set the defaultTrustedProfile. + * + * @param defaultTrustedProfile the defaultTrustedProfile + * @return the BareMetalServerInitializationPrototype builder + */ + public Builder defaultTrustedProfile(BareMetalServerInitializationDefaultTrustedProfilePrototype defaultTrustedProfile) { + this.defaultTrustedProfile = defaultTrustedProfile; + return this; + } + /** * Set the image. * @@ -132,6 +147,7 @@ protected BareMetalServerInitializationPrototype(Builder builder) { "image cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.keys, "keys cannot be null"); + defaultTrustedProfile = builder.defaultTrustedProfile; image = builder.image; keys = builder.keys; userData = builder.userData; @@ -146,6 +162,19 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the defaultTrustedProfile. + * + * The default trusted profile to be used when initializing the bare metal server. + * + * If unspecified, no default trusted profile will be made available. + * + * @return the defaultTrustedProfile + */ + public BareMetalServerInitializationDefaultTrustedProfilePrototype defaultTrustedProfile() { + return defaultTrustedProfile; + } + /** * Gets the image. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataService.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataService.java new file mode 100644 index 0000000000..27e78d1b28 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataService.java @@ -0,0 +1,66 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The metadata service configuration for the bare metal server. + */ +public class BareMetalServerMetadataService extends GenericModel { + + /** + * The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + * enabled. + * - `http`: HTTP protocol (unencrypted) + * - `https`: HTTP Secure protocol. + */ + public interface Protocol { + /** http. */ + String HTTP = "http"; + /** https. */ + String HTTPS = "https"; + } + + protected Boolean enabled; + protected String protocol; + + protected BareMetalServerMetadataService() { } + + /** + * Gets the enabled. + * + * Indicates whether the metadata service endpoint is available to the bare metal server. + * + * @return the enabled + */ + public Boolean isEnabled() { + return enabled; + } + + /** + * Gets the protocol. + * + * The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + * enabled. + * - `http`: HTTP protocol (unencrypted) + * - `https`: HTTP Secure protocol. + * + * @return the protocol + */ + public String getProtocol() { + return protocol; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePatch.java new file mode 100644 index 0000000000..c67681cfbc --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePatch.java @@ -0,0 +1,135 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The metadata service configuration for the bare metal server. + */ +public class BareMetalServerMetadataServicePatch extends GenericModel { + + /** + * The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + * enabled. + * - `http`: HTTP protocol (unencrypted) + * - `https`: HTTP Secure protocol. + */ + public interface Protocol { + /** http. */ + String HTTP = "http"; + /** https. */ + String HTTPS = "https"; + } + + protected Boolean enabled; + protected String protocol; + + /** + * Builder. + */ + public static class Builder { + private Boolean enabled; + private String protocol; + + /** + * Instantiates a new Builder from an existing BareMetalServerMetadataServicePatch instance. + * + * @param bareMetalServerMetadataServicePatch the instance to initialize the Builder with + */ + private Builder(BareMetalServerMetadataServicePatch bareMetalServerMetadataServicePatch) { + this.enabled = bareMetalServerMetadataServicePatch.enabled; + this.protocol = bareMetalServerMetadataServicePatch.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a BareMetalServerMetadataServicePatch. + * + * @return the new BareMetalServerMetadataServicePatch instance + */ + public BareMetalServerMetadataServicePatch build() { + return new BareMetalServerMetadataServicePatch(this); + } + + /** + * Set the enabled. + * + * @param enabled the enabled + * @return the BareMetalServerMetadataServicePatch builder + */ + public Builder enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the BareMetalServerMetadataServicePatch builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected BareMetalServerMetadataServicePatch() { } + + protected BareMetalServerMetadataServicePatch(Builder builder) { + enabled = builder.enabled; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a BareMetalServerMetadataServicePatch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the enabled. + * + * Indicates whether the metadata service endpoint will be available to the bare metal server. + * + * @return the enabled + */ + public Boolean enabled() { + return enabled; + } + + /** + * Gets the protocol. + * + * The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + * enabled. + * - `http`: HTTP protocol (unencrypted) + * - `https`: HTTP Secure protocol. + * + * @return the protocol + */ + public String protocol() { + return protocol; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePrototype.java new file mode 100644 index 0000000000..01ee811056 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePrototype.java @@ -0,0 +1,135 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The metadata service configuration for the bare metal server. + */ +public class BareMetalServerMetadataServicePrototype extends GenericModel { + + /** + * The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + * enabled. + * - `http`: HTTP protocol (unencrypted) + * - `https`: HTTP Secure protocol. + */ + public interface Protocol { + /** http. */ + String HTTP = "http"; + /** https. */ + String HTTPS = "https"; + } + + protected Boolean enabled; + protected String protocol; + + /** + * Builder. + */ + public static class Builder { + private Boolean enabled; + private String protocol; + + /** + * Instantiates a new Builder from an existing BareMetalServerMetadataServicePrototype instance. + * + * @param bareMetalServerMetadataServicePrototype the instance to initialize the Builder with + */ + private Builder(BareMetalServerMetadataServicePrototype bareMetalServerMetadataServicePrototype) { + this.enabled = bareMetalServerMetadataServicePrototype.enabled; + this.protocol = bareMetalServerMetadataServicePrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a BareMetalServerMetadataServicePrototype. + * + * @return the new BareMetalServerMetadataServicePrototype instance + */ + public BareMetalServerMetadataServicePrototype build() { + return new BareMetalServerMetadataServicePrototype(this); + } + + /** + * Set the enabled. + * + * @param enabled the enabled + * @return the BareMetalServerMetadataServicePrototype builder + */ + public Builder enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the BareMetalServerMetadataServicePrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected BareMetalServerMetadataServicePrototype() { } + + protected BareMetalServerMetadataServicePrototype(Builder builder) { + enabled = builder.enabled; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a BareMetalServerMetadataServicePrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the enabled. + * + * Indicates whether the metadata service endpoint will be available to the bare metal server. + * + * @return the enabled + */ + public Boolean enabled() { + return enabled; + } + + /** + * Gets the protocol. + * + * The communication protocol to use for the metadata service endpoint. Applies only when the metadata service is + * enabled. + * - `http`: HTTP protocol (unencrypted) + * - `https`: HTTP Secure protocol. + * + * @return the protocol + */ + public String protocol() { + return protocol; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatch.java index 47d70351f2..387bc10469 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatch.java @@ -27,6 +27,8 @@ public class BareMetalServerPatch extends GenericModel { protected Long bandwidth; @SerializedName("enable_secure_boot") protected Boolean enableSecureBoot; + @SerializedName("metadata_service") + protected BareMetalServerMetadataServicePatch metadataService; protected String name; @SerializedName("reservation_affinity") protected BareMetalServerReservationAffinityPatch reservationAffinity; @@ -39,6 +41,7 @@ public class BareMetalServerPatch extends GenericModel { public static class Builder { private Long bandwidth; private Boolean enableSecureBoot; + private BareMetalServerMetadataServicePatch metadataService; private String name; private BareMetalServerReservationAffinityPatch reservationAffinity; private BareMetalServerTrustedPlatformModulePatch trustedPlatformModule; @@ -51,6 +54,7 @@ public static class Builder { private Builder(BareMetalServerPatch bareMetalServerPatch) { this.bandwidth = bareMetalServerPatch.bandwidth; this.enableSecureBoot = bareMetalServerPatch.enableSecureBoot; + this.metadataService = bareMetalServerPatch.metadataService; this.name = bareMetalServerPatch.name; this.reservationAffinity = bareMetalServerPatch.reservationAffinity; this.trustedPlatformModule = bareMetalServerPatch.trustedPlatformModule; @@ -93,6 +97,17 @@ public Builder enableSecureBoot(Boolean enableSecureBoot) { return this; } + /** + * Set the metadataService. + * + * @param metadataService the metadataService + * @return the BareMetalServerPatch builder + */ + public Builder metadataService(BareMetalServerMetadataServicePatch metadataService) { + this.metadataService = metadataService; + return this; + } + /** * Set the name. * @@ -132,6 +147,7 @@ protected BareMetalServerPatch() { } protected BareMetalServerPatch(Builder builder) { bandwidth = builder.bandwidth; enableSecureBoot = builder.enableSecureBoot; + metadataService = builder.metadataService; name = builder.name; reservationAffinity = builder.reservationAffinity; trustedPlatformModule = builder.trustedPlatformModule; @@ -173,6 +189,17 @@ public Boolean enableSecureBoot() { return enableSecureBoot; } + /** + * Gets the metadataService. + * + * The metadata service configuration for the bare metal server. + * + * @return the metadataService + */ + public BareMetalServerMetadataServicePatch metadataService() { + return metadataService; + } + /** * Gets the name. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototype.java index 7f7c37ef52..a60be7a9cb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototype.java @@ -31,6 +31,8 @@ public class BareMetalServerPrototype extends GenericModel { @SerializedName("enable_secure_boot") protected Boolean enableSecureBoot; protected BareMetalServerInitializationPrototype initialization; + @SerializedName("metadata_service") + protected BareMetalServerMetadataServicePrototype metadataService; protected String name; protected BareMetalServerProfileIdentity profile; @SerializedName("reservation_affinity") @@ -86,6 +88,17 @@ public BareMetalServerInitializationPrototype initialization() { return initialization; } + /** + * Gets the metadataService. + * + * The metadata service configuration for the bare metal server. + * + * @return the metadataService + */ + public BareMetalServerMetadataServicePrototype metadataService() { + return metadataService; + } + /** * Gets the name. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkAttachment.java index 7abe41d6e6..412f036b49 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkAttachment.java @@ -29,6 +29,7 @@ public static class Builder { private Long bandwidth; private Boolean enableSecureBoot; private BareMetalServerInitializationPrototype initialization; + private BareMetalServerMetadataServicePrototype metadataService; private String name; private BareMetalServerProfileIdentity profile; private BareMetalServerReservationAffinityPrototype reservationAffinity; @@ -48,6 +49,7 @@ public Builder(BareMetalServerPrototype bareMetalServerPrototypeBareMetalServerB this.bandwidth = bareMetalServerPrototypeBareMetalServerByNetworkAttachment.bandwidth; this.enableSecureBoot = bareMetalServerPrototypeBareMetalServerByNetworkAttachment.enableSecureBoot; this.initialization = bareMetalServerPrototypeBareMetalServerByNetworkAttachment.initialization; + this.metadataService = bareMetalServerPrototypeBareMetalServerByNetworkAttachment.metadataService; this.name = bareMetalServerPrototypeBareMetalServerByNetworkAttachment.name; this.profile = bareMetalServerPrototypeBareMetalServerByNetworkAttachment.profile; this.reservationAffinity = bareMetalServerPrototypeBareMetalServerByNetworkAttachment.reservationAffinity; @@ -138,6 +140,17 @@ public Builder initialization(BareMetalServerInitializationPrototype initializat return this; } + /** + * Set the metadataService. + * + * @param metadataService the metadataService + * @return the BareMetalServerPrototypeBareMetalServerByNetworkAttachment builder + */ + public Builder metadataService(BareMetalServerMetadataServicePrototype metadataService) { + this.metadataService = metadataService; + return this; + } + /** * Set the name. * @@ -253,6 +266,7 @@ protected BareMetalServerPrototypeBareMetalServerByNetworkAttachment(Builder bui bandwidth = builder.bandwidth; enableSecureBoot = builder.enableSecureBoot; initialization = builder.initialization; + metadataService = builder.metadataService; name = builder.name; profile = builder.profile; reservationAffinity = builder.reservationAffinity; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkInterface.java index 0b5ae9d549..85cd00980e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkInterface.java @@ -29,6 +29,7 @@ public static class Builder { private Long bandwidth; private Boolean enableSecureBoot; private BareMetalServerInitializationPrototype initialization; + private BareMetalServerMetadataServicePrototype metadataService; private String name; private BareMetalServerProfileIdentity profile; private BareMetalServerReservationAffinityPrototype reservationAffinity; @@ -48,6 +49,7 @@ public Builder(BareMetalServerPrototype bareMetalServerPrototypeBareMetalServerB this.bandwidth = bareMetalServerPrototypeBareMetalServerByNetworkInterface.bandwidth; this.enableSecureBoot = bareMetalServerPrototypeBareMetalServerByNetworkInterface.enableSecureBoot; this.initialization = bareMetalServerPrototypeBareMetalServerByNetworkInterface.initialization; + this.metadataService = bareMetalServerPrototypeBareMetalServerByNetworkInterface.metadataService; this.name = bareMetalServerPrototypeBareMetalServerByNetworkInterface.name; this.profile = bareMetalServerPrototypeBareMetalServerByNetworkInterface.profile; this.reservationAffinity = bareMetalServerPrototypeBareMetalServerByNetworkInterface.reservationAffinity; @@ -138,6 +140,17 @@ public Builder initialization(BareMetalServerInitializationPrototype initializat return this; } + /** + * Set the metadataService. + * + * @param metadataService the metadataService + * @return the BareMetalServerPrototypeBareMetalServerByNetworkInterface builder + */ + public Builder metadataService(BareMetalServerMetadataServicePrototype metadataService) { + this.metadataService = metadataService; + return this; + } + /** * Set the name. * @@ -253,6 +266,7 @@ protected BareMetalServerPrototypeBareMetalServerByNetworkInterface(Builder buil bandwidth = builder.bandwidth; enableSecureBoot = builder.enableSecureBoot; initialization = builder.initialization; + metadataService = builder.metadataService; name = builder.name; profile = builder.profile; reservationAffinity = builder.reservationAffinity; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayAdvertisedCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayAdvertisedCidrOptions.java new file mode 100644 index 0000000000..28c3c32f6e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayAdvertisedCidrOptions.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The checkVpnGatewayAdvertisedCidr options. + */ +public class CheckVpnGatewayAdvertisedCidrOptions extends GenericModel { + + protected String vpnGatewayId; + protected String cidr; + + /** + * Builder. + */ + public static class Builder { + private String vpnGatewayId; + private String cidr; + + /** + * Instantiates a new Builder from an existing CheckVpnGatewayAdvertisedCidrOptions instance. + * + * @param checkVpnGatewayAdvertisedCidrOptions the instance to initialize the Builder with + */ + private Builder(CheckVpnGatewayAdvertisedCidrOptions checkVpnGatewayAdvertisedCidrOptions) { + this.vpnGatewayId = checkVpnGatewayAdvertisedCidrOptions.vpnGatewayId; + this.cidr = checkVpnGatewayAdvertisedCidrOptions.cidr; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param vpnGatewayId the vpnGatewayId + * @param cidr the cidr + */ + public Builder(String vpnGatewayId, String cidr) { + this.vpnGatewayId = vpnGatewayId; + this.cidr = cidr; + } + + /** + * Builds a CheckVpnGatewayAdvertisedCidrOptions. + * + * @return the new CheckVpnGatewayAdvertisedCidrOptions instance + */ + public CheckVpnGatewayAdvertisedCidrOptions build() { + return new CheckVpnGatewayAdvertisedCidrOptions(this); + } + + /** + * Set the vpnGatewayId. + * + * @param vpnGatewayId the vpnGatewayId + * @return the CheckVpnGatewayAdvertisedCidrOptions builder + */ + public Builder vpnGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + return this; + } + + /** + * Set the cidr. + * + * @param cidr the cidr + * @return the CheckVpnGatewayAdvertisedCidrOptions builder + */ + public Builder cidr(String cidr) { + this.cidr = cidr; + return this; + } + } + + protected CheckVpnGatewayAdvertisedCidrOptions() { } + + protected CheckVpnGatewayAdvertisedCidrOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, + "vpnGatewayId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.cidr, + "cidr cannot be empty"); + vpnGatewayId = builder.vpnGatewayId; + cidr = builder.cidr; + } + + /** + * New builder. + * + * @return a CheckVpnGatewayAdvertisedCidrOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the vpnGatewayId. + * + * The VPN gateway identifier. + * + * @return the vpnGatewayId + */ + public String vpnGatewayId() { + return vpnGatewayId; + } + + /** + * Gets the cidr. + * + * The IP address range in CIDR block notation. + * + * @return the cidr + */ + public String cidr() { + return cidr; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptions.java index 834246f2ad..24153bbe40 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptions.java @@ -23,9 +23,43 @@ */ public class CreateEndpointGatewayOptions extends GenericModel { + /** + * The DNS resolution binding mode to use for this endpoint gateway: + * - `disabled`: The endpoint gateway will not participate in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) with other VPCs in a connected + * topology. + * - `primary`: The endpoint gateway will participate in [DNS sharing for VPE gateways] + * (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + * has a DNS resolution binding to another VPC. If the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC, then no other VPC in the + * topology can have an endpoint gateway with the same `target` as this endpoint + * gateway. + * - `per_resource_binding`: The endpoint gateway will participate in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC. Resource binding must be + * enabled for the `target` service. + * + * The VPC this endpoint gateway resides in must have `dns.enable_hub` set to + * `false`. + * + * If the VPC this endpoint gateway resides in has DNS resolution binding to another + * VPC, the other VPC must: + * - have `dns.enable_hub` set to `true` + * - contain an endpoint gateway for the same `target` service with + * `dns_resolution_binding_mode` set to `primary`. + */ + public interface DnsResolutionBindingMode { + /** disabled. */ + String DISABLED = "disabled"; + /** per_resource_binding. */ + String PER_RESOURCE_BINDING = "per_resource_binding"; + /** primary. */ + String PRIMARY = "primary"; + } + protected EndpointGatewayTargetPrototype target; protected VPCIdentity vpc; - protected Boolean allowDnsResolutionBinding; + protected String dnsResolutionBindingMode; protected List ips; protected String name; protected ResourceGroupIdentity resourceGroup; @@ -37,7 +71,7 @@ public class CreateEndpointGatewayOptions extends GenericModel { public static class Builder { private EndpointGatewayTargetPrototype target; private VPCIdentity vpc; - private Boolean allowDnsResolutionBinding; + private String dnsResolutionBindingMode; private List ips; private String name; private ResourceGroupIdentity resourceGroup; @@ -51,7 +85,7 @@ public static class Builder { private Builder(CreateEndpointGatewayOptions createEndpointGatewayOptions) { this.target = createEndpointGatewayOptions.target; this.vpc = createEndpointGatewayOptions.vpc; - this.allowDnsResolutionBinding = createEndpointGatewayOptions.allowDnsResolutionBinding; + this.dnsResolutionBindingMode = createEndpointGatewayOptions.dnsResolutionBindingMode; this.ips = createEndpointGatewayOptions.ips; this.name = createEndpointGatewayOptions.name; this.resourceGroup = createEndpointGatewayOptions.resourceGroup; @@ -139,13 +173,13 @@ public Builder vpc(VPCIdentity vpc) { } /** - * Set the allowDnsResolutionBinding. + * Set the dnsResolutionBindingMode. * - * @param allowDnsResolutionBinding the allowDnsResolutionBinding + * @param dnsResolutionBindingMode the dnsResolutionBindingMode * @return the CreateEndpointGatewayOptions builder */ - public Builder allowDnsResolutionBinding(Boolean allowDnsResolutionBinding) { - this.allowDnsResolutionBinding = allowDnsResolutionBinding; + public Builder dnsResolutionBindingMode(String dnsResolutionBindingMode) { + this.dnsResolutionBindingMode = dnsResolutionBindingMode; return this; } @@ -205,7 +239,7 @@ protected CreateEndpointGatewayOptions(Builder builder) { "vpc cannot be null"); target = builder.target; vpc = builder.vpc; - allowDnsResolutionBinding = builder.allowDnsResolutionBinding; + dnsResolutionBindingMode = builder.dnsResolutionBindingMode; ips = builder.ips; name = builder.name; resourceGroup = builder.resourceGroup; @@ -226,16 +260,24 @@ public Builder newBuilder() { * * The target to use for this endpoint gateway. The target: * - Must not already be the target of another endpoint gateway in the VPC - * - Must not have a service endpoint that overlaps with any `service_endpoints` of another - * endpoint gateway in the VPC. + * - Must not have a service endpoint that overlaps with any `service_endpoints` of + * another endpoint gateway in the VPC. * - * If `allow_dns_resolution_binding` is `true`, then there must not be another endpoint gateway - * with `allow_dns_resolution_binding` set to `true` in the [DNS - * sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected topology that: + * If `dns_resolution_binding_mode` is set to `primary`, then there must not be + * another endpoint gateway in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) + * connected topology that: * - Has the same `target` as this endpoint gateway * - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint * gateway. * + * If `dns_resolution_binding_mode` is set to `per_resource_binding`, then: + * - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + * gateway with the same `target` as this endpoint gateway. + * - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + * gateway with `dns_resolution_binding_mode` set to `primary`. + * - No other VPC in the topology can have an endpoint gateway with a resource binding + * using the same `service_endpoint` as a resource binding for this endpoint gateway. + * * @return the target */ public EndpointGatewayTargetPrototype target() { @@ -254,25 +296,36 @@ public VPCIdentity vpc() { } /** - * Gets the allowDnsResolutionBinding. + * Gets the dnsResolutionBindingMode. * - * Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - * has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. + * The DNS resolution binding mode to use for this endpoint gateway: + * - `disabled`: The endpoint gateway will not participate in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) with other VPCs in a connected + * topology. + * - `primary`: The endpoint gateway will participate in [DNS sharing for VPE gateways] + * (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + * has a DNS resolution binding to another VPC. If the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC, then no other VPC in the + * topology can have an endpoint gateway with the same `target` as this endpoint + * gateway. + * - `per_resource_binding`: The endpoint gateway will participate in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC. Resource binding must be + * enabled for the `target` service. * - * If `true`, then there must not be another endpoint gateway with - * `allow_dns_resolution_binding` set to `true` in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected - * topology that: - * - Has the same `target` as this endpoint gateway - * - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint - * gateway. + * The VPC this endpoint gateway resides in must have `dns.enable_hub` set to + * `false`. * - * Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to - * `true`. + * If the VPC this endpoint gateway resides in has DNS resolution binding to another + * VPC, the other VPC must: + * - have `dns.enable_hub` set to `true` + * - contain an endpoint gateway for the same `target` service with + * `dns_resolution_binding_mode` set to `primary`. * - * @return the allowDnsResolutionBinding + * @return the dnsResolutionBindingMode */ - public Boolean allowDnsResolutionBinding() { - return allowDnsResolutionBinding; + public String dnsResolutionBindingMode() { + return dnsResolutionBindingMode; } /** diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayResourceBindingOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayResourceBindingOptions.java new file mode 100644 index 0000000000..d46ab15b84 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayResourceBindingOptions.java @@ -0,0 +1,161 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The createEndpointGatewayResourceBinding options. + */ +public class CreateEndpointGatewayResourceBindingOptions extends GenericModel { + + protected String endpointGatewayId; + protected EndpointGatewayResourceBindingTargetPrototype target; + protected String name; + + /** + * Builder. + */ + public static class Builder { + private String endpointGatewayId; + private EndpointGatewayResourceBindingTargetPrototype target; + private String name; + + /** + * Instantiates a new Builder from an existing CreateEndpointGatewayResourceBindingOptions instance. + * + * @param createEndpointGatewayResourceBindingOptions the instance to initialize the Builder with + */ + private Builder(CreateEndpointGatewayResourceBindingOptions createEndpointGatewayResourceBindingOptions) { + this.endpointGatewayId = createEndpointGatewayResourceBindingOptions.endpointGatewayId; + this.target = createEndpointGatewayResourceBindingOptions.target; + this.name = createEndpointGatewayResourceBindingOptions.name; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param endpointGatewayId the endpointGatewayId + * @param target the target + */ + public Builder(String endpointGatewayId, EndpointGatewayResourceBindingTargetPrototype target) { + this.endpointGatewayId = endpointGatewayId; + this.target = target; + } + + /** + * Builds a CreateEndpointGatewayResourceBindingOptions. + * + * @return the new CreateEndpointGatewayResourceBindingOptions instance + */ + public CreateEndpointGatewayResourceBindingOptions build() { + return new CreateEndpointGatewayResourceBindingOptions(this); + } + + /** + * Set the endpointGatewayId. + * + * @param endpointGatewayId the endpointGatewayId + * @return the CreateEndpointGatewayResourceBindingOptions builder + */ + public Builder endpointGatewayId(String endpointGatewayId) { + this.endpointGatewayId = endpointGatewayId; + return this; + } + + /** + * Set the target. + * + * @param target the target + * @return the CreateEndpointGatewayResourceBindingOptions builder + */ + public Builder target(EndpointGatewayResourceBindingTargetPrototype target) { + this.target = target; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the CreateEndpointGatewayResourceBindingOptions builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + } + + protected CreateEndpointGatewayResourceBindingOptions() { } + + protected CreateEndpointGatewayResourceBindingOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, + "endpointGatewayId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.target, + "target cannot be null"); + endpointGatewayId = builder.endpointGatewayId; + target = builder.target; + name = builder.name; + } + + /** + * New builder. + * + * @return a CreateEndpointGatewayResourceBindingOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the endpointGatewayId. + * + * The endpoint gateway identifier. + * + * @return the endpointGatewayId + */ + public String endpointGatewayId() { + return endpointGatewayId; + } + + /** + * Gets the target. + * + * The target to use for this resource binding. + * + * @return the target + */ + public EndpointGatewayResourceBindingTargetPrototype target() { + return target; + } + + /** + * Gets the name. + * + * The name for this resource binding. The name must not be used by another resource binding for the endpoint gateway. + * If unspecified, the name will be a hyphenated list of randomly-selected words. + * + * @return the name + */ + public String name() { + return name; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFlowLogCollectorOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFlowLogCollectorOptions.java index c9fd2ed484..50f866db6d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFlowLogCollectorOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateFlowLogCollectorOptions.java @@ -178,8 +178,10 @@ public LegacyCloudObjectStorageBucketIdentity storageBucket() { * instance network attachments, virtual network interfaces or instance network interfaces * within the target that are themselves the target of a more specific flow log collector. * - * The target must not be a virtual network interface that is attached to a bare metal server - * network attachment or to a file share mount target. + * For this request to succeed, the target must: + * - not be a virtual network interface that is attached to a bare metal server network + * attachment or to a file share mount target + * - not already be the target of another flow log collector. * * @return the target */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptions.java index 1ab4a3a10a..c0cbf78464 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIkePolicyOptions.java @@ -274,7 +274,7 @@ public Long keyLifetime() { /** * Gets the name. * - * The name for this IKE policy. The name must not be used by another IKE policies in the region. If unspecified, the + * The name for this IKE policy. The name must not be used by another IKE policy in the region. If unspecified, the * name will be a hyphenated list of randomly-selected words. * * @return the name diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptions.java index 774f04ee27..f97726c55a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceNetworkInterfaceOptions.java @@ -258,10 +258,11 @@ public String name() { * Gets the primaryIp. * * The primary IP address to bind to the instance network interface. This can be - * specified using an existing reserved IP, or a prototype object for a new reserved IP. + * specified using an existing reserved IP, or a prototype object for a new reserved + * IP. * - * If an existing reserved IP or a prototype object with an address is specified, it must - * be available on the instance network interface's subnet. Otherwise, an + * If an existing reserved IP or a prototype object with an address is specified, it + * must be available on the instance network interface's subnet. Otherwise, an * available address on the subnet will be automatically selected and reserved. * * @return the primaryIp diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptions.java index 7059c58f8d..5598226fab 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateIpsecPolicyOptions.java @@ -308,7 +308,7 @@ public Long keyLifetime() { /** * Gets the name. * - * The name for this IPsec policy. The name must not be used by another IPsec policies in the region. If unspecified, + * The name for this IPsec policy. The name must not be used by another IPsec policy in the region. If unspecified, * the name will be a hyphenated list of randomly-selected words. * * @return the name diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcOptions.java index 41bd6995a1..48b3f906fd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/CreateVpcOptions.java @@ -179,9 +179,9 @@ public String addressPrefixManagement() { * private network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be * connected in this way. This value is set at creation and subsequently immutable. * - * This property has been deprecated. Instead, use a [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to - * connect this VPC to Classic Infrastructure. For more information, see [upcoming - * changes](https://cloud.ibm.com/docs/vpc?topic=vpc-api-change-log#upcoming-changes). + * Setting this property to `true` is supported only for accounts that have been + * [granted approval](https://cloud.ibm.com/docs/vpc?topic=vpc-setting-up-access-to-classic-infrastructure). Instead, + * use a [Transit Gateway](https://cloud.ibm.com/docs/transit-gateway) to connect this VPC to Classic Infrastructure. * * @return the classicAccess * @deprecated this method is deprecated and may be removed in a future release diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroup.java index 9a5398a574..a0a93613f2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroup.java @@ -109,9 +109,11 @@ public ResourceGroupReference getResourceGroup() { * Gets the rules. * * The rules for the default security group for a VPC. Created with: - * - A rule allowing inbound ICMP, TCP and UDP traffic from other interfaces in the - * VPC's default security group - * - A rule allowing outbound ICMP, TCP and UDP traffic to any destination + * - A rule named `inbound-icmp-tcp-udp-from-this-security-group` allowing inbound + * ICMP, TCP and UDP traffic from other interfaces in the VPC's default security + * group + * - A rule named `outbound-icmp-tcp-udp` allowing outbound ICMP, TCP and UDP traffic + * to any destination * * Rules for the default security group may be changed, added or removed. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayResourceBindingOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayResourceBindingOptions.java new file mode 100644 index 0000000000..ee807c64ac --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayResourceBindingOptions.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The deleteEndpointGatewayResourceBinding options. + */ +public class DeleteEndpointGatewayResourceBindingOptions extends GenericModel { + + protected String endpointGatewayId; + protected String id; + + /** + * Builder. + */ + public static class Builder { + private String endpointGatewayId; + private String id; + + /** + * Instantiates a new Builder from an existing DeleteEndpointGatewayResourceBindingOptions instance. + * + * @param deleteEndpointGatewayResourceBindingOptions the instance to initialize the Builder with + */ + private Builder(DeleteEndpointGatewayResourceBindingOptions deleteEndpointGatewayResourceBindingOptions) { + this.endpointGatewayId = deleteEndpointGatewayResourceBindingOptions.endpointGatewayId; + this.id = deleteEndpointGatewayResourceBindingOptions.id; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param endpointGatewayId the endpointGatewayId + * @param id the id + */ + public Builder(String endpointGatewayId, String id) { + this.endpointGatewayId = endpointGatewayId; + this.id = id; + } + + /** + * Builds a DeleteEndpointGatewayResourceBindingOptions. + * + * @return the new DeleteEndpointGatewayResourceBindingOptions instance + */ + public DeleteEndpointGatewayResourceBindingOptions build() { + return new DeleteEndpointGatewayResourceBindingOptions(this); + } + + /** + * Set the endpointGatewayId. + * + * @param endpointGatewayId the endpointGatewayId + * @return the DeleteEndpointGatewayResourceBindingOptions builder + */ + public Builder endpointGatewayId(String endpointGatewayId) { + this.endpointGatewayId = endpointGatewayId; + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the DeleteEndpointGatewayResourceBindingOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + } + + protected DeleteEndpointGatewayResourceBindingOptions() { } + + protected DeleteEndpointGatewayResourceBindingOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, + "endpointGatewayId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + endpointGatewayId = builder.endpointGatewayId; + id = builder.id; + } + + /** + * New builder. + * + * @return a DeleteEndpointGatewayResourceBindingOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the endpointGatewayId. + * + * The endpoint gateway identifier. + * + * @return the endpointGatewayId + */ + public String endpointGatewayId() { + return endpointGatewayId; + } + + /** + * Gets the id. + * + * The resource binding identifier. + * + * @return the id + */ + public String id() { + return id; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVirtualNetworkInterfacesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVirtualNetworkInterfacesOptions.java index 2abb55da39..b65bf74a31 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVirtualNetworkInterfacesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVirtualNetworkInterfacesOptions.java @@ -21,12 +21,14 @@ public class DeleteVirtualNetworkInterfacesOptions extends GenericModel { protected String id; + protected String ifMatch; /** * Builder. */ public static class Builder { private String id; + private String ifMatch; /** * Instantiates a new Builder from an existing DeleteVirtualNetworkInterfacesOptions instance. @@ -35,6 +37,7 @@ public static class Builder { */ private Builder(DeleteVirtualNetworkInterfacesOptions deleteVirtualNetworkInterfacesOptions) { this.id = deleteVirtualNetworkInterfacesOptions.id; + this.ifMatch = deleteVirtualNetworkInterfacesOptions.ifMatch; } /** @@ -71,6 +74,17 @@ public Builder id(String id) { this.id = id; return this; } + + /** + * Set the ifMatch. + * + * @param ifMatch the ifMatch + * @return the DeleteVirtualNetworkInterfacesOptions builder + */ + public Builder ifMatch(String ifMatch) { + this.ifMatch = ifMatch; + return this; + } } protected DeleteVirtualNetworkInterfacesOptions() { } @@ -79,6 +93,7 @@ protected DeleteVirtualNetworkInterfacesOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, "id cannot be empty"); id = builder.id; + ifMatch = builder.ifMatch; } /** @@ -100,5 +115,16 @@ public Builder newBuilder() { public String id() { return id; } + + /** + * Gets the ifMatch. + * + * If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + * + * @return the ifMatch + */ + public String ifMatch() { + return ifMatch; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptions.java index eb0ebbf111..abbb5d68b2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptions.java @@ -22,6 +22,7 @@ public class DeleteVpnGatewayConnectionOptions extends GenericModel { protected String vpnGatewayId; protected String id; + protected String ifMatch; /** * Builder. @@ -29,6 +30,7 @@ public class DeleteVpnGatewayConnectionOptions extends GenericModel { public static class Builder { private String vpnGatewayId; private String id; + private String ifMatch; /** * Instantiates a new Builder from an existing DeleteVpnGatewayConnectionOptions instance. @@ -38,6 +40,7 @@ public static class Builder { private Builder(DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptions) { this.vpnGatewayId = deleteVpnGatewayConnectionOptions.vpnGatewayId; this.id = deleteVpnGatewayConnectionOptions.id; + this.ifMatch = deleteVpnGatewayConnectionOptions.ifMatch; } /** @@ -87,6 +90,17 @@ public Builder id(String id) { this.id = id; return this; } + + /** + * Set the ifMatch. + * + * @param ifMatch the ifMatch + * @return the DeleteVpnGatewayConnectionOptions builder + */ + public Builder ifMatch(String ifMatch) { + this.ifMatch = ifMatch; + return this; + } } protected DeleteVpnGatewayConnectionOptions() { } @@ -98,6 +112,7 @@ protected DeleteVpnGatewayConnectionOptions(Builder builder) { "id cannot be empty"); vpnGatewayId = builder.vpnGatewayId; id = builder.id; + ifMatch = builder.ifMatch; } /** @@ -130,5 +145,16 @@ public String vpnGatewayId() { public String id() { return id; } + + /** + * Gets the ifMatch. + * + * If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + * + * @return the ifMatch + */ + public String ifMatch() { + return ifMatch; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGateway.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGateway.java index 806fa46be8..6712c97cc8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGateway.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGateway.java @@ -24,6 +24,27 @@ */ public class EndpointGateway extends GenericModel { + /** + * The DNS resolution binding mode used for this endpoint gateway: + * - `disabled`: The endpoint gateway is not participating in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing). + * - `primary`: The endpoint gateway is participating in [DNS sharing for VPE gateways] + * (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + * has a DNS resolution binding to another VPC. + * - `per_resource_binding`: The endpoint gateway is participating in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC, and resource binding is + * enabled for the `target` service. + */ + public interface DnsResolutionBindingMode { + /** disabled. */ + String DISABLED = "disabled"; + /** per_resource_binding. */ + String PER_RESOURCE_BINDING = "per_resource_binding"; + /** primary. */ + String PRIMARY = "primary"; + } + /** * The health of this resource: * - `ok`: No abnormal behavior detected @@ -72,11 +93,11 @@ public interface ResourceType { String ENDPOINT_GATEWAY = "endpoint_gateway"; } - @SerializedName("allow_dns_resolution_binding") - protected Boolean allowDnsResolutionBinding; @SerializedName("created_at") protected Date createdAt; protected String crn; + @SerializedName("dns_resolution_binding_mode") + protected String dnsResolutionBindingMode; @SerializedName("health_state") protected String healthState; protected String href; @@ -102,18 +123,6 @@ public interface ResourceType { protected EndpointGateway() { } - /** - * Gets the allowDnsResolutionBinding. - * - * Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - * has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. - * - * @return the allowDnsResolutionBinding - */ - public Boolean isAllowDnsResolutionBinding() { - return allowDnsResolutionBinding; - } - /** * Gets the createdAt. * @@ -136,6 +145,26 @@ public String getCrn() { return crn; } + /** + * Gets the dnsResolutionBindingMode. + * + * The DNS resolution binding mode used for this endpoint gateway: + * - `disabled`: The endpoint gateway is not participating in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing). + * - `primary`: The endpoint gateway is participating in [DNS sharing for VPE gateways] + * (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + * has a DNS resolution binding to another VPC. + * - `per_resource_binding`: The endpoint gateway is participating in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC, and resource binding is + * enabled for the `target` service. + * + * @return the dnsResolutionBindingMode + */ + public String getDnsResolutionBindingMode() { + return dnsResolutionBindingMode; + } + /** * Gets the healthState. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatch.java index 5b0c26a71b..2a14749fec 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatch.java @@ -24,15 +24,49 @@ */ public class EndpointGatewayPatch extends GenericModel { - @SerializedName("allow_dns_resolution_binding") - protected Boolean allowDnsResolutionBinding; + /** + * The DNS resolution binding mode to use for this endpoint gateway: + * - `disabled`: The endpoint gateway will not participate in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) with other VPCs in a connected + * topology. + * - `primary`: The endpoint gateway will participate in [DNS sharing for VPE gateways] + * (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + * has a DNS resolution binding to another VPC. If the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC, then no other VPC in the + * topology can have an endpoint gateway with the same `target` as this endpoint + * gateway. + * - `per_resource_binding`: The endpoint gateway will participate in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC. Resource binding must be + * enabled for the `target` service. + * + * The VPC this endpoint gateway resides in must have `dns.enable_hub` set to + * `false`. + * + * If the VPC this endpoint gateway resides in has DNS resolution binding to another + * VPC, the other VPC must: + * - have `dns.enable_hub` set to `true` + * - contain an endpoint gateway for the same `target` service with + * `dns_resolution_binding_mode` set to `primary`. + */ + public interface DnsResolutionBindingMode { + /** disabled. */ + String DISABLED = "disabled"; + /** per_resource_binding. */ + String PER_RESOURCE_BINDING = "per_resource_binding"; + /** primary. */ + String PRIMARY = "primary"; + } + + @SerializedName("dns_resolution_binding_mode") + protected String dnsResolutionBindingMode; protected String name; /** * Builder. */ public static class Builder { - private Boolean allowDnsResolutionBinding; + private String dnsResolutionBindingMode; private String name; /** @@ -41,7 +75,7 @@ public static class Builder { * @param endpointGatewayPatch the instance to initialize the Builder with */ private Builder(EndpointGatewayPatch endpointGatewayPatch) { - this.allowDnsResolutionBinding = endpointGatewayPatch.allowDnsResolutionBinding; + this.dnsResolutionBindingMode = endpointGatewayPatch.dnsResolutionBindingMode; this.name = endpointGatewayPatch.name; } @@ -61,13 +95,13 @@ public EndpointGatewayPatch build() { } /** - * Set the allowDnsResolutionBinding. + * Set the dnsResolutionBindingMode. * - * @param allowDnsResolutionBinding the allowDnsResolutionBinding + * @param dnsResolutionBindingMode the dnsResolutionBindingMode * @return the EndpointGatewayPatch builder */ - public Builder allowDnsResolutionBinding(Boolean allowDnsResolutionBinding) { - this.allowDnsResolutionBinding = allowDnsResolutionBinding; + public Builder dnsResolutionBindingMode(String dnsResolutionBindingMode) { + this.dnsResolutionBindingMode = dnsResolutionBindingMode; return this; } @@ -86,7 +120,7 @@ public Builder name(String name) { protected EndpointGatewayPatch() { } protected EndpointGatewayPatch(Builder builder) { - allowDnsResolutionBinding = builder.allowDnsResolutionBinding; + dnsResolutionBindingMode = builder.dnsResolutionBindingMode; name = builder.name; } @@ -100,25 +134,36 @@ public Builder newBuilder() { } /** - * Gets the allowDnsResolutionBinding. + * Gets the dnsResolutionBindingMode. * - * Indicates whether to allow DNS resolution for this endpoint gateway when the VPC this endpoint gateway resides in - * has a DNS resolution binding to a VPC with `dns.enable_hub` set to `true`. + * The DNS resolution binding mode to use for this endpoint gateway: + * - `disabled`: The endpoint gateway will not participate in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) with other VPCs in a connected + * topology. + * - `primary`: The endpoint gateway will participate in [DNS sharing for VPE gateways] + * (/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway resides in + * has a DNS resolution binding to another VPC. If the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC, then no other VPC in the + * topology can have an endpoint gateway with the same `target` as this endpoint + * gateway. + * - `per_resource_binding`: The endpoint gateway will participate in [DNS sharing for VPE + * gateways](/docs/vpc?topic=vpc-vpe-dns-sharing) if the VPC this endpoint gateway + * resides in has a DNS resolution binding to another VPC. Resource binding must be + * enabled for the `target` service. * - * If `true`, then there must not be another endpoint gateway with - * `allow_dns_resolution_binding` set to `true` in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected - * topology that: - * - Has the same `target` as this endpoint gateway - * - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint - * gateway. + * The VPC this endpoint gateway resides in must have `dns.enable_hub` set to + * `false`. * - * Must be `true` if the VPC this endpoint gateway resides in has `dns.enable_hub` set to - * `true`. + * If the VPC this endpoint gateway resides in has DNS resolution binding to another + * VPC, the other VPC must: + * - have `dns.enable_hub` set to `true` + * - contain an endpoint gateway for the same `target` service with + * `dns_resolution_binding_mode` set to `primary`. * - * @return the allowDnsResolutionBinding + * @return the dnsResolutionBindingMode */ - public Boolean allowDnsResolutionBinding() { - return allowDnsResolutionBinding; + public String dnsResolutionBindingMode() { + return dnsResolutionBindingMode; } /** diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBinding.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBinding.java new file mode 100644 index 0000000000..0e90ec0391 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBinding.java @@ -0,0 +1,199 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.Date; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * EndpointGatewayResourceBinding. + */ +public class EndpointGatewayResourceBinding extends GenericModel { + + /** + * The lifecycle state of the resource binding. + */ + public interface LifecycleState { + /** deleting. */ + String DELETING = "deleting"; + /** failed. */ + String FAILED = "failed"; + /** pending. */ + String PENDING = "pending"; + /** stable. */ + String STABLE = "stable"; + /** suspended. */ + String SUSPENDED = "suspended"; + /** updating. */ + String UPDATING = "updating"; + /** waiting. */ + String WAITING = "waiting"; + } + + /** + * The resource type. + */ + public interface ResourceType { + /** endpoint_gateway_resource_binding. */ + String ENDPOINT_GATEWAY_RESOURCE_BINDING = "endpoint_gateway_resource_binding"; + } + + /** + * The type of resource binding: + * - `weak`: The binding is not dependent on the existence of the target resource. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface Type { + /** weak. */ + String WEAK = "weak"; + } + + @SerializedName("created_at") + protected Date createdAt; + protected String href; + protected String id; + @SerializedName("lifecycle_reasons") + protected List lifecycleReasons; + @SerializedName("lifecycle_state") + protected String lifecycleState; + protected String name; + @SerializedName("resource_type") + protected String resourceType; + @SerializedName("service_endpoint") + protected String serviceEndpoint; + protected EndpointGatewayResourceBindingTarget target; + protected String type; + + protected EndpointGatewayResourceBinding() { } + + /** + * Gets the createdAt. + * + * The date and time that the resource binding was created. + * + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * Gets the href. + * + * The URL for this endpoint gateway resource binding. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the id. + * + * The unique identifier for this endpoint gateway resource binding. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the lifecycleReasons. + * + * The reasons for the current `lifecycle_state` (if any). + * + * @return the lifecycleReasons + */ + public List getLifecycleReasons() { + return lifecycleReasons; + } + + /** + * Gets the lifecycleState. + * + * The lifecycle state of the resource binding. + * + * @return the lifecycleState + */ + public String getLifecycleState() { + return lifecycleState; + } + + /** + * Gets the name. + * + * The name for this resource binding. The name is unique across all resource bindings for the endpoint gateway. + * + * @return the name + */ + public String getName() { + return name; + } + + /** + * Gets the resourceType. + * + * The resource type. + * + * @return the resourceType + */ + public String getResourceType() { + return resourceType; + } + + /** + * Gets the serviceEndpoint. + * + * The fully qualified domain name of the service endpoint for the resource targeted by this resource binding. + * + * @return the serviceEndpoint + */ + public String getServiceEndpoint() { + return serviceEndpoint; + } + + /** + * Gets the target. + * + * The target for this endpoint gateway resource binding. + * + * @return the target + */ + public EndpointGatewayResourceBindingTarget getTarget() { + return target; + } + + /** + * Gets the type. + * + * The type of resource binding: + * - `weak`: The binding is not dependent on the existence of the target resource. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the type + */ + public String getType() { + return type; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingCollection.java new file mode 100644 index 0000000000..a34a9ae671 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingCollection.java @@ -0,0 +1,92 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * EndpointGatewayResourceBindingCollection. + */ +public class EndpointGatewayResourceBindingCollection extends GenericModel { + + protected PageLink first; + protected Long limit; + protected PageLink next; + @SerializedName("resource_bindings") + protected List resourceBindings; + @SerializedName("total_count") + protected Long totalCount; + + protected EndpointGatewayResourceBindingCollection() { } + + /** + * Gets the first. + * + * A link to the first page of resources. + * + * @return the first + */ + public PageLink getFirst() { + return first; + } + + /** + * Gets the limit. + * + * The maximum number of resources that can be returned by the request. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the next. + * + * A link to the next page of resources. This property is present for all pages + * except the last page. + * + * @return the next + */ + public PageLink getNext() { + return next; + } + + /** + * Gets the resourceBindings. + * + * A page of resource bindings for the endpoint gateway. + * + * @return the resourceBindings + */ + public List getResourceBindings() { + return resourceBindings; + } + + /** + * Gets the totalCount. + * + * The total number of resources across all pages. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingLifecycleReason.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingLifecycleReason.java new file mode 100644 index 0000000000..54779a39ea --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingLifecycleReason.java @@ -0,0 +1,86 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * EndpointGatewayResourceBindingLifecycleReason. + */ +public class EndpointGatewayResourceBindingLifecycleReason extends GenericModel { + + /** + * A reason code for this lifecycle state: + * - `internal_error`: internal error (contact IBM support) + * - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + * support) + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface Code { + /** internal_error. */ + String INTERNAL_ERROR = "internal_error"; + /** resource_suspended_by_provider. */ + String RESOURCE_SUSPENDED_BY_PROVIDER = "resource_suspended_by_provider"; + } + + protected String code; + protected String message; + @SerializedName("more_info") + protected String moreInfo; + + protected EndpointGatewayResourceBindingLifecycleReason() { } + + /** + * Gets the code. + * + * A reason code for this lifecycle state: + * - `internal_error`: internal error (contact IBM support) + * - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + * support) + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the code + */ + public String getCode() { + return code; + } + + /** + * Gets the message. + * + * An explanation of the reason for this lifecycle state. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Gets the moreInfo. + * + * A link to documentation about the reason for this lifecycle state. + * + * @return the moreInfo + */ + public String getMoreInfo() { + return moreInfo; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingPatch.java new file mode 100644 index 0000000000..f9a01d8caa --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingPatch.java @@ -0,0 +1,108 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.Map; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import com.ibm.cloud.sdk.core.util.GsonSingleton; + +/** + * EndpointGatewayResourceBindingPatch. + */ +public class EndpointGatewayResourceBindingPatch extends GenericModel { + + protected String name; + + /** + * Builder. + */ + public static class Builder { + private String name; + + /** + * Instantiates a new Builder from an existing EndpointGatewayResourceBindingPatch instance. + * + * @param endpointGatewayResourceBindingPatch the instance to initialize the Builder with + */ + private Builder(EndpointGatewayResourceBindingPatch endpointGatewayResourceBindingPatch) { + this.name = endpointGatewayResourceBindingPatch.name; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a EndpointGatewayResourceBindingPatch. + * + * @return the new EndpointGatewayResourceBindingPatch instance + */ + public EndpointGatewayResourceBindingPatch build() { + return new EndpointGatewayResourceBindingPatch(this); + } + + /** + * Set the name. + * + * @param name the name + * @return the EndpointGatewayResourceBindingPatch builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + } + + protected EndpointGatewayResourceBindingPatch() { } + + protected EndpointGatewayResourceBindingPatch(Builder builder) { + name = builder.name; + } + + /** + * New builder. + * + * @return a EndpointGatewayResourceBindingPatch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the name. + * + * The name for this resource binding. The name must not be used by another resource binding for the endpoint gateway. + * + * @return the name + */ + public String name() { + return name; + } + + /** + * Construct a JSON merge-patch from the EndpointGatewayResourceBindingPatch. + * + * Note that properties of the EndpointGatewayResourceBindingPatch with null values are not represented in the constructed + * JSON merge-patch object, but can be explicitly set afterward to signify a property delete. + * + * @return a JSON merge-patch for the EndpointGatewayResourceBindingPatch + */ + public Map asPatch() { + return GsonSingleton.getGson().fromJson(this.toString(), Map.class); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTarget.java similarity index 59% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTarget.java index 08c462671e..c90c1aff41 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTarget.java @@ -13,16 +13,27 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + /** - * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt. + * The target for this endpoint gateway resource binding. * * Classes which extend this class: - * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup - * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager + * - EndpointGatewayResourceBindingTargetCRN */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt extends InstanceGroupManagerActionPrototypeScheduledActionPrototype { +public class EndpointGatewayResourceBindingTarget extends GenericModel { + + protected String crn; + protected EndpointGatewayResourceBindingTarget() { } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() { } + /** + * Gets the crn. + * + * @return the crn + */ + public String getCrn() { + return crn; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetCRN.java new file mode 100644 index 0000000000..93d49b2b23 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetCRN.java @@ -0,0 +1,24 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The CRN for the resource targeted by this resource binding. + */ +public class EndpointGatewayResourceBindingTargetCRN extends EndpointGatewayResourceBindingTarget { + + + protected EndpointGatewayResourceBindingTargetCRN() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototype.java similarity index 58% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototype.java index 734944ab0f..264b973876 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototype.java @@ -13,16 +13,27 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + /** - * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec. + * The target to use for this resource binding. * * Classes which extend this class: - * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup - * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager + * - EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec extends InstanceGroupManagerActionPrototypeScheduledActionPrototype { +public class EndpointGatewayResourceBindingTargetPrototype extends GenericModel { + + protected String crn; + protected EndpointGatewayResourceBindingTargetPrototype() { } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() { } + /** + * Gets the crn. + * + * @return the crn + */ + public String crn() { + return crn; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.java new file mode 100644 index 0000000000..46f0663e81 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The resource to bind to the endpoint gateway. + */ +public class EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN extends EndpointGatewayResourceBindingTargetPrototype { + + + /** + * Builder. + */ + public static class Builder { + private String crn; + + /** + * Instantiates a new Builder from an existing EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN instance. + * + * @param endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrn the instance to initialize the Builder with + */ + public Builder(EndpointGatewayResourceBindingTargetPrototype endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrn) { + this.crn = endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrn.crn; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param crn the crn + */ + public Builder(String crn) { + this.crn = crn; + } + + /** + * Builds a EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN. + * + * @return the new EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN instance + */ + public EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN build() { + return new EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN(this); + } + + /** + * Set the crn. + * + * @param crn the crn + * @return the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN builder + */ + public Builder crn(String crn) { + this.crn = crn; + return this; + } + } + + protected EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN() { } + + protected EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.crn, + "crn cannot be null"); + crn = builder.crn; + } + + /** + * New builder. + * + * @return a EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingsPager.java new file mode 100644 index 0000000000..a60952fe41 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingsPager.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * EndpointGatewayResourceBindingsPager can be used to simplify the use of the "listEndpointGatewayResourceBindings" method. + */ +public class EndpointGatewayResourceBindingsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListEndpointGatewayResourceBindingsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected EndpointGatewayResourceBindingsPager() { } + + /** + * Constructs a new EndpointGatewayResourceBindingsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listEndpointGatewayResourceBindings" method + * @param options the ListEndpointGatewayResourceBindingsOptions instance to be used to invoke the "listEndpointGatewayResourceBindings" method + */ + public EndpointGatewayResourceBindingsPager(Vpc client, ListEndpointGatewayResourceBindingsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<EndpointGatewayResourceBinding> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListEndpointGatewayResourceBindingsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + EndpointGatewayResourceBindingCollection result = client.listEndpointGatewayResourceBindings(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getResourceBindings(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<EndpointGatewayResourceBinding> containing all results returned by the "listEndpointGatewayResourceBindings" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototype.java index 85174ce9eb..55eb03f9a0 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTargetPrototype.java @@ -19,16 +19,23 @@ /** * The target to use for this endpoint gateway. The target: * - Must not already be the target of another endpoint gateway in the VPC - * - Must not have a service endpoint that overlaps with any `service_endpoints` of another - * endpoint gateway in the VPC. + * - Must not have a service endpoint that overlaps with any `service_endpoints` of + * another endpoint gateway in the VPC. * - * If `allow_dns_resolution_binding` is `true`, then there must not be another endpoint gateway with - * `allow_dns_resolution_binding` set to `true` in the [DNS sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected - * topology that: + * If `dns_resolution_binding_mode` is set to `primary`, then there must not be another endpoint gateway in the [DNS + * sharing](/docs/vpc?topic=vpc-vpe-dns-sharing) connected topology that: * - Has the same `target` as this endpoint gateway * - Has `service_endpoints` that overlap with the `service_endpoints` for this endpoint * gateway. * + * If `dns_resolution_binding_mode` is set to `per_resource_binding`, then: + * - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + * gateway with the same `target` as this endpoint gateway. + * - The VPC in the topology with `dns.enable_hub` set to `true` must have an endpoint + * gateway with `dns_resolution_binding_mode` set to `primary`. + * - No other VPC in the topology can have an endpoint gateway with a resource binding + * using the same `service_endpoint` as a resource binding for this endpoint gateway. + * * Classes which extend this class: * - EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypePrivatePathServiceGatewayPrototype * - EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototype.java index e0e37d88be..df019bff10 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/FlowLogCollectorTargetPrototype.java @@ -22,8 +22,10 @@ * virtual network interfaces or instance network interfaces within the target that are themselves the target of a more * specific flow log collector. * - * The target must not be a virtual network interface that is attached to a bare metal server network attachment or to a - * file share mount target. + * For this request to succeed, the target must: + * - not be a virtual network interface that is attached to a bare metal server network + * attachment or to a file share mount target + * - not already be the target of another flow log collector. * * Classes which extend this class: * - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayResourceBindingOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayResourceBindingOptions.java new file mode 100644 index 0000000000..41fe0acc96 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayResourceBindingOptions.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getEndpointGatewayResourceBinding options. + */ +public class GetEndpointGatewayResourceBindingOptions extends GenericModel { + + protected String endpointGatewayId; + protected String id; + + /** + * Builder. + */ + public static class Builder { + private String endpointGatewayId; + private String id; + + /** + * Instantiates a new Builder from an existing GetEndpointGatewayResourceBindingOptions instance. + * + * @param getEndpointGatewayResourceBindingOptions the instance to initialize the Builder with + */ + private Builder(GetEndpointGatewayResourceBindingOptions getEndpointGatewayResourceBindingOptions) { + this.endpointGatewayId = getEndpointGatewayResourceBindingOptions.endpointGatewayId; + this.id = getEndpointGatewayResourceBindingOptions.id; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param endpointGatewayId the endpointGatewayId + * @param id the id + */ + public Builder(String endpointGatewayId, String id) { + this.endpointGatewayId = endpointGatewayId; + this.id = id; + } + + /** + * Builds a GetEndpointGatewayResourceBindingOptions. + * + * @return the new GetEndpointGatewayResourceBindingOptions instance + */ + public GetEndpointGatewayResourceBindingOptions build() { + return new GetEndpointGatewayResourceBindingOptions(this); + } + + /** + * Set the endpointGatewayId. + * + * @param endpointGatewayId the endpointGatewayId + * @return the GetEndpointGatewayResourceBindingOptions builder + */ + public Builder endpointGatewayId(String endpointGatewayId) { + this.endpointGatewayId = endpointGatewayId; + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the GetEndpointGatewayResourceBindingOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + } + + protected GetEndpointGatewayResourceBindingOptions() { } + + protected GetEndpointGatewayResourceBindingOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, + "endpointGatewayId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + endpointGatewayId = builder.endpointGatewayId; + id = builder.id; + } + + /** + * New builder. + * + * @return a GetEndpointGatewayResourceBindingOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the endpointGatewayId. + * + * The endpoint gateway identifier. + * + * @return the endpointGatewayId + */ + public String endpointGatewayId() { + return endpointGatewayId; + } + + /** + * Gets the id. + * + * The resource binding identifier. + * + * @return the id + */ + public String id() { + return id; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayServiceConnectionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayServiceConnectionOptions.java new file mode 100644 index 0000000000..afd079c7e0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayServiceConnectionOptions.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The getVpnGatewayServiceConnection options. + */ +public class GetVpnGatewayServiceConnectionOptions extends GenericModel { + + protected String vpnGatewayId; + protected String id; + + /** + * Builder. + */ + public static class Builder { + private String vpnGatewayId; + private String id; + + /** + * Instantiates a new Builder from an existing GetVpnGatewayServiceConnectionOptions instance. + * + * @param getVpnGatewayServiceConnectionOptions the instance to initialize the Builder with + */ + private Builder(GetVpnGatewayServiceConnectionOptions getVpnGatewayServiceConnectionOptions) { + this.vpnGatewayId = getVpnGatewayServiceConnectionOptions.vpnGatewayId; + this.id = getVpnGatewayServiceConnectionOptions.id; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param vpnGatewayId the vpnGatewayId + * @param id the id + */ + public Builder(String vpnGatewayId, String id) { + this.vpnGatewayId = vpnGatewayId; + this.id = id; + } + + /** + * Builds a GetVpnGatewayServiceConnectionOptions. + * + * @return the new GetVpnGatewayServiceConnectionOptions instance + */ + public GetVpnGatewayServiceConnectionOptions build() { + return new GetVpnGatewayServiceConnectionOptions(this); + } + + /** + * Set the vpnGatewayId. + * + * @param vpnGatewayId the vpnGatewayId + * @return the GetVpnGatewayServiceConnectionOptions builder + */ + public Builder vpnGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the GetVpnGatewayServiceConnectionOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + } + + protected GetVpnGatewayServiceConnectionOptions() { } + + protected GetVpnGatewayServiceConnectionOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, + "vpnGatewayId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + vpnGatewayId = builder.vpnGatewayId; + id = builder.id; + } + + /** + * New builder. + * + * @return a GetVpnGatewayServiceConnectionOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the vpnGatewayId. + * + * The VPN gateway identifier. + * + * @return the vpnGatewayId + */ + public String vpnGatewayId() { + return vpnGatewayId; + } + + /** + * Gets the id. + * + * The VPN gateway service connection identifier. + * + * @return the id + */ + public String id() { + return id; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Image.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Image.java index 7643a82832..93f20812f6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Image.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Image.java @@ -106,6 +106,8 @@ public interface Visibility { String X_PUBLIC = "public"; } + @SerializedName("allowed_use") + protected ImageAllowedUse allowedUse; @SerializedName("catalog_offering") protected ImageCatalogOffering catalogOffering; @SerializedName("created_at") @@ -142,6 +144,18 @@ public interface Visibility { protected Image() { } + /** + * Gets the allowedUse. + * + * The usage constraints to match against the requested instance or bare metal server + * properties to determine compatibility. + * + * @return the allowedUse + */ + public ImageAllowedUse getAllowedUse() { + return allowedUse; + } + /** * Gets the catalogOffering. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUse.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUse.java new file mode 100644 index 0000000000..84a20e50a2 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUse.java @@ -0,0 +1,79 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ImageAllowedUse. + */ +public class ImageAllowedUse extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + protected ImageAllowedUse() { } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * @return the apiVersion + */ + public String getApiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using this image. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `BareMetalServer` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String getBareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this image. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String getInstance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePatch.java new file mode 100644 index 0000000000..1c01776667 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePatch.java @@ -0,0 +1,164 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ImageAllowedUsePatch. + */ +public class ImageAllowedUsePatch extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + /** + * Builder. + */ + public static class Builder { + private String apiVersion; + private String bareMetalServer; + private String instance; + + /** + * Instantiates a new Builder from an existing ImageAllowedUsePatch instance. + * + * @param imageAllowedUsePatch the instance to initialize the Builder with + */ + private Builder(ImageAllowedUsePatch imageAllowedUsePatch) { + this.apiVersion = imageAllowedUsePatch.apiVersion; + this.bareMetalServer = imageAllowedUsePatch.bareMetalServer; + this.instance = imageAllowedUsePatch.instance; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ImageAllowedUsePatch. + * + * @return the new ImageAllowedUsePatch instance + */ + public ImageAllowedUsePatch build() { + return new ImageAllowedUsePatch(this); + } + + /** + * Set the apiVersion. + * + * @param apiVersion the apiVersion + * @return the ImageAllowedUsePatch builder + */ + public Builder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Set the bareMetalServer. + * + * @param bareMetalServer the bareMetalServer + * @return the ImageAllowedUsePatch builder + */ + public Builder bareMetalServer(String bareMetalServer) { + this.bareMetalServer = bareMetalServer; + return this; + } + + /** + * Set the instance. + * + * @param instance the instance + * @return the ImageAllowedUsePatch builder + */ + public Builder instance(String instance) { + this.instance = instance; + return this; + } + } + + protected ImageAllowedUsePatch() { } + + protected ImageAllowedUsePatch(Builder builder) { + apiVersion = builder.apiVersion; + bareMetalServer = builder.bareMetalServer; + instance = builder.instance; + } + + /** + * New builder. + * + * @return a ImageAllowedUsePatch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * If specified, the value must be between `2019-01-01` and today's date (in UTC). + * + * @return the apiVersion + */ + public String apiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using this image. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String bareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this image. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String instance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePrototype.java new file mode 100644 index 0000000000..b659c418c2 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePrototype.java @@ -0,0 +1,169 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ImageAllowedUsePrototype. + */ +public class ImageAllowedUsePrototype extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + /** + * Builder. + */ + public static class Builder { + private String apiVersion; + private String bareMetalServer; + private String instance; + + /** + * Instantiates a new Builder from an existing ImageAllowedUsePrototype instance. + * + * @param imageAllowedUsePrototype the instance to initialize the Builder with + */ + private Builder(ImageAllowedUsePrototype imageAllowedUsePrototype) { + this.apiVersion = imageAllowedUsePrototype.apiVersion; + this.bareMetalServer = imageAllowedUsePrototype.bareMetalServer; + this.instance = imageAllowedUsePrototype.instance; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a ImageAllowedUsePrototype. + * + * @return the new ImageAllowedUsePrototype instance + */ + public ImageAllowedUsePrototype build() { + return new ImageAllowedUsePrototype(this); + } + + /** + * Set the apiVersion. + * + * @param apiVersion the apiVersion + * @return the ImageAllowedUsePrototype builder + */ + public Builder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Set the bareMetalServer. + * + * @param bareMetalServer the bareMetalServer + * @return the ImageAllowedUsePrototype builder + */ + public Builder bareMetalServer(String bareMetalServer) { + this.bareMetalServer = bareMetalServer; + return this; + } + + /** + * Set the instance. + * + * @param instance the instance + * @return the ImageAllowedUsePrototype builder + */ + public Builder instance(String instance) { + this.instance = instance; + return this; + } + } + + protected ImageAllowedUsePrototype() { } + + protected ImageAllowedUsePrototype(Builder builder) { + apiVersion = builder.apiVersion; + bareMetalServer = builder.bareMetalServer; + instance = builder.instance; + } + + /** + * New builder. + * + * @return a ImageAllowedUsePrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * If specified, the value must be between `2019-01-01` and today's date (in UTC). If unspecified, the `version` query + * parameter value will be used. + * + * @return the apiVersion + */ + public String apiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using this image. + * + * If unspecified, the expression will be set to `true`. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String bareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this image. + * + * If unspecified, the expression will be set to `true`. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String instance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfileCollection.java new file mode 100644 index 0000000000..df374a3631 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfileCollection.java @@ -0,0 +1,92 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ImageBareMetalServerProfileCollection. + */ +public class ImageBareMetalServerProfileCollection extends GenericModel { + + @SerializedName("bare_metal_server_profiles") + protected List bareMetalServerProfiles; + protected PageLink first; + protected Long limit; + protected PageLink next; + @SerializedName("total_count") + protected Long totalCount; + + protected ImageBareMetalServerProfileCollection() { } + + /** + * Gets the bareMetalServerProfiles. + * + * A page of bare metal server profiles compatible with the image. + * + * @return the bareMetalServerProfiles + */ + public List getBareMetalServerProfiles() { + return bareMetalServerProfiles; + } + + /** + * Gets the first. + * + * A link to the first page of resources. + * + * @return the first + */ + public PageLink getFirst() { + return first; + } + + /** + * Gets the limit. + * + * The maximum number of resources that can be returned by the request. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the next. + * + * A link to the next page of resources. This property is present for all pages + * except the last page. + * + * @return the next + */ + public PageLink getNext() { + return next; + } + + /** + * Gets the totalCount. + * + * The total number of resources across all pages. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfilesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfilesPager.java new file mode 100644 index 0000000000..40dc107522 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfilesPager.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * ImageBareMetalServerProfilesPager can be used to simplify the use of the "listImageBareMetalServerProfiles" method. + */ +public class ImageBareMetalServerProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListImageBareMetalServerProfilesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected ImageBareMetalServerProfilesPager() { } + + /** + * Constructs a new ImageBareMetalServerProfilesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listImageBareMetalServerProfiles" method + * @param options the ListImageBareMetalServerProfilesOptions instance to be used to invoke the "listImageBareMetalServerProfiles" method + */ + public ImageBareMetalServerProfilesPager(Vpc client, ListImageBareMetalServerProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<BareMetalServerProfileReference> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListImageBareMetalServerProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ImageBareMetalServerProfileCollection result = client.listImageBareMetalServerProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getBareMetalServerProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<BareMetalServerProfileReference> containing all results returned by the "listImageBareMetalServerProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfileCollection.java new file mode 100644 index 0000000000..6feb8fa220 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfileCollection.java @@ -0,0 +1,92 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ImageInstanceProfileCollection. + */ +public class ImageInstanceProfileCollection extends GenericModel { + + protected PageLink first; + @SerializedName("instance_profiles") + protected List instanceProfiles; + protected Long limit; + protected PageLink next; + @SerializedName("total_count") + protected Long totalCount; + + protected ImageInstanceProfileCollection() { } + + /** + * Gets the first. + * + * A link to the first page of resources. + * + * @return the first + */ + public PageLink getFirst() { + return first; + } + + /** + * Gets the instanceProfiles. + * + * A page of instance profiles compatible with the image. + * + * @return the instanceProfiles + */ + public List getInstanceProfiles() { + return instanceProfiles; + } + + /** + * Gets the limit. + * + * The maximum number of resources that can be returned by the request. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the next. + * + * A link to the next page of resources. This property is present for all pages + * except the last page. + * + * @return the next + */ + public PageLink getNext() { + return next; + } + + /** + * Gets the totalCount. + * + * The total number of resources across all pages. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfilesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfilesPager.java new file mode 100644 index 0000000000..156fca2241 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfilesPager.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * ImageInstanceProfilesPager can be used to simplify the use of the "listImageInstanceProfiles" method. + */ +public class ImageInstanceProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListImageInstanceProfilesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected ImageInstanceProfilesPager() { } + + /** + * Constructs a new ImageInstanceProfilesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listImageInstanceProfiles" method + * @param options the ListImageInstanceProfilesOptions instance to be used to invoke the "listImageInstanceProfiles" method + */ + public ImageInstanceProfilesPager(Vpc client, ListImageInstanceProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<InstanceProfileReference> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListImageInstanceProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + ImageInstanceProfileCollection result = client.listImageInstanceProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getInstanceProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<InstanceProfileReference> containing all results returned by the "listImageInstanceProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java index af2246ffb2..262764cfea 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePatch.java @@ -25,6 +25,8 @@ */ public class ImagePatch extends GenericModel { + @SerializedName("allowed_use") + protected ImageAllowedUsePatch allowedUse; @SerializedName("deprecation_at") protected Date deprecationAt; protected String name; @@ -35,6 +37,7 @@ public class ImagePatch extends GenericModel { * Builder. */ public static class Builder { + private ImageAllowedUsePatch allowedUse; private Date deprecationAt; private String name; private Date obsolescenceAt; @@ -45,6 +48,7 @@ public static class Builder { * @param imagePatch the instance to initialize the Builder with */ private Builder(ImagePatch imagePatch) { + this.allowedUse = imagePatch.allowedUse; this.deprecationAt = imagePatch.deprecationAt; this.name = imagePatch.name; this.obsolescenceAt = imagePatch.obsolescenceAt; @@ -65,6 +69,17 @@ public ImagePatch build() { return new ImagePatch(this); } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the ImagePatch builder + */ + public Builder allowedUse(ImageAllowedUsePatch allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the deprecationAt. * @@ -102,6 +117,7 @@ public Builder obsolescenceAt(Date obsolescenceAt) { protected ImagePatch() { } protected ImagePatch(Builder builder) { + allowedUse = builder.allowedUse; deprecationAt = builder.deprecationAt; name = builder.name; obsolescenceAt = builder.obsolescenceAt; @@ -116,6 +132,18 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against the requested instance or bare metal server + * properties to determine compatibility. + * + * @return the allowedUse + */ + public ImageAllowedUsePatch allowedUse() { + return allowedUse; + } + /** * Gets the deprecationAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototype.java index c99822ed47..49c0c8280d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototype.java @@ -27,6 +27,8 @@ */ public class ImagePrototype extends GenericModel { + @SerializedName("allowed_use") + protected ImageAllowedUsePrototype allowedUse; @SerializedName("deprecation_at") protected Date deprecationAt; protected String name; @@ -46,6 +48,18 @@ public class ImagePrototype extends GenericModel { protected ImagePrototype() { } + /** + * Gets the allowedUse. + * + * The usage constraints to match against the requested instance or bare metal server + * properties to determine compatibility. + * + * @return the allowedUse + */ + public ImageAllowedUsePrototype allowedUse() { + return allowedUse; + } + /** * Gets the deprecationAt. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFile.java index 14f096510a..a350d5ac23 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFile.java @@ -25,6 +25,7 @@ public class ImagePrototypeImageByFile extends ImagePrototype { * Builder. */ public static class Builder { + private ImageAllowedUsePrototype allowedUse; private Date deprecationAt; private String name; private Date obsolescenceAt; @@ -40,6 +41,7 @@ public static class Builder { * @param imagePrototypeImageByFile the instance to initialize the Builder with */ public Builder(ImagePrototype imagePrototypeImageByFile) { + this.allowedUse = imagePrototypeImageByFile.allowedUse; this.deprecationAt = imagePrototypeImageByFile.deprecationAt; this.name = imagePrototypeImageByFile.name; this.obsolescenceAt = imagePrototypeImageByFile.obsolescenceAt; @@ -76,6 +78,17 @@ public ImagePrototypeImageByFile build() { return new ImagePrototypeImageByFile(this); } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the ImagePrototypeImageByFile builder + */ + public Builder allowedUse(ImageAllowedUsePrototype allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the deprecationAt. * @@ -172,6 +185,7 @@ protected ImagePrototypeImageByFile(Builder builder) { "file cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.operatingSystem, "operatingSystem cannot be null"); + allowedUse = builder.allowedUse; deprecationAt = builder.deprecationAt; name = builder.name; obsolescenceAt = builder.obsolescenceAt; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolume.java index ff0d44bc3c..8725e3300c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolume.java @@ -25,6 +25,7 @@ public class ImagePrototypeImageBySourceVolume extends ImagePrototype { * Builder. */ public static class Builder { + private ImageAllowedUsePrototype allowedUse; private Date deprecationAt; private String name; private Date obsolescenceAt; @@ -38,6 +39,7 @@ public static class Builder { * @param imagePrototypeImageBySourceVolume the instance to initialize the Builder with */ public Builder(ImagePrototype imagePrototypeImageBySourceVolume) { + this.allowedUse = imagePrototypeImageBySourceVolume.allowedUse; this.deprecationAt = imagePrototypeImageBySourceVolume.deprecationAt; this.name = imagePrototypeImageBySourceVolume.name; this.obsolescenceAt = imagePrototypeImageBySourceVolume.obsolescenceAt; @@ -70,6 +72,17 @@ public ImagePrototypeImageBySourceVolume build() { return new ImagePrototypeImageBySourceVolume(this); } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the ImagePrototypeImageBySourceVolume builder + */ + public Builder allowedUse(ImageAllowedUsePrototype allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the deprecationAt. * @@ -142,6 +155,7 @@ protected ImagePrototypeImageBySourceVolume() { } protected ImagePrototypeImageBySourceVolume(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceVolume, "sourceVolume cannot be null"); + allowedUse = builder.allowedUse; deprecationAt = builder.deprecationAt; name = builder.name; obsolescenceAt = builder.obsolescenceAt; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Instance.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Instance.java index d544fd5800..47e847ef5d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Instance.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Instance.java @@ -109,6 +109,16 @@ public interface Status { String STOPPING = "stopping"; } + /** + * The volume bandwidth QoS mode for this virtual server instance. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + @SerializedName("availability_policy") protected InstanceAvailabilityPolicy availabilityPolicy; protected Long bandwidth; @@ -138,6 +148,8 @@ public interface Status { protected String href; protected String id; protected ImageReference image; + @SerializedName("instance_group_membership") + protected InstanceGroupMembershipReferenceInstanceContext instanceGroupMembership; @SerializedName("lifecycle_reasons") protected List lifecycleReasons; @SerializedName("lifecycle_state") @@ -177,6 +189,8 @@ public interface Status { protected InstanceVCPU vcpu; @SerializedName("volume_attachments") protected List volumeAttachments; + @SerializedName("volume_bandwidth_qos_mode") + protected String volumeBandwidthQosMode; protected VPCReference vpc; protected ZoneReference zone; @@ -390,6 +404,17 @@ public ImageReference getImage() { return image; } + /** + * Gets the instanceGroupMembership. + * + * The instance group membership for this virtual server instance. + * + * @return the instanceGroupMembership + */ + public InstanceGroupMembershipReferenceInstanceContext getInstanceGroupMembership() { + return instanceGroupMembership; + } + /** * Gets the lifecycleReasons. * @@ -664,6 +689,17 @@ public List getVolumeAttachments() { return volumeAttachments; } + /** + * Gets the volumeBandwidthQosMode. + * + * The volume bandwidth QoS mode for this virtual server instance. + * + * @return the volumeBandwidthQosMode + */ + public String getVolumeBandwidthQosMode() { + return volumeBandwidthQosMode; + } + /** * Gets the vpc. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicy.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicy.java index 0322079041..92bbcfa016 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicy.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicy.java @@ -17,14 +17,16 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * InstanceAvailabilityPolicy. + * The availability policy for this virtual server instance. */ public class InstanceAvailabilityPolicy extends GenericModel { /** * The action to perform if the compute host experiences a failure: - * - `restart`: Automatically restart the virtual server instance after host failure - * - `stop`: Leave the virtual server instance stopped after host failure + * - `restart`: Restart the virtual server instance + * - `stop`: Leave the virtual server instance stopped + * + * See [handling host failures](https://cloud.ibm.com/docs/vpc?topic=vpc-host-failure-recovery-policies) for details. * * The enumerated values for this property may * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -45,8 +47,10 @@ protected InstanceAvailabilityPolicy() { } * Gets the hostFailure. * * The action to perform if the compute host experiences a failure: - * - `restart`: Automatically restart the virtual server instance after host failure - * - `stop`: Leave the virtual server instance stopped after host failure + * - `restart`: Restart the virtual server instance + * - `stop`: Leave the virtual server instance stopped + * + * See [handling host failures](https://cloud.ibm.com/docs/vpc?topic=vpc-host-failure-recovery-policies) for details. * * The enumerated values for this property may * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPatch.java index 0ce716d526..4f9987cef6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPatch.java @@ -22,9 +22,9 @@ public class InstanceAvailabilityPolicyPatch extends GenericModel { /** - * The action to perform if the compute host experiences a failure. - * - `restart`: Automatically restart the virtual server instance after host failure - * - `stop`: Leave the virtual server instance stopped after host failure. + * The action to perform if the compute host experiences a failure: + * - `restart`: Restart the virtual server instance + * - `stop`: Leave the virtual server instance stopped. */ public interface HostFailure { /** restart. */ @@ -96,9 +96,9 @@ public Builder newBuilder() { /** * Gets the hostFailure. * - * The action to perform if the compute host experiences a failure. - * - `restart`: Automatically restart the virtual server instance after host failure - * - `stop`: Leave the virtual server instance stopped after host failure. + * The action to perform if the compute host experiences a failure: + * - `restart`: Restart the virtual server instance + * - `stop`: Leave the virtual server instance stopped. * * @return the hostFailure */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPrototype.java index 8587a7e55a..e82e312961 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceAvailabilityPolicyPrototype.java @@ -17,14 +17,16 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * InstanceAvailabilityPolicyPrototype. + * The availability policy to use for this virtual server instance. */ public class InstanceAvailabilityPolicyPrototype extends GenericModel { /** - * The action to perform if the compute host experiences a failure. - * - `restart`: Automatically restart the virtual server instance after host failure - * - `stop`: Leave the virtual server instance stopped after host failure. + * The action to perform if the compute host experiences a failure: + * - `restart`: Restart the virtual server instance + * - `stop`: Leave the virtual server instance stopped + * + * See [handling host failures](https://cloud.ibm.com/docs/vpc?topic=vpc-host-failure-recovery-policies) for details. */ public interface HostFailure { /** restart. */ @@ -96,9 +98,11 @@ public Builder newBuilder() { /** * Gets the hostFailure. * - * The action to perform if the compute host experiences a failure. - * - `restart`: Automatically restart the virtual server instance after host failure - * - `stop`: Leave the virtual server instance stopped after host failure. + * The action to perform if the compute host experiences a failure: + * - `restart`: Restart the virtual server instance + * - `stop`: Leave the virtual server instance stopped + * + * See [handling host failures](https://cloud.ibm.com/docs/vpc?topic=vpc-host-failure-recovery-policies) for details. * * @return the hostFailure */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototype.java index 9d191aeda4..feb6bca11b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototype.java @@ -27,12 +27,12 @@ public class InstanceGroupManagerActionPrototype extends GenericModel { protected String name; - @SerializedName("run_at") - protected Date runAt; - protected InstanceGroupManagerScheduledActionGroupPrototype group; - protected InstanceGroupManagerScheduledActionManagerPrototype manager; @SerializedName("cron_spec") protected String cronSpec; + protected InstanceGroupManagerScheduledActionGroupPrototype group; + protected InstanceGroupManagerScheduledActionManagerPrototype manager; + @SerializedName("run_at") + protected Date runAt; protected InstanceGroupManagerActionPrototype() { } @@ -49,14 +49,15 @@ public String name() { } /** - * Gets the runAt. + * Gets the cronSpec. * - * The date and time the scheduled action will run. + * The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 + * min period. * - * @return the runAt + * @return the cronSpec */ - public Date runAt() { - return runAt; + public String cronSpec() { + return cronSpec; } /** @@ -78,15 +79,14 @@ public InstanceGroupManagerScheduledActionManagerPrototype manager() { } /** - * Gets the cronSpec. + * Gets the runAt. * - * The cron specification for a recurring scheduled action. Actions can be applied a maximum of one time within a 5 - * min period. + * The date and time the scheduled action will run. * - * @return the cronSpec + * @return the runAt */ - public String cronSpec() { - return cronSpec; + public Date runAt() { + return runAt; } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototype.java index 204cc6b2b9..65c7cdc756 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototype.java @@ -17,8 +17,10 @@ * InstanceGroupManagerActionPrototypeScheduledActionPrototype. * * Classes which extend this class: - * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt - * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec + * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup + * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager + * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup + * - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager */ public class InstanceGroupManagerActionPrototypeScheduledActionPrototype extends InstanceGroupManagerActionPrototype { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.java similarity index 73% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.java index 36cd502cee..f286ce7228 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.java @@ -14,9 +14,9 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup. + * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup extends InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec { +public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup extends InstanceGroupManagerActionPrototypeScheduledActionPrototype { /** @@ -28,14 +28,14 @@ public static class Builder { private InstanceGroupManagerScheduledActionGroupPrototype group; /** - * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup instance. + * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup instance. * - * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup the instance to initialize the Builder with + * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup the instance to initialize the Builder with */ - public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup) { - this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.name; - this.cronSpec = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.cronSpec; - this.group = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.group; + public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototype instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup) { + this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.name; + this.cronSpec = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.cronSpec; + this.group = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.group; } /** @@ -47,26 +47,28 @@ public Builder() { /** * Instantiates a new builder with required properties. * + * @param cronSpec the cronSpec * @param group the group */ - public Builder(InstanceGroupManagerScheduledActionGroupPrototype group) { + public Builder(String cronSpec, InstanceGroupManagerScheduledActionGroupPrototype group) { + this.cronSpec = cronSpec; this.group = group; } /** - * Builds a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup. + * Builds a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup. * - * @return the new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup instance + * @return the new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup instance */ - public InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup build() { - return new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(this); + public InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup build() { + return new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup(this); } /** * Set the name. * * @param name the name - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup builder + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup builder */ public Builder name(String name) { this.name = name; @@ -77,7 +79,7 @@ public Builder name(String name) { * Set the cronSpec. * * @param cronSpec the cronSpec - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup builder + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup builder */ public Builder cronSpec(String cronSpec) { this.cronSpec = cronSpec; @@ -88,7 +90,7 @@ public Builder cronSpec(String cronSpec) { * Set the group. * * @param group the group - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup builder + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup builder */ public Builder group(InstanceGroupManagerScheduledActionGroupPrototype group) { this.group = group; @@ -96,9 +98,11 @@ public Builder group(InstanceGroupManagerScheduledActionGroupPrototype group) { } } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup() { } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup() { } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup(Builder builder) { + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.cronSpec, + "cronSpec cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.group, "group cannot be null"); name = builder.name; @@ -109,7 +113,7 @@ protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecB /** * New builder. * - * @return a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup builder + * @return a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.java similarity index 72% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.java index 528a46b408..d3f21f963f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.java @@ -14,9 +14,9 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager. + * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager extends InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec { +public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager extends InstanceGroupManagerActionPrototypeScheduledActionPrototype { /** @@ -28,14 +28,14 @@ public static class Builder { private InstanceGroupManagerScheduledActionManagerPrototype manager; /** - * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager instance. + * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager instance. * - * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager the instance to initialize the Builder with + * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager the instance to initialize the Builder with */ - public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager) { - this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.name; - this.cronSpec = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.cronSpec; - this.manager = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.manager; + public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototype instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager) { + this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.name; + this.cronSpec = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.cronSpec; + this.manager = instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.manager; } /** @@ -47,26 +47,28 @@ public Builder() { /** * Instantiates a new builder with required properties. * + * @param cronSpec the cronSpec * @param manager the manager */ - public Builder(InstanceGroupManagerScheduledActionManagerPrototype manager) { + public Builder(String cronSpec, InstanceGroupManagerScheduledActionManagerPrototype manager) { + this.cronSpec = cronSpec; this.manager = manager; } /** - * Builds a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager. + * Builds a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager. * - * @return the new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager instance + * @return the new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager instance */ - public InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager build() { - return new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(this); + public InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager build() { + return new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager(this); } /** * Set the name. * * @param name the name - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager builder + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager builder */ public Builder name(String name) { this.name = name; @@ -77,7 +79,7 @@ public Builder name(String name) { * Set the cronSpec. * * @param cronSpec the cronSpec - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager builder + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager builder */ public Builder cronSpec(String cronSpec) { this.cronSpec = cronSpec; @@ -88,7 +90,7 @@ public Builder cronSpec(String cronSpec) { * Set the manager. * * @param manager the manager - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager builder + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager builder */ public Builder manager(InstanceGroupManagerScheduledActionManagerPrototype manager) { this.manager = manager; @@ -96,9 +98,11 @@ public Builder manager(InstanceGroupManagerScheduledActionManagerPrototype manag } } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager() { } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager() { } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager(Builder builder) { + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.cronSpec, + "cronSpec cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.manager, "manager cannot be null"); name = builder.name; @@ -109,7 +113,7 @@ protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecB /** * New builder. * - * @return a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager builder + * @return a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.java similarity index 75% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.java index 71f939cde3..ebbff5278e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.java @@ -16,9 +16,9 @@ import java.util.Date; /** - * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup. + * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup extends InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt { +public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup extends InstanceGroupManagerActionPrototypeScheduledActionPrototype { /** @@ -26,18 +26,18 @@ public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtB */ public static class Builder { private String name; - private Date runAt; private InstanceGroupManagerScheduledActionGroupPrototype group; + private Date runAt; /** - * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instance. + * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup instance. * - * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup the instance to initialize the Builder with + * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup the instance to initialize the Builder with */ - public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup) { - this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.name; - this.runAt = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.runAt; - this.group = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.group; + public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototype instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup) { + this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.name; + this.group = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.group; + this.runAt = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.runAt; } /** @@ -50,25 +50,27 @@ public Builder() { * Instantiates a new builder with required properties. * * @param group the group + * @param runAt the runAt */ - public Builder(InstanceGroupManagerScheduledActionGroupPrototype group) { + public Builder(InstanceGroupManagerScheduledActionGroupPrototype group, Date runAt) { this.group = group; + this.runAt = runAt; } /** - * Builds a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup. + * Builds a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup. * - * @return the new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instance + * @return the new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup instance */ - public InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup build() { - return new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(this); + public InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup build() { + return new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup(this); } /** * Set the name. * * @param name the name - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup builder + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup builder */ public Builder name(String name) { this.name = name; @@ -76,42 +78,44 @@ public Builder name(String name) { } /** - * Set the runAt. + * Set the group. * - * @param runAt the runAt - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup builder + * @param group the group + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup builder */ - public Builder runAt(Date runAt) { - this.runAt = runAt; + public Builder group(InstanceGroupManagerScheduledActionGroupPrototype group) { + this.group = group; return this; } /** - * Set the group. + * Set the runAt. * - * @param group the group - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup builder + * @param runAt the runAt + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup builder */ - public Builder group(InstanceGroupManagerScheduledActionGroupPrototype group) { - this.group = group; + public Builder runAt(Date runAt) { + this.runAt = runAt; return this; } } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup() { } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup() { } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(Builder builder) { + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.group, "group cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.runAt, + "runAt cannot be null"); name = builder.name; - runAt = builder.runAt; group = builder.group; + runAt = builder.runAt; } /** * New builder. * - * @return a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup builder + * @return a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.java similarity index 75% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.java index 9893c349ad..bc021f0ae6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.java @@ -16,9 +16,9 @@ import java.util.Date; /** - * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager. + * InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager extends InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt { +public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager extends InstanceGroupManagerActionPrototypeScheduledActionPrototype { /** @@ -26,18 +26,18 @@ public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtB */ public static class Builder { private String name; - private Date runAt; private InstanceGroupManagerScheduledActionManagerPrototype manager; + private Date runAt; /** - * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager instance. + * Instantiates a new Builder from an existing InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager instance. * - * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager the instance to initialize the Builder with + * @param instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager the instance to initialize the Builder with */ - public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager) { - this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.name; - this.runAt = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.runAt; - this.manager = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.manager; + public Builder(InstanceGroupManagerActionPrototypeScheduledActionPrototype instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager) { + this.name = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.name; + this.manager = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.manager; + this.runAt = instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.runAt; } /** @@ -50,25 +50,27 @@ public Builder() { * Instantiates a new builder with required properties. * * @param manager the manager + * @param runAt the runAt */ - public Builder(InstanceGroupManagerScheduledActionManagerPrototype manager) { + public Builder(InstanceGroupManagerScheduledActionManagerPrototype manager, Date runAt) { this.manager = manager; + this.runAt = runAt; } /** - * Builds a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager. + * Builds a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager. * - * @return the new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager instance + * @return the new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager instance */ - public InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager build() { - return new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(this); + public InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager build() { + return new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager(this); } /** * Set the name. * * @param name the name - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager builder + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager builder */ public Builder name(String name) { this.name = name; @@ -76,42 +78,44 @@ public Builder name(String name) { } /** - * Set the runAt. + * Set the manager. * - * @param runAt the runAt - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager builder + * @param manager the manager + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager builder */ - public Builder runAt(Date runAt) { - this.runAt = runAt; + public Builder manager(InstanceGroupManagerScheduledActionManagerPrototype manager) { + this.manager = manager; return this; } /** - * Set the manager. + * Set the runAt. * - * @param manager the manager - * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager builder + * @param runAt the runAt + * @return the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager builder */ - public Builder manager(InstanceGroupManagerScheduledActionManagerPrototype manager) { - this.manager = manager; + public Builder runAt(Date runAt) { + this.runAt = runAt; return this; } } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager() { } + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager() { } - protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager(Builder builder) { + protected InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.manager, "manager cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.runAt, + "runAt cannot be null"); name = builder.name; - runAt = builder.runAt; manager = builder.manager; + runAt = builder.runAt; } /** * New builder. * - * @return a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager builder + * @return a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipReferenceInstanceContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipReferenceInstanceContext.java new file mode 100644 index 0000000000..ffe5284e7a --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipReferenceInstanceContext.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * InstanceGroupMembershipReferenceInstanceContext. + */ +public class InstanceGroupMembershipReferenceInstanceContext extends GenericModel { + + protected Deleted deleted; + protected String href; + protected String id; + @SerializedName("instance_group") + protected InstanceGroupReference instanceGroup; + protected String name; + + protected InstanceGroupMembershipReferenceInstanceContext() { } + + /** + * Gets the deleted. + * + * If present, this property indicates the referenced resource has been deleted, and provides + * some supplementary information. + * + * @return the deleted + */ + public Deleted getDeleted() { + return deleted; + } + + /** + * Gets the href. + * + * The URL for this instance group membership. + * + * @return the href + */ + public String getHref() { + return href; + } + + /** + * Gets the id. + * + * The unique identifier for this instance group membership. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the instanceGroup. + * + * The instance group associated with this membership. + * + * @return the instanceGroup + */ + public InstanceGroupReference getInstanceGroup() { + return instanceGroup; + } + + /** + * Gets the name. + * + * The name for this instance group membership. The name is unique across all memberships for the instance group. + * + * @return the name + */ + public String getName() { + return name; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatch.java index 1745507dab..84c2876c67 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatch.java @@ -39,6 +39,20 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * For this property to be changed, the virtual server instance `status` must be + * `stopping` or `stopped`. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + @SerializedName("availability_policy") protected InstanceAvailabilityPolicyPatch availabilityPolicy; @SerializedName("confidential_compute_mode") @@ -55,6 +69,9 @@ public interface ConfidentialComputeMode { protected InstanceReservationAffinityPatch reservationAffinity; @SerializedName("total_volume_bandwidth") protected Long totalVolumeBandwidth; + protected InstanceVCPUPatch vcpu; + @SerializedName("volume_bandwidth_qos_mode") + protected String volumeBandwidthQosMode; /** * Builder. @@ -69,6 +86,8 @@ public static class Builder { private InstancePatchProfile profile; private InstanceReservationAffinityPatch reservationAffinity; private Long totalVolumeBandwidth; + private InstanceVCPUPatch vcpu; + private String volumeBandwidthQosMode; /** * Instantiates a new Builder from an existing InstancePatch instance. @@ -85,6 +104,8 @@ private Builder(InstancePatch instancePatch) { this.profile = instancePatch.profile; this.reservationAffinity = instancePatch.reservationAffinity; this.totalVolumeBandwidth = instancePatch.totalVolumeBandwidth; + this.vcpu = instancePatch.vcpu; + this.volumeBandwidthQosMode = instancePatch.volumeBandwidthQosMode; } /** @@ -200,6 +221,28 @@ public Builder totalVolumeBandwidth(long totalVolumeBandwidth) { this.totalVolumeBandwidth = totalVolumeBandwidth; return this; } + + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePatch builder + */ + public Builder vcpu(InstanceVCPUPatch vcpu) { + this.vcpu = vcpu; + return this; + } + + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePatch builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } } protected InstancePatch() { } @@ -214,6 +257,8 @@ protected InstancePatch(Builder builder) { profile = builder.profile; reservationAffinity = builder.reservationAffinity; totalVolumeBandwidth = builder.totalVolumeBandwidth; + vcpu = builder.vcpu; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; } /** @@ -228,8 +273,6 @@ public Builder newBuilder() { /** * Gets the availabilityPolicy. * - * The availability policy for this virtual server instance. - * * @return the availabilityPolicy */ public InstanceAvailabilityPolicyPatch availabilityPolicy() { @@ -290,11 +333,11 @@ public String name() { /** * Gets the placementTarget. * - * The placement restrictions to use for the virtual server instance. For the - * placement restrictions to be changed, the instance `status` must be `stopping` or - * `stopped`. + * The placement restrictions to use for the virtual server instance. * - * If set, `reservation_affinity.policy` must be `disabled`. + * If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated + * host or dedicated host group, the `vcpu.percentage` must be `100` and the instance must + * have two or more vCPUs. * * @return the placementTarget */ @@ -317,6 +360,7 @@ public InstancePlacementTargetPatch placementTarget() { * - Have the same `vcpu.architecture`. * - Support the number of network attachments or network interfaces the instance * currently has. + * - Have the `volume_bandwidth_qos_mode` listed in its `volume_bandwidth_qos_modes`. * * @return the profile */ @@ -346,6 +390,30 @@ public Long totalVolumeBandwidth() { return totalVolumeBandwidth; } + /** + * Gets the vcpu. + * + * @return the vcpu + */ + public InstanceVCPUPatch vcpu() { + return vcpu; + } + + /** + * Gets the volumeBandwidthQosMode. + * + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * For this property to be changed, the virtual server instance `status` must be + * `stopping` or `stopped`. + * + * @return the volumeBandwidthQosMode + */ + public String volumeBandwidthQosMode() { + return volumeBandwidthQosMode; + } + /** * Construct a JSON merge-patch from the InstancePatch. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfile.java index 81c4f3364c..0f5f6d1b77 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchProfile.java @@ -27,6 +27,7 @@ * - Have the same `vcpu.architecture`. * - Support the number of network attachments or network interfaces the instance * currently has. + * - Have the `volume_bandwidth_qos_mode` listed in its `volume_bandwidth_qos_modes`. * * Classes which extend this class: * - InstancePatchProfileInstanceProfileIdentityByName diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatch.java index 0064b635eb..90d29a5309 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPatch.java @@ -16,11 +16,10 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The placement restrictions to use for the virtual server instance. For the placement restrictions to be changed, the - * instance `status` must be `stopping` or - * `stopped`. + * The placement restrictions to use for the virtual server instance. * - * If set, `reservation_affinity.policy` must be `disabled`. + * If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated host or dedicated host + * group, the `vcpu.percentage` must be `100` and the instance must have two or more vCPUs. * * Classes which extend this class: * - InstancePlacementTargetPatchDedicatedHostIdentity diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototype.java index 129e82affc..91c88ff0ad 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePlacementTargetPrototype.java @@ -18,7 +18,8 @@ /** * The placement restrictions to use for the virtual server instance. * - * If specified, `reservation_affinity.policy` must be `disabled`. + * If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated host or dedicated host + * group, the `vcpu.percentage` must be `100` and the instance must have two or more vCPUs. * * Classes which extend this class: * - InstancePlacementTargetPrototypeDedicatedHostIdentity diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfile.java index ad270ca3da..9159c1270e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfile.java @@ -92,10 +92,16 @@ public interface Status { protected InstanceProfileVolumeBandwidth totalVolumeBandwidth; @SerializedName("vcpu_architecture") protected InstanceProfileVCPUArchitecture vcpuArchitecture; + @SerializedName("vcpu_burst_limit") + protected InstanceProfileVCPUBurstLimit vcpuBurstLimit; @SerializedName("vcpu_count") protected InstanceProfileVCPU vcpuCount; @SerializedName("vcpu_manufacturer") protected InstanceProfileVCPUManufacturer vcpuManufacturer; + @SerializedName("vcpu_percentage") + protected InstanceProfileVCPUPercentage vcpuPercentage; + @SerializedName("volume_bandwidth_qos_modes") + protected InstanceProfileVolumeBandwidthQoSModes volumeBandwidthQosModes; protected InstanceProfile() { } @@ -339,6 +345,15 @@ public InstanceProfileVCPUArchitecture getVcpuArchitecture() { return vcpuArchitecture; } + /** + * Gets the vcpuBurstLimit. + * + * @return the vcpuBurstLimit + */ + public InstanceProfileVCPUBurstLimit getVcpuBurstLimit() { + return vcpuBurstLimit; + } + /** * Gets the vcpuCount. * @@ -356,5 +371,25 @@ public InstanceProfileVCPU getVcpuCount() { public InstanceProfileVCPUManufacturer getVcpuManufacturer() { return vcpuManufacturer; } + + /** + * Gets the vcpuPercentage. + * + * The permitted values for VCPU percentage for an instance with this profile. + * + * @return the vcpuPercentage + */ + public InstanceProfileVCPUPercentage getVcpuPercentage() { + return vcpuPercentage; + } + + /** + * Gets the volumeBandwidthQosModes. + * + * @return the volumeBandwidthQosModes + */ + public InstanceProfileVolumeBandwidthQoSModes getVolumeBandwidthQosModes() { + return volumeBandwidthQosModes; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollection.java index 0e0f189b92..7815b8dd41 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollection.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollection.java @@ -29,7 +29,7 @@ protected InstanceProfileCollection() { } /** * Gets the profiles. * - * A page of virtual server instance profiles. + * The virtual server instance profiles. * * @return the profiles */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimit.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimit.java new file mode 100644 index 0000000000..e86b37e0c7 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimit.java @@ -0,0 +1,61 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * InstanceProfileVCPUBurstLimit. + * + * Classes which extend this class: + * - InstanceProfileVCPUBurstLimitFixed + */ +public class InstanceProfileVCPUBurstLimit extends GenericModel { + + /** + * The type for this profile field. + */ + public interface Type { + /** fixed. */ + String FIXED = "fixed"; + } + + protected String type; + protected Long value; + + protected InstanceProfileVCPUBurstLimit() { } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the value. + * + * The value for this profile field. + * + * @return the value + */ + public Long getValue() { + return value; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitFixed.java new file mode 100644 index 0000000000..f844268504 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitFixed.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The permitted value for VCPU burst limit percentage for an instance with this profile. + */ +public class InstanceProfileVCPUBurstLimitFixed extends InstanceProfileVCPUBurstLimit { + + /** + * The type for this profile field. + */ + public interface Type { + /** fixed. */ + String FIXED = "fixed"; + } + + + protected InstanceProfileVCPUBurstLimitFixed() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUPercentage.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUPercentage.java new file mode 100644 index 0000000000..2ad27fd19d --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUPercentage.java @@ -0,0 +1,74 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The permitted values for VCPU percentage for an instance with this profile. + */ +public class InstanceProfileVCPUPercentage extends GenericModel { + + /** + * The type for this profile field. + */ + public interface Type { + /** enum. */ + String X_ENUM = "enum"; + } + + @SerializedName("default") + protected Long xDefault; + protected String type; + protected List values; + + protected InstanceProfileVCPUPercentage() { } + + /** + * Gets the xDefault. + * + * The default value for this profile field. + * + * @return the xDefault + */ + public Long getXDefault() { + return xDefault; + } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the values. + * + * The permitted values for this profile field. + * + * @return the values + */ + public List getValues() { + return values; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModes.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModes.java new file mode 100644 index 0000000000..5cef25c340 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModes.java @@ -0,0 +1,103 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * InstanceProfileVolumeBandwidthQoSModes. + * + * Classes which extend this class: + * - InstanceProfileVolumeBandwidthQoSModesEnum + * - InstanceProfileVolumeBandwidthQoSModesDependent + */ +public class InstanceProfileVolumeBandwidthQoSModes extends GenericModel { + + /** + * The default volume bandwidth QoS mode for this profile. + */ + public interface XDefault { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + + /** + * The type for this profile field. + */ + public interface Type { + /** enum. */ + String X_ENUM = "enum"; + } + + /** + * A volume bandwidth QoS mode: + * - `pooled`: All volumes attached to an instance will pool and share bandwidth. + * - `weighted`: Each volume attached to an instance will have its own bandwidth, weighted according to its IOPS. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface Values { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + + @SerializedName("default") + protected String xDefault; + protected String type; + protected List values; + + protected InstanceProfileVolumeBandwidthQoSModes() { } + + /** + * Gets the xDefault. + * + * The default volume bandwidth QoS mode for this profile. + * + * @return the xDefault + */ + public String getXDefault() { + return xDefault; + } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the values. + * + * The permitted volume bandwidth QoS modes for an instance using this profile. + * + * @return the values + */ + public List getValues() { + return values; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesDependent.java new file mode 100644 index 0000000000..326ace723e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesDependent.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The volume bandwidth QoS modes for an instance with this profile depends on its configuration. + */ +public class InstanceProfileVolumeBandwidthQoSModesDependent extends InstanceProfileVolumeBandwidthQoSModes { + + /** + * The type for this profile field. + */ + public interface Type { + /** dependent. */ + String DEPENDENT = "dependent"; + } + + + protected InstanceProfileVolumeBandwidthQoSModesDependent() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesEnum.java new file mode 100644 index 0000000000..028ac831e0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesEnum.java @@ -0,0 +1,57 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * InstanceProfileVolumeBandwidthQoSModesEnum. + */ +public class InstanceProfileVolumeBandwidthQoSModesEnum extends InstanceProfileVolumeBandwidthQoSModes { + + /** + * The default volume bandwidth QoS mode for this profile. + */ + public interface XDefault { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + + /** + * The type for this profile field. + */ + public interface Type { + /** enum. */ + String X_ENUM = "enum"; + } + + /** + * A volume bandwidth QoS mode: + * - `pooled`: All volumes attached to an instance will pool and share bandwidth. + * - `weighted`: Each volume attached to an instance will have its own bandwidth, weighted according to its IOPS. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface Values { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + + + protected InstanceProfileVolumeBandwidthQoSModesEnum() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototype.java index 33b6adb84c..ccf3010df7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototype.java @@ -44,6 +44,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + @SerializedName("availability_policy") protected InstanceAvailabilityPolicyPrototype availabilityPolicy; @SerializedName("cluster_network_attachments") @@ -69,8 +82,11 @@ public interface ConfidentialComputeMode { protected Long totalVolumeBandwidth; @SerializedName("user_data") protected String userData; + protected InstanceVCPUPrototype vcpu; @SerializedName("volume_attachments") protected List volumeAttachments; + @SerializedName("volume_bandwidth_qos_mode") + protected String volumeBandwidthQosMode; protected VPCIdentity vpc; @SerializedName("boot_volume_attachment") protected VolumeAttachmentPrototypeInstance bootVolumeAttachment; @@ -209,7 +225,9 @@ public String name() { * * The placement restrictions to use for the virtual server instance. * - * If specified, `reservation_affinity.policy` must be `disabled`. + * If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated + * host or dedicated host group, the `vcpu.percentage` must be `100` and the instance must + * have two or more vCPUs. * * @return the placementTarget */ @@ -223,8 +241,8 @@ public InstancePlacementTargetPrototype placementTarget() { * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this * virtual server instance. * - * If unspecified, `bx2-2x8` will be used, but this default value is expected to change - * in the future. + * If unspecified, `bxf-2x8` will be used, but this default value may change + * in the future without changing the API version. * * @return the profile */ @@ -236,7 +254,7 @@ public InstanceProfileIdentity profile() { * Gets the reservationAffinity. * * The reservation affinity settings for this virtual server instance. If specified, - * `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + * the instance must have two or more vCPUs, and `vcpu.percentage` must be `100`. * * @return the reservationAffinity */ @@ -281,6 +299,15 @@ public String userData() { return userData; } + /** + * Gets the vcpu. + * + * @return the vcpu + */ + public InstanceVCPUPrototype vcpu() { + return vcpu; + } + /** * Gets the volumeAttachments. * @@ -292,6 +319,20 @@ public List volumeAttachments() { return volumeAttachments; } + /** + * Gets the volumeBandwidthQosMode. + * + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + * + * @return the volumeBandwidthQosMode + */ + public String volumeBandwidthQosMode() { + return volumeBandwidthQosMode; + } + /** * Gets the vpc. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOffering.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOffering.java index e55391bf46..a7d46b5e69 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOffering.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOffering.java @@ -36,6 +36,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstancePrototypeInstanceByCatalogOffering() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.java index 2fb65c34f4..d756ce6a42 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private InstanceCatalogOfferingPrototype catalogOffering; @@ -82,7 +97,9 @@ public Builder(InstancePrototypeInstanceByCatalogOffering instancePrototypeInsta this.resourceGroup = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.totalVolumeBandwidth; this.userData = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.userData; + this.vcpu = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.vcpu; this.volumeAttachments = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.bootVolumeAttachment; this.catalogOffering = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment.catalogOffering; @@ -339,6 +356,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -351,6 +379,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -442,7 +481,9 @@ protected InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingIns resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; catalogOffering = builder.catalogOffering; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.java index 468e4fac4d..853709b506 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private InstanceCatalogOfferingPrototype catalogOffering; @@ -82,7 +97,9 @@ public Builder(InstancePrototypeInstanceByCatalogOffering instancePrototypeInsta this.resourceGroup = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.totalVolumeBandwidth; this.userData = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.userData; + this.vcpu = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.vcpu; this.volumeAttachments = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.bootVolumeAttachment; this.catalogOffering = instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface.catalogOffering; @@ -339,6 +356,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -351,6 +379,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -442,7 +481,9 @@ protected InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingIns resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; catalogOffering = builder.catalogOffering; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImage.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImage.java index 08a0deaa6d..ea898ce802 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImage.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImage.java @@ -38,6 +38,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstancePrototypeInstanceByImage() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.java index 7f8d3ea032..e21d0aa289 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private ImageIdentity image; @@ -82,7 +97,9 @@ public Builder(InstancePrototypeInstanceByImage instancePrototypeInstanceByImage this.resourceGroup = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.totalVolumeBandwidth; this.userData = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.userData; + this.vcpu = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.vcpu; this.volumeAttachments = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.bootVolumeAttachment; this.image = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment.image; @@ -339,6 +356,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -351,6 +379,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -442,7 +481,9 @@ protected InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttach resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; image = builder.image; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.java index e9e0dc210e..1dd1341d9f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private ImageIdentity image; @@ -82,7 +97,9 @@ public Builder(InstancePrototypeInstanceByImage instancePrototypeInstanceByImage this.resourceGroup = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.totalVolumeBandwidth; this.userData = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.userData; + this.vcpu = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.vcpu; this.volumeAttachments = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.bootVolumeAttachment; this.image = instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.image; @@ -339,6 +356,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -351,6 +379,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -442,7 +481,9 @@ protected InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterf resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; image = builder.image; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshot.java index 546cdea9da..ab3dbf8776 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshot.java @@ -36,6 +36,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstancePrototypeInstanceBySourceSnapshot() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.java index cf612f6291..dd579bbeeb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment; private ZoneIdentity zone; @@ -81,7 +96,9 @@ public Builder(InstancePrototypeInstanceBySourceSnapshot instancePrototypeInstan this.resourceGroup = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.totalVolumeBandwidth; this.userData = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.userData; + this.vcpu = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.vcpu; this.volumeAttachments = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.bootVolumeAttachment; this.zone = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment.zone; @@ -337,6 +354,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -349,6 +377,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -429,7 +468,9 @@ protected InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInsta resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; zone = builder.zone; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.java index d357da23d5..2dbf121862 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment; private ZoneIdentity zone; @@ -81,7 +96,9 @@ public Builder(InstancePrototypeInstanceBySourceSnapshot instancePrototypeInstan this.resourceGroup = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.totalVolumeBandwidth; this.userData = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.userData; + this.vcpu = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.vcpu; this.volumeAttachments = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.bootVolumeAttachment; this.zone = instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface.zone; @@ -337,6 +354,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -349,6 +377,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -429,7 +468,9 @@ protected InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInsta resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; zone = builder.zone; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplate.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplate.java index 0a16607a2a..e786b4a100 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplate.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplate.java @@ -41,6 +41,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -60,7 +73,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private InstanceCatalogOfferingPrototype catalogOffering; @@ -92,7 +107,9 @@ public Builder(InstancePrototype instancePrototypeInstanceBySourceTemplate) { this.resourceGroup = instancePrototypeInstanceBySourceTemplate.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceBySourceTemplate.totalVolumeBandwidth; this.userData = instancePrototypeInstanceBySourceTemplate.userData; + this.vcpu = instancePrototypeInstanceBySourceTemplate.vcpu; this.volumeAttachments = instancePrototypeInstanceBySourceTemplate.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceBySourceTemplate.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceBySourceTemplate.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instancePrototypeInstanceBySourceTemplate.bootVolumeAttachment; this.catalogOffering = instancePrototypeInstanceBySourceTemplate.catalogOffering; @@ -365,6 +382,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceBySourceTemplate builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -377,6 +405,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceBySourceTemplate builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -509,7 +548,9 @@ protected InstancePrototypeInstanceBySourceTemplate(Builder builder) { resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; catalogOffering = builder.catalogOffering; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolume.java index 296050170b..1ea3d1e07a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolume.java @@ -36,6 +36,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstancePrototypeInstanceByVolume() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.java index 0d7d4299a9..64d88b3ffe 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByVolumeContext bootVolumeAttachment; private ZoneIdentity zone; @@ -81,7 +96,9 @@ public Builder(InstancePrototypeInstanceByVolume instancePrototypeInstanceByVolu this.resourceGroup = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.totalVolumeBandwidth; this.userData = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.userData; + this.vcpu = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.vcpu; this.volumeAttachments = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByVolumeContext) instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.bootVolumeAttachment; this.zone = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment.zone; @@ -337,6 +354,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -349,6 +377,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -429,7 +468,9 @@ protected InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAtta resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; zone = builder.zone; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.java index 20ed840624..362ed2bfe3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByVolumeContext bootVolumeAttachment; private ZoneIdentity zone; @@ -81,7 +96,9 @@ public Builder(InstancePrototypeInstanceByVolume instancePrototypeInstanceByVolu this.resourceGroup = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.resourceGroup; this.totalVolumeBandwidth = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.totalVolumeBandwidth; this.userData = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.userData; + this.vcpu = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.vcpu; this.volumeAttachments = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.volumeAttachments; + this.volumeBandwidthQosMode = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.volumeBandwidthQosMode; this.vpc = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByVolumeContext) instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.bootVolumeAttachment; this.zone = instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface.zone; @@ -337,6 +354,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -349,6 +377,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -429,7 +468,9 @@ protected InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInte resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; zone = builder.zone; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReservationAffinityPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReservationAffinityPrototype.java index 0bfed71b24..f84eaa8599 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReservationAffinityPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceReservationAffinityPrototype.java @@ -19,8 +19,8 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; /** - * The reservation affinity settings for this virtual server instance. If specified, - * `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + * The reservation affinity settings for this virtual server instance. If specified, the instance must have two or more + * vCPUs, and `vcpu.percentage` must be `100`. */ public class InstanceReservationAffinityPrototype extends GenericModel { @@ -32,7 +32,8 @@ public class InstanceReservationAffinityPrototype extends GenericModel { * `profile` and `zone` as this virtual server instance will be available for use. * * The policy will default to `manual` if `pool` is not empty. The policy will default to - * `disabled` if a `placement_target` is set. The policy will default to `automatic` in all other cases. + * `disabled` if a `placement_target` is set. The policy will default to `disabled` if the provided instance + * configuration is restricted from enabling reservations. The policy will default to `automatic` in all other cases. * * The policy must be `disabled` if `placement_target` is specified. */ @@ -146,7 +147,8 @@ public Builder newBuilder() { * `profile` and `zone` as this virtual server instance will be available for use. * * The policy will default to `manual` if `pool` is not empty. The policy will default to - * `disabled` if a `placement_target` is set. The policy will default to `automatic` in all other cases. + * `disabled` if a `placement_target` is set. The policy will default to `disabled` if the provided instance + * configuration is restricted from enabling reservations. The policy will default to `automatic` in all other cases. * * The policy must be `disabled` if `placement_target` is specified. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplate.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplate.java index 7e751ca26b..3afede1fc8 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplate.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplate.java @@ -43,6 +43,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + @SerializedName("availability_policy") protected InstanceAvailabilityPolicyPrototype availabilityPolicy; @SerializedName("cluster_network_attachments") @@ -73,8 +86,11 @@ public interface ConfidentialComputeMode { protected Long totalVolumeBandwidth; @SerializedName("user_data") protected String userData; + protected InstanceVCPUPrototype vcpu; @SerializedName("volume_attachments") protected List volumeAttachments; + @SerializedName("volume_bandwidth_qos_mode") + protected String volumeBandwidthQosMode; protected VPCIdentity vpc; @SerializedName("boot_volume_attachment") protected VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; @@ -252,7 +268,9 @@ public String getName() { * * The placement restrictions to use for the virtual server instance. * - * If specified, `reservation_affinity.policy` must be `disabled`. + * If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated + * host or dedicated host group, the `vcpu.percentage` must be `100` and the instance must + * have two or more vCPUs. * * @return the placementTarget */ @@ -266,8 +284,8 @@ public InstancePlacementTargetPrototype getPlacementTarget() { * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this * virtual server instance. * - * If unspecified, `bx2-2x8` will be used, but this default value is expected to change - * in the future. + * If unspecified, `bxf-2x8` will be used, but this default value may change + * in the future without changing the API version. * * @return the profile */ @@ -279,7 +297,7 @@ public InstanceProfileIdentity getProfile() { * Gets the reservationAffinity. * * The reservation affinity settings for this virtual server instance. If specified, - * `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + * the instance must have two or more vCPUs, and `vcpu.percentage` must be `100`. * * @return the reservationAffinity */ @@ -323,6 +341,15 @@ public String getUserData() { return userData; } + /** + * Gets the vcpu. + * + * @return the vcpu + */ + public InstanceVCPUPrototype getVcpu() { + return vcpu; + } + /** * Gets the volumeAttachments. * @@ -334,6 +361,20 @@ public List getVolumeAttachments() { return volumeAttachments; } + /** + * Gets the volumeBandwidthQosMode. + * + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + * + * @return the volumeBandwidthQosMode + */ + public String getVolumeBandwidthQosMode() { + return volumeBandwidthQosMode; + } + /** * Gets the vpc. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.java index fc58aa3bcc..b39bdc02e4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext.java @@ -36,6 +36,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.java index f907dcd47b..5caf7a25e4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment.java @@ -32,6 +32,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.java index 3e26d73f08..e570a33c79 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface.java @@ -32,6 +32,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContext.java index 25e6372403..bea9c3ad3f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContext.java @@ -36,6 +36,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceByImageInstanceTemplateContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.java index 8690b9c0f9..f7acc0d5a4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment.java @@ -32,6 +32,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.java index 4fdf926560..39fbf6dd9f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface.java @@ -32,6 +32,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.java index 52d98791cd..1c818f4719 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext.java @@ -36,6 +36,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.java index 299984ae83..2504dd6f98 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment.java @@ -32,6 +32,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.java index 578e21929f..496e465df9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface.java @@ -32,6 +32,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototype.java index 0829e141f2..b553b9a355 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototype.java @@ -43,6 +43,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + @SerializedName("availability_policy") protected InstanceAvailabilityPolicyPrototype availabilityPolicy; @SerializedName("cluster_network_attachments") @@ -68,8 +81,11 @@ public interface ConfidentialComputeMode { protected Long totalVolumeBandwidth; @SerializedName("user_data") protected String userData; + protected InstanceVCPUPrototype vcpu; @SerializedName("volume_attachments") protected List volumeAttachments; + @SerializedName("volume_bandwidth_qos_mode") + protected String volumeBandwidthQosMode; protected VPCIdentity vpc; @SerializedName("boot_volume_attachment") protected VolumeAttachmentPrototypeInstance bootVolumeAttachment; @@ -206,7 +222,9 @@ public String name() { * * The placement restrictions to use for the virtual server instance. * - * If specified, `reservation_affinity.policy` must be `disabled`. + * If specified, `reservation_affinity.policy` must be `disabled`. If specifying a dedicated + * host or dedicated host group, the `vcpu.percentage` must be `100` and the instance must + * have two or more vCPUs. * * @return the placementTarget */ @@ -220,8 +238,8 @@ public InstancePlacementTargetPrototype placementTarget() { * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-profiles) to use for this * virtual server instance. * - * If unspecified, `bx2-2x8` will be used, but this default value is expected to change - * in the future. + * If unspecified, `bxf-2x8` will be used, but this default value may change + * in the future without changing the API version. * * @return the profile */ @@ -233,7 +251,7 @@ public InstanceProfileIdentity profile() { * Gets the reservationAffinity. * * The reservation affinity settings for this virtual server instance. If specified, - * `vcpu.tenancy` must be `dedicated`, and `vcpu.percentage` must be `100`. + * the instance must have two or more vCPUs, and `vcpu.percentage` must be `100`. * * @return the reservationAffinity */ @@ -278,6 +296,15 @@ public String userData() { return userData; } + /** + * Gets the vcpu. + * + * @return the vcpu + */ + public InstanceVCPUPrototype vcpu() { + return vcpu; + } + /** * Gets the volumeAttachments. * @@ -289,6 +316,20 @@ public List volumeAttachments() { return volumeAttachments; } + /** + * Gets the volumeBandwidthQosMode. + * + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + * + * @return the volumeBandwidthQosMode + */ + public String volumeBandwidthQosMode() { + return volumeBandwidthQosMode; + } + /** * Gets the vpc. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.java index 19f036100d..527f461862 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOffering.java @@ -36,6 +36,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplatePrototypeInstanceTemplateByCatalogOffering() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.java index 281d5a1f7f..1ce5d22ea4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private InstanceCatalogOfferingPrototype catalogOffering; @@ -82,7 +97,9 @@ public Builder(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering instan this.resourceGroup = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.resourceGroup; this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.totalVolumeBandwidth; this.userData = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.userData; + this.vcpu = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.vcpu; this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.volumeAttachments; + this.volumeBandwidthQosMode = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.volumeBandwidthQosMode; this.vpc = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.bootVolumeAttachment; this.catalogOffering = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment.catalogOffering; @@ -339,6 +356,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -351,6 +379,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -442,7 +481,9 @@ protected InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemp resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; catalogOffering = builder.catalogOffering; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.java index 6d52189a19..421902d617 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private InstanceCatalogOfferingPrototype catalogOffering; @@ -82,7 +97,9 @@ public Builder(InstanceTemplatePrototypeInstanceTemplateByCatalogOffering instan this.resourceGroup = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.resourceGroup; this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.totalVolumeBandwidth; this.userData = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.userData; + this.vcpu = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.vcpu; this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.volumeAttachments; + this.volumeBandwidthQosMode = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.volumeBandwidthQosMode; this.vpc = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.bootVolumeAttachment; this.catalogOffering = instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface.catalogOffering; @@ -339,6 +356,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -351,6 +379,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -442,7 +481,9 @@ protected InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemp resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; catalogOffering = builder.catalogOffering; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImage.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImage.java index e87be18975..2e5eb814d3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImage.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImage.java @@ -38,6 +38,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplatePrototypeInstanceTemplateByImage() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.java index 567b0aec4f..eaad5f800e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private ImageIdentity image; @@ -82,7 +97,9 @@ public Builder(InstanceTemplatePrototypeInstanceTemplateByImage instanceTemplate this.resourceGroup = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.resourceGroup; this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.totalVolumeBandwidth; this.userData = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.userData; + this.vcpu = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.vcpu; this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.volumeAttachments; + this.volumeBandwidthQosMode = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.volumeBandwidthQosMode; this.vpc = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.bootVolumeAttachment; this.image = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.image; @@ -339,6 +356,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -351,6 +379,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -442,7 +481,9 @@ protected InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImag resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; image = builder.image; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.java index 377446c77d..e55a0d9fed 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private ImageIdentity image; @@ -82,7 +97,9 @@ public Builder(InstanceTemplatePrototypeInstanceTemplateByImage instanceTemplate this.resourceGroup = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.resourceGroup; this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.totalVolumeBandwidth; this.userData = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.userData; + this.vcpu = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.vcpu; this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.volumeAttachments; + this.volumeBandwidthQosMode = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.volumeBandwidthQosMode; this.vpc = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.bootVolumeAttachment; this.image = instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface.image; @@ -339,6 +356,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -351,6 +379,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -442,7 +481,9 @@ protected InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImag resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; image = builder.image; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.java index abfb12ef2c..d0aecc4239 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot.java @@ -36,6 +36,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + protected InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.java index ac05963cc9..4cad891632 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment; private ZoneIdentity zone; @@ -81,7 +96,9 @@ public Builder(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot instanc this.resourceGroup = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.resourceGroup; this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.totalVolumeBandwidth; this.userData = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.userData; + this.vcpu = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.vcpu; this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.volumeAttachments; + this.volumeBandwidthQosMode = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.volumeBandwidthQosMode; this.vpc = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.bootVolumeAttachment; this.zone = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment.zone; @@ -337,6 +354,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -349,6 +377,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -429,7 +468,9 @@ protected InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTempl resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; zone = builder.zone; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.java index 6410031c7d..e0befa44c9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.java @@ -35,6 +35,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -54,7 +67,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceBySourceSnapshotContext bootVolumeAttachment; private ZoneIdentity zone; @@ -81,7 +96,9 @@ public Builder(InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot instanc this.resourceGroup = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.resourceGroup; this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.totalVolumeBandwidth; this.userData = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.userData; + this.vcpu = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.vcpu; this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.volumeAttachments; + this.volumeBandwidthQosMode = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.volumeBandwidthQosMode; this.vpc = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceBySourceSnapshotContext) instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.bootVolumeAttachment; this.zone = instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface.zone; @@ -337,6 +354,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -349,6 +377,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -429,7 +468,9 @@ protected InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTempl resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; zone = builder.zone; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.java index a3d55619e3..cfbc821ae9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplate.java @@ -41,6 +41,19 @@ public interface ConfidentialComputeMode { String TDX = "tdx"; } + /** + * The volume bandwidth QoS mode to use for this virtual server instance. The specified value must be listed in the + * instance profile's `volume_bandwidth_qos_modes`. + * + * If unspecified, the default volume bandwidth QoS mode from the profile will be used. + */ + public interface VolumeBandwidthQosMode { + /** pooled. */ + String POOLED = "pooled"; + /** weighted. */ + String WEIGHTED = "weighted"; + } + /** * Builder. @@ -60,7 +73,9 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private Long totalVolumeBandwidth; private String userData; + private InstanceVCPUPrototype vcpu; private List volumeAttachments; + private String volumeBandwidthQosMode; private VPCIdentity vpc; private VolumeAttachmentPrototypeInstanceByImageContext bootVolumeAttachment; private InstanceCatalogOfferingPrototype catalogOffering; @@ -92,7 +107,9 @@ public Builder(InstanceTemplatePrototype instanceTemplatePrototypeInstanceTempla this.resourceGroup = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.resourceGroup; this.totalVolumeBandwidth = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.totalVolumeBandwidth; this.userData = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.userData; + this.vcpu = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.vcpu; this.volumeAttachments = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.volumeAttachments; + this.volumeBandwidthQosMode = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.volumeBandwidthQosMode; this.vpc = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.vpc; this.bootVolumeAttachment = (VolumeAttachmentPrototypeInstanceByImageContext) instanceTemplatePrototypeInstanceTemplateBySourceTemplate.bootVolumeAttachment; this.catalogOffering = instanceTemplatePrototypeInstanceTemplateBySourceTemplate.catalogOffering; @@ -365,6 +382,17 @@ public Builder userData(String userData) { return this; } + /** + * Set the vcpu. + * + * @param vcpu the vcpu + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder + */ + public Builder vcpu(InstanceVCPUPrototype vcpu) { + this.vcpu = vcpu; + return this; + } + /** * Set the volumeAttachments. * Existing volumeAttachments will be replaced. @@ -377,6 +405,17 @@ public Builder volumeAttachments(List volumeAttachmen return this; } + /** + * Set the volumeBandwidthQosMode. + * + * @param volumeBandwidthQosMode the volumeBandwidthQosMode + * @return the InstanceTemplatePrototypeInstanceTemplateBySourceTemplate builder + */ + public Builder volumeBandwidthQosMode(String volumeBandwidthQosMode) { + this.volumeBandwidthQosMode = volumeBandwidthQosMode; + return this; + } + /** * Set the vpc. * @@ -509,7 +548,9 @@ protected InstanceTemplatePrototypeInstanceTemplateBySourceTemplate(Builder buil resourceGroup = builder.resourceGroup; totalVolumeBandwidth = builder.totalVolumeBandwidth; userData = builder.userData; + vcpu = builder.vcpu; volumeAttachments = builder.volumeAttachments; + volumeBandwidthQosMode = builder.volumeBandwidthQosMode; vpc = builder.vpc; bootVolumeAttachment = builder.bootVolumeAttachment; catalogOffering = builder.catalogOffering; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPU.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPU.java index e95bf4fcda..775dec90c9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPU.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPU.java @@ -34,7 +34,8 @@ public interface Architecture { } /** - * The VCPU manufacturer. + * The VCPU manufacturer for this instance. It may be `unassigned` when instance `status` is `failed`, `pending`, or + * `stopped`. * * The enumerated values for this property may * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -46,11 +47,15 @@ public interface Manufacturer { String IBM = "ibm"; /** intel. */ String INTEL = "intel"; + /** unassigned. */ + String UNASSIGNED = "unassigned"; } protected String architecture; + protected InstanceVCPUBurst burst; protected Long count; protected String manufacturer; + protected Long percentage; protected InstanceVCPU() { } @@ -68,6 +73,15 @@ public String getArchitecture() { return architecture; } + /** + * Gets the burst. + * + * @return the burst + */ + public InstanceVCPUBurst getBurst() { + return burst; + } + /** * Gets the count. * @@ -82,7 +96,8 @@ public Long getCount() { /** * Gets the manufacturer. * - * The VCPU manufacturer. + * The VCPU manufacturer for this instance. It may be `unassigned` when instance `status` is `failed`, `pending`, or + * `stopped`. * * The enumerated values for this property may * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -92,5 +107,21 @@ public Long getCount() { public String getManufacturer() { return manufacturer; } + + /** + * Gets the percentage. + * + * The percentage of VCPU time allocated to the virtual server instance. + * + * The virtual server instance `vcpu.percentage` will be `100` when: + * - The virtual server instance `placement_target` is a dedicated host or dedicated + * host group. + * - The virtual server instance `reservation_affinity.policy` is `disabled`. + * + * @return the percentage + */ + public Long getPercentage() { + return percentage; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUBurst.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUBurst.java new file mode 100644 index 0000000000..9cdbd0ec8e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUBurst.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * InstanceVCPUBurst. + */ +public class InstanceVCPUBurst extends GenericModel { + + protected Long limit; + + protected InstanceVCPUBurst() { } + + /** + * Gets the limit. + * + * The maximum percentage of the base VCPU capacity the virtual server may exceed. For example, if `vcpu.count` is 1, + * `vcpu.percentage` is 50 and `vcpu.burst.limit` is 200, the instance may burst to using one full VCPU. + * + * The maximum value for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPatch.java new file mode 100644 index 0000000000..d27c3c40f7 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPatch.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * InstanceVCPUPatch. + */ +public class InstanceVCPUPatch extends GenericModel { + + protected Long percentage; + + /** + * Builder. + */ + public static class Builder { + private Long percentage; + + /** + * Instantiates a new Builder from an existing InstanceVCPUPatch instance. + * + * @param instanceVcpuPatch the instance to initialize the Builder with + */ + private Builder(InstanceVCPUPatch instanceVcpuPatch) { + this.percentage = instanceVcpuPatch.percentage; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param percentage the percentage + */ + public Builder(Long percentage) { + this.percentage = percentage; + } + + /** + * Builds a InstanceVCPUPatch. + * + * @return the new InstanceVCPUPatch instance + */ + public InstanceVCPUPatch build() { + return new InstanceVCPUPatch(this); + } + + /** + * Set the percentage. + * + * @param percentage the percentage + * @return the InstanceVCPUPatch builder + */ + public Builder percentage(long percentage) { + this.percentage = percentage; + return this; + } + } + + protected InstanceVCPUPatch() { } + + protected InstanceVCPUPatch(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.percentage, + "percentage cannot be null"); + percentage = builder.percentage; + } + + /** + * New builder. + * + * @return a InstanceVCPUPatch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the percentage. + * + * The percentage of VCPU time allocated to the virtual server instance. + * + * The virtual server instance `vcpu.percentage` must be `100` when: + * - The virtual server instance `placement_target` is a dedicated host or dedicated + * host group. + * - The virtual server instance `reservation_affinity.policy` is not `disabled`. + * + * For this property to be changed, the virtual server instance `status` must be + * `stopping` or `stopped`. + * + * @return the percentage + */ + public Long percentage() { + return percentage; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPrototype.java new file mode 100644 index 0000000000..d6d97a3ca9 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPrototype.java @@ -0,0 +1,100 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * InstanceVCPUPrototype. + */ +public class InstanceVCPUPrototype extends GenericModel { + + protected Long percentage; + + /** + * Builder. + */ + public static class Builder { + private Long percentage; + + /** + * Instantiates a new Builder from an existing InstanceVCPUPrototype instance. + * + * @param instanceVcpuPrototype the instance to initialize the Builder with + */ + private Builder(InstanceVCPUPrototype instanceVcpuPrototype) { + this.percentage = instanceVcpuPrototype.percentage; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a InstanceVCPUPrototype. + * + * @return the new InstanceVCPUPrototype instance + */ + public InstanceVCPUPrototype build() { + return new InstanceVCPUPrototype(this); + } + + /** + * Set the percentage. + * + * @param percentage the percentage + * @return the InstanceVCPUPrototype builder + */ + public Builder percentage(long percentage) { + this.percentage = percentage; + return this; + } + } + + protected InstanceVCPUPrototype() { } + + protected InstanceVCPUPrototype(Builder builder) { + percentage = builder.percentage; + } + + /** + * New builder. + * + * @return a InstanceVCPUPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the percentage. + * + * The percentage of VCPU clock cycles allocated to the instance. + * + * The virtual server instance `vcpu.percentage` must be `100` when: + * - The virtual server instance `placement_target` is a dedicated host or dedicated + * host group. + * - The virtual server instance `reservation_affinity.policy` is not `disabled`. + * + * If unspecified, the default for `vcpu_percentage` from the profile will be used. + * + * @return the percentage + */ + public Long percentage() { + return percentage; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayResourceBindingsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayResourceBindingsOptions.java new file mode 100644 index 0000000000..e7324ecb2e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayResourceBindingsOptions.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listEndpointGatewayResourceBindings options. + */ +public class ListEndpointGatewayResourceBindingsOptions extends GenericModel { + + protected String endpointGatewayId; + protected String start; + protected Long limit; + + /** + * Builder. + */ + public static class Builder { + private String endpointGatewayId; + private String start; + private Long limit; + + /** + * Instantiates a new Builder from an existing ListEndpointGatewayResourceBindingsOptions instance. + * + * @param listEndpointGatewayResourceBindingsOptions the instance to initialize the Builder with + */ + private Builder(ListEndpointGatewayResourceBindingsOptions listEndpointGatewayResourceBindingsOptions) { + this.endpointGatewayId = listEndpointGatewayResourceBindingsOptions.endpointGatewayId; + this.start = listEndpointGatewayResourceBindingsOptions.start; + this.limit = listEndpointGatewayResourceBindingsOptions.limit; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param endpointGatewayId the endpointGatewayId + */ + public Builder(String endpointGatewayId) { + this.endpointGatewayId = endpointGatewayId; + } + + /** + * Builds a ListEndpointGatewayResourceBindingsOptions. + * + * @return the new ListEndpointGatewayResourceBindingsOptions instance + */ + public ListEndpointGatewayResourceBindingsOptions build() { + return new ListEndpointGatewayResourceBindingsOptions(this); + } + + /** + * Set the endpointGatewayId. + * + * @param endpointGatewayId the endpointGatewayId + * @return the ListEndpointGatewayResourceBindingsOptions builder + */ + public Builder endpointGatewayId(String endpointGatewayId) { + this.endpointGatewayId = endpointGatewayId; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListEndpointGatewayResourceBindingsOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListEndpointGatewayResourceBindingsOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + } + + protected ListEndpointGatewayResourceBindingsOptions() { } + + protected ListEndpointGatewayResourceBindingsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, + "endpointGatewayId cannot be empty"); + endpointGatewayId = builder.endpointGatewayId; + start = builder.start; + limit = builder.limit; + } + + /** + * New builder. + * + * @return a ListEndpointGatewayResourceBindingsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the endpointGatewayId. + * + * The endpoint gateway identifier. + * + * @return the endpointGatewayId + */ + public String endpointGatewayId() { + return endpointGatewayId; + } + + /** + * Gets the start. + * + * A server-provided token determining what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The number of resources to return on a page. + * + * @return the limit + */ + public Long limit() { + return limit; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptions.java index 877d7dd90c..44628703f6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptions.java @@ -40,6 +40,15 @@ public interface LifecycleState { String WAITING = "waiting"; } + public interface DnsResolutionBindingMode { + /** disabled. */ + String DISABLED = "disabled"; + /** per_resource_binding. */ + String PER_RESOURCE_BINDING = "per_resource_binding"; + /** primary. */ + String PRIMARY = "primary"; + } + protected String name; protected String start; protected Long limit; @@ -48,7 +57,7 @@ public interface LifecycleState { protected String vpcId; protected String vpcCrn; protected String vpcName; - protected Boolean allowDnsResolutionBinding; + protected List dnsResolutionBindingMode; /** * Builder. @@ -62,7 +71,7 @@ public static class Builder { private String vpcId; private String vpcCrn; private String vpcName; - private Boolean allowDnsResolutionBinding; + private List dnsResolutionBindingMode; /** * Instantiates a new Builder from an existing ListEndpointGatewaysOptions instance. @@ -78,7 +87,7 @@ private Builder(ListEndpointGatewaysOptions listEndpointGatewaysOptions) { this.vpcId = listEndpointGatewaysOptions.vpcId; this.vpcCrn = listEndpointGatewaysOptions.vpcCrn; this.vpcName = listEndpointGatewaysOptions.vpcName; - this.allowDnsResolutionBinding = listEndpointGatewaysOptions.allowDnsResolutionBinding; + this.dnsResolutionBindingMode = listEndpointGatewaysOptions.dnsResolutionBindingMode; } /** @@ -112,6 +121,22 @@ public Builder addLifecycleState(String lifecycleState) { return this; } + /** + * Adds a new element to dnsResolutionBindingMode. + * + * @param dnsResolutionBindingMode the new element to be added + * @return the ListEndpointGatewaysOptions builder + */ + public Builder addDnsResolutionBindingMode(String dnsResolutionBindingMode) { + com.ibm.cloud.sdk.core.util.Validator.notNull(dnsResolutionBindingMode, + "dnsResolutionBindingMode cannot be null"); + if (this.dnsResolutionBindingMode == null) { + this.dnsResolutionBindingMode = new ArrayList(); + } + this.dnsResolutionBindingMode.add(dnsResolutionBindingMode); + return this; + } + /** * Set the name. * @@ -202,13 +227,14 @@ public Builder vpcName(String vpcName) { } /** - * Set the allowDnsResolutionBinding. + * Set the dnsResolutionBindingMode. + * Existing dnsResolutionBindingMode will be replaced. * - * @param allowDnsResolutionBinding the allowDnsResolutionBinding + * @param dnsResolutionBindingMode the dnsResolutionBindingMode * @return the ListEndpointGatewaysOptions builder */ - public Builder allowDnsResolutionBinding(Boolean allowDnsResolutionBinding) { - this.allowDnsResolutionBinding = allowDnsResolutionBinding; + public Builder dnsResolutionBindingMode(List dnsResolutionBindingMode) { + this.dnsResolutionBindingMode = dnsResolutionBindingMode; return this; } } @@ -224,7 +250,7 @@ protected ListEndpointGatewaysOptions(Builder builder) { vpcId = builder.vpcId; vpcCrn = builder.vpcCrn; vpcName = builder.vpcName; - allowDnsResolutionBinding = builder.allowDnsResolutionBinding; + dnsResolutionBindingMode = builder.dnsResolutionBindingMode; } /** @@ -326,15 +352,15 @@ public String vpcName() { } /** - * Gets the allowDnsResolutionBinding. + * Gets the dnsResolutionBindingMode. * - * Filters the collection to endpoint gateways with an `allow_dns_resolution_binding` property matching the specified - * value. + * Filters the collection to endpoint gateways with a `dns_resolution_binding_mode` property matching one of the + * specified comma-separated values. * - * @return the allowDnsResolutionBinding + * @return the dnsResolutionBindingMode */ - public Boolean allowDnsResolutionBinding() { - return allowDnsResolutionBinding; + public List dnsResolutionBindingMode() { + return dnsResolutionBindingMode; } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageBareMetalServerProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageBareMetalServerProfilesOptions.java new file mode 100644 index 0000000000..1fe4ad7176 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageBareMetalServerProfilesOptions.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listImageBareMetalServerProfiles options. + */ +public class ListImageBareMetalServerProfilesOptions extends GenericModel { + + protected String id; + protected String start; + protected Long limit; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String start; + private Long limit; + + /** + * Instantiates a new Builder from an existing ListImageBareMetalServerProfilesOptions instance. + * + * @param listImageBareMetalServerProfilesOptions the instance to initialize the Builder with + */ + private Builder(ListImageBareMetalServerProfilesOptions listImageBareMetalServerProfilesOptions) { + this.id = listImageBareMetalServerProfilesOptions.id; + this.start = listImageBareMetalServerProfilesOptions.start; + this.limit = listImageBareMetalServerProfilesOptions.limit; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param id the id + */ + public Builder(String id) { + this.id = id; + } + + /** + * Builds a ListImageBareMetalServerProfilesOptions. + * + * @return the new ListImageBareMetalServerProfilesOptions instance + */ + public ListImageBareMetalServerProfilesOptions build() { + return new ListImageBareMetalServerProfilesOptions(this); + } + + /** + * Set the id. + * + * @param id the id + * @return the ListImageBareMetalServerProfilesOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListImageBareMetalServerProfilesOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListImageBareMetalServerProfilesOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + } + + protected ListImageBareMetalServerProfilesOptions() { } + + protected ListImageBareMetalServerProfilesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + id = builder.id; + start = builder.start; + limit = builder.limit; + } + + /** + * New builder. + * + * @return a ListImageBareMetalServerProfilesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The image identifier. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the start. + * + * A server-provided token determining what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The number of resources to return on a page. + * + * @return the limit + */ + public Long limit() { + return limit; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageInstanceProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageInstanceProfilesOptions.java new file mode 100644 index 0000000000..aafaa8cf6c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListImageInstanceProfilesOptions.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listImageInstanceProfiles options. + */ +public class ListImageInstanceProfilesOptions extends GenericModel { + + protected String id; + protected String start; + protected Long limit; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String start; + private Long limit; + + /** + * Instantiates a new Builder from an existing ListImageInstanceProfilesOptions instance. + * + * @param listImageInstanceProfilesOptions the instance to initialize the Builder with + */ + private Builder(ListImageInstanceProfilesOptions listImageInstanceProfilesOptions) { + this.id = listImageInstanceProfilesOptions.id; + this.start = listImageInstanceProfilesOptions.start; + this.limit = listImageInstanceProfilesOptions.limit; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param id the id + */ + public Builder(String id) { + this.id = id; + } + + /** + * Builds a ListImageInstanceProfilesOptions. + * + * @return the new ListImageInstanceProfilesOptions instance + */ + public ListImageInstanceProfilesOptions build() { + return new ListImageInstanceProfilesOptions(this); + } + + /** + * Set the id. + * + * @param id the id + * @return the ListImageInstanceProfilesOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListImageInstanceProfilesOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListImageInstanceProfilesOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + } + + protected ListImageInstanceProfilesOptions() { } + + protected ListImageInstanceProfilesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + id = builder.id; + start = builder.start; + limit = builder.limit; + } + + /** + * New builder. + * + * @return a ListImageInstanceProfilesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The image identifier. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the start. + * + * A server-provided token determining what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The number of resources to return on a page. + * + * @return the limit + */ + public Long limit() { + return limit; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptions.java index e326a5d714..b0bbac6245 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptions.java @@ -42,6 +42,8 @@ public interface ReservationAffinityPolicy { protected String dedicatedHostId; protected String dedicatedHostCrn; protected String dedicatedHostName; + protected String instanceGroupMembershipInstanceGroupId; + protected String instanceGroupMembershipInstanceGroupCrn; protected String placementGroupId; protected String placementGroupCrn; protected String placementGroupName; @@ -67,6 +69,8 @@ public static class Builder { private String dedicatedHostId; private String dedicatedHostCrn; private String dedicatedHostName; + private String instanceGroupMembershipInstanceGroupId; + private String instanceGroupMembershipInstanceGroupCrn; private String placementGroupId; private String placementGroupCrn; private String placementGroupName; @@ -94,6 +98,8 @@ private Builder(ListInstancesOptions listInstancesOptions) { this.dedicatedHostId = listInstancesOptions.dedicatedHostId; this.dedicatedHostCrn = listInstancesOptions.dedicatedHostCrn; this.dedicatedHostName = listInstancesOptions.dedicatedHostName; + this.instanceGroupMembershipInstanceGroupId = listInstancesOptions.instanceGroupMembershipInstanceGroupId; + this.instanceGroupMembershipInstanceGroupCrn = listInstancesOptions.instanceGroupMembershipInstanceGroupCrn; this.placementGroupId = listInstancesOptions.placementGroupId; this.placementGroupCrn = listInstancesOptions.placementGroupCrn; this.placementGroupName = listInstancesOptions.placementGroupName; @@ -231,6 +237,28 @@ public Builder dedicatedHostName(String dedicatedHostName) { return this; } + /** + * Set the instanceGroupMembershipInstanceGroupId. + * + * @param instanceGroupMembershipInstanceGroupId the instanceGroupMembershipInstanceGroupId + * @return the ListInstancesOptions builder + */ + public Builder instanceGroupMembershipInstanceGroupId(String instanceGroupMembershipInstanceGroupId) { + this.instanceGroupMembershipInstanceGroupId = instanceGroupMembershipInstanceGroupId; + return this; + } + + /** + * Set the instanceGroupMembershipInstanceGroupCrn. + * + * @param instanceGroupMembershipInstanceGroupCrn the instanceGroupMembershipInstanceGroupCrn + * @return the ListInstancesOptions builder + */ + public Builder instanceGroupMembershipInstanceGroupCrn(String instanceGroupMembershipInstanceGroupCrn) { + this.instanceGroupMembershipInstanceGroupCrn = instanceGroupMembershipInstanceGroupCrn; + return this; + } + /** * Set the placementGroupId. * @@ -355,6 +383,8 @@ protected ListInstancesOptions(Builder builder) { dedicatedHostId = builder.dedicatedHostId; dedicatedHostCrn = builder.dedicatedHostCrn; dedicatedHostName = builder.dedicatedHostName; + instanceGroupMembershipInstanceGroupId = builder.instanceGroupMembershipInstanceGroupId; + instanceGroupMembershipInstanceGroupCrn = builder.instanceGroupMembershipInstanceGroupCrn; placementGroupId = builder.placementGroupId; placementGroupCrn = builder.placementGroupCrn; placementGroupName = builder.placementGroupName; @@ -486,6 +516,30 @@ public String dedicatedHostName() { return dedicatedHostName; } + /** + * Gets the instanceGroupMembershipInstanceGroupId. + * + * Filters the collection to instances with an `instance_group_membership.instance_group.id` property matching the + * specified instance group identifier. + * + * @return the instanceGroupMembershipInstanceGroupId + */ + public String instanceGroupMembershipInstanceGroupId() { + return instanceGroupMembershipInstanceGroupId; + } + + /** + * Gets the instanceGroupMembershipInstanceGroupCrn. + * + * Filters the collection to instances with an `instance_group_membership.instance_group.crn` property matching the + * specified instance group CRN. + * + * @return the instanceGroupMembershipInstanceGroupCrn + */ + public String instanceGroupMembershipInstanceGroupCrn() { + return instanceGroupMembershipInstanceGroupCrn; + } + /** * Gets the placementGroupId. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotInstanceProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotInstanceProfilesOptions.java new file mode 100644 index 0000000000..cc69e3e78e --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotInstanceProfilesOptions.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listSnapshotInstanceProfiles options. + */ +public class ListSnapshotInstanceProfilesOptions extends GenericModel { + + protected String id; + protected String start; + protected Long limit; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String start; + private Long limit; + + /** + * Instantiates a new Builder from an existing ListSnapshotInstanceProfilesOptions instance. + * + * @param listSnapshotInstanceProfilesOptions the instance to initialize the Builder with + */ + private Builder(ListSnapshotInstanceProfilesOptions listSnapshotInstanceProfilesOptions) { + this.id = listSnapshotInstanceProfilesOptions.id; + this.start = listSnapshotInstanceProfilesOptions.start; + this.limit = listSnapshotInstanceProfilesOptions.limit; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param id the id + */ + public Builder(String id) { + this.id = id; + } + + /** + * Builds a ListSnapshotInstanceProfilesOptions. + * + * @return the new ListSnapshotInstanceProfilesOptions instance + */ + public ListSnapshotInstanceProfilesOptions build() { + return new ListSnapshotInstanceProfilesOptions(this); + } + + /** + * Set the id. + * + * @param id the id + * @return the ListSnapshotInstanceProfilesOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListSnapshotInstanceProfilesOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListSnapshotInstanceProfilesOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + } + + protected ListSnapshotInstanceProfilesOptions() { } + + protected ListSnapshotInstanceProfilesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + id = builder.id; + start = builder.start; + limit = builder.limit; + } + + /** + * New builder. + * + * @return a ListSnapshotInstanceProfilesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The snapshot identifier. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the start. + * + * A server-provided token determining what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The number of resources to return on a page. + * + * @return the limit + */ + public Long limit() { + return limit; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeInstanceProfilesOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeInstanceProfilesOptions.java new file mode 100644 index 0000000000..c6f4d6bd21 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeInstanceProfilesOptions.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listVolumeInstanceProfiles options. + */ +public class ListVolumeInstanceProfilesOptions extends GenericModel { + + protected String id; + protected String start; + protected Long limit; + + /** + * Builder. + */ + public static class Builder { + private String id; + private String start; + private Long limit; + + /** + * Instantiates a new Builder from an existing ListVolumeInstanceProfilesOptions instance. + * + * @param listVolumeInstanceProfilesOptions the instance to initialize the Builder with + */ + private Builder(ListVolumeInstanceProfilesOptions listVolumeInstanceProfilesOptions) { + this.id = listVolumeInstanceProfilesOptions.id; + this.start = listVolumeInstanceProfilesOptions.start; + this.limit = listVolumeInstanceProfilesOptions.limit; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param id the id + */ + public Builder(String id) { + this.id = id; + } + + /** + * Builds a ListVolumeInstanceProfilesOptions. + * + * @return the new ListVolumeInstanceProfilesOptions instance + */ + public ListVolumeInstanceProfilesOptions build() { + return new ListVolumeInstanceProfilesOptions(this); + } + + /** + * Set the id. + * + * @param id the id + * @return the ListVolumeInstanceProfilesOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListVolumeInstanceProfilesOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListVolumeInstanceProfilesOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + } + + protected ListVolumeInstanceProfilesOptions() { } + + protected ListVolumeInstanceProfilesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + id = builder.id; + start = builder.start; + limit = builder.limit; + } + + /** + * New builder. + * + * @return a ListVolumeInstanceProfilesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the id. + * + * The volume identifier. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the start. + * + * A server-provided token determining what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The number of resources to return on a page. + * + * @return the limit + */ + public Long limit() { + return limit; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayAdvertisedCidrsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayAdvertisedCidrsOptions.java new file mode 100644 index 0000000000..ea9f19a068 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayAdvertisedCidrsOptions.java @@ -0,0 +1,104 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listVpnGatewayAdvertisedCidrs options. + */ +public class ListVpnGatewayAdvertisedCidrsOptions extends GenericModel { + + protected String vpnGatewayId; + + /** + * Builder. + */ + public static class Builder { + private String vpnGatewayId; + + /** + * Instantiates a new Builder from an existing ListVpnGatewayAdvertisedCidrsOptions instance. + * + * @param listVpnGatewayAdvertisedCidrsOptions the instance to initialize the Builder with + */ + private Builder(ListVpnGatewayAdvertisedCidrsOptions listVpnGatewayAdvertisedCidrsOptions) { + this.vpnGatewayId = listVpnGatewayAdvertisedCidrsOptions.vpnGatewayId; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param vpnGatewayId the vpnGatewayId + */ + public Builder(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } + + /** + * Builds a ListVpnGatewayAdvertisedCidrsOptions. + * + * @return the new ListVpnGatewayAdvertisedCidrsOptions instance + */ + public ListVpnGatewayAdvertisedCidrsOptions build() { + return new ListVpnGatewayAdvertisedCidrsOptions(this); + } + + /** + * Set the vpnGatewayId. + * + * @param vpnGatewayId the vpnGatewayId + * @return the ListVpnGatewayAdvertisedCidrsOptions builder + */ + public Builder vpnGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + return this; + } + } + + protected ListVpnGatewayAdvertisedCidrsOptions() { } + + protected ListVpnGatewayAdvertisedCidrsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, + "vpnGatewayId cannot be empty"); + vpnGatewayId = builder.vpnGatewayId; + } + + /** + * New builder. + * + * @return a ListVpnGatewayAdvertisedCidrsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the vpnGatewayId. + * + * The VPN gateway identifier. + * + * @return the vpnGatewayId + */ + public String vpnGatewayId() { + return vpnGatewayId; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayServiceConnectionsOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayServiceConnectionsOptions.java new file mode 100644 index 0000000000..756365ef5d --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayServiceConnectionsOptions.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The listVpnGatewayServiceConnections options. + */ +public class ListVpnGatewayServiceConnectionsOptions extends GenericModel { + + protected String vpnGatewayId; + protected String start; + protected Long limit; + + /** + * Builder. + */ + public static class Builder { + private String vpnGatewayId; + private String start; + private Long limit; + + /** + * Instantiates a new Builder from an existing ListVpnGatewayServiceConnectionsOptions instance. + * + * @param listVpnGatewayServiceConnectionsOptions the instance to initialize the Builder with + */ + private Builder(ListVpnGatewayServiceConnectionsOptions listVpnGatewayServiceConnectionsOptions) { + this.vpnGatewayId = listVpnGatewayServiceConnectionsOptions.vpnGatewayId; + this.start = listVpnGatewayServiceConnectionsOptions.start; + this.limit = listVpnGatewayServiceConnectionsOptions.limit; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param vpnGatewayId the vpnGatewayId + */ + public Builder(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + } + + /** + * Builds a ListVpnGatewayServiceConnectionsOptions. + * + * @return the new ListVpnGatewayServiceConnectionsOptions instance + */ + public ListVpnGatewayServiceConnectionsOptions build() { + return new ListVpnGatewayServiceConnectionsOptions(this); + } + + /** + * Set the vpnGatewayId. + * + * @param vpnGatewayId the vpnGatewayId + * @return the ListVpnGatewayServiceConnectionsOptions builder + */ + public Builder vpnGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + return this; + } + + /** + * Set the start. + * + * @param start the start + * @return the ListVpnGatewayServiceConnectionsOptions builder + */ + public Builder start(String start) { + this.start = start; + return this; + } + + /** + * Set the limit. + * + * @param limit the limit + * @return the ListVpnGatewayServiceConnectionsOptions builder + */ + public Builder limit(long limit) { + this.limit = limit; + return this; + } + } + + protected ListVpnGatewayServiceConnectionsOptions() { } + + protected ListVpnGatewayServiceConnectionsOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, + "vpnGatewayId cannot be empty"); + vpnGatewayId = builder.vpnGatewayId; + start = builder.start; + limit = builder.limit; + } + + /** + * New builder. + * + * @return a ListVpnGatewayServiceConnectionsOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the vpnGatewayId. + * + * The VPN gateway identifier. + * + * @return the vpnGatewayId + */ + public String vpnGatewayId() { + return vpnGatewayId; + } + + /** + * Gets the start. + * + * A server-provided token determining what resource to start the page on. + * + * @return the start + */ + public String start() { + return start; + } + + /** + * Gets the limit. + * + * The number of resources to return on a page. + * + * @return the limit + */ + public Long limit() { + return limit; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTarget.java index 4678973a86..ccee2072c7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTarget.java @@ -21,7 +21,8 @@ * * Classes which extend this class: * - LoadBalancerPoolMemberTargetInstanceReference - * - LoadBalancerPoolMemberTargetIP + * - LoadBalancerPoolMemberTargetByReservedIp + * - LoadBalancerPoolMemberTargetIPNotReservedIP * - LoadBalancerPoolMemberTargetLoadBalancerReference */ public class LoadBalancerPoolMemberTarget extends GenericModel { @@ -30,8 +31,8 @@ public class LoadBalancerPoolMemberTarget extends GenericModel { * The resource type. */ public interface ResourceType { - /** load_balancer. */ - String LOAD_BALANCER = "load_balancer"; + /** subnet_reserved_ip. */ + String SUBNET_RESERVED_IP = "subnet_reserved_ip"; } protected String crn; @@ -106,6 +107,8 @@ public String getName() { * * The IP address. * + * If the address has not yet been selected, the value will be `0.0.0.0`. + * * This property may [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) to support IPv6 addresses in * the future. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetByReservedIp.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetByReservedIp.java new file mode 100644 index 0000000000..f364f6c7e6 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetByReservedIp.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * LoadBalancerPoolMemberTargetByReservedIp. + */ +public class LoadBalancerPoolMemberTargetByReservedIp extends LoadBalancerPoolMemberTarget { + + /** + * The resource type. + */ + public interface ResourceType { + /** subnet_reserved_ip. */ + String SUBNET_RESERVED_IP = "subnet_reserved_ip"; + } + + + protected LoadBalancerPoolMemberTargetByReservedIp() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPNotReservedIP.java similarity index 75% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIP.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPNotReservedIP.java index d5f11a89bc..a7375aafae 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPNotReservedIP.java @@ -14,11 +14,11 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * LoadBalancerPoolMemberTargetIP. + * LoadBalancerPoolMemberTargetIPNotReservedIP. */ -public class LoadBalancerPoolMemberTargetIP extends LoadBalancerPoolMemberTarget { +public class LoadBalancerPoolMemberTargetIPNotReservedIP extends LoadBalancerPoolMemberTarget { - protected LoadBalancerPoolMemberTargetIP() { } + protected LoadBalancerPoolMemberTargetIPNotReservedIP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototype.java index 1f1b88a372..2aea03276d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototype.java @@ -25,6 +25,7 @@ * * Classes which extend this class: * - LoadBalancerPoolMemberTargetPrototypeInstanceIdentity + * - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity * - LoadBalancerPoolMemberTargetPrototypeIP * - LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentity */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity.java new file mode 100644 index 0000000000..9cb6032709 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity.java @@ -0,0 +1,28 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * Identifies a reserved IP by a unique property. + * + * Classes which extend this class: + * - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById + * - LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref + */ +public class LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity extends LoadBalancerPoolMemberTargetPrototype { + + + protected LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.java new file mode 100644 index 0000000000..a41fdb2e3a --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref. + */ +public class LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref extends LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity { + + + /** + * Builder. + */ + public static class Builder { + private String href; + + /** + * Instantiates a new Builder from an existing LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref instance. + * + * @param loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHref the instance to initialize the Builder with + */ + public Builder(LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHref) { + this.href = loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHref.href; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param href the href + */ + public Builder(String href) { + this.href = href; + } + + /** + * Builds a LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref. + * + * @return the new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref instance + */ + public LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref build() { + return new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref(this); + } + + /** + * Set the href. + * + * @param href the href + * @return the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref builder + */ + public Builder href(String href) { + this.href = href; + return this; + } + } + + protected LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref() { } + + protected LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.href, + "href cannot be null"); + href = builder.href; + } + + /** + * New builder. + * + * @return a LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById.java new file mode 100644 index 0000000000..279f5e93fe --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById. + */ +public class LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById extends LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity { + + + /** + * Builder. + */ + public static class Builder { + private String id; + + /** + * Instantiates a new Builder from an existing LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById instance. + * + * @param loadBalancerPoolMemberTargetPrototypeReservedIpIdentityById the instance to initialize the Builder with + */ + public Builder(LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity loadBalancerPoolMemberTargetPrototypeReservedIpIdentityById) { + this.id = loadBalancerPoolMemberTargetPrototypeReservedIpIdentityById.id; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param id the id + */ + public Builder(String id) { + this.id = id; + } + + /** + * Builds a LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById. + * + * @return the new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById instance + */ + public LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById build() { + return new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById(this); + } + + /** + * Set the id. + * + * @param id the id + * @return the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + } + + protected LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById() { } + + protected LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.id, + "id cannot be null"); + id = builder.id; + } + + /** + * New builder. + * + * @return a LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfile.java index 18f6816460..d176e4952a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfile.java @@ -56,6 +56,8 @@ public interface Family { protected LoadBalancerProfileSourceIPSessionPersistenceSupported sourceIpSessionPersistenceSupported; @SerializedName("targetable_load_balancer_profiles") protected List targetableLoadBalancerProfiles; + @SerializedName("targetable_resource_types") + protected LoadBalancerProfileTargetableResourceTypes targetableResourceTypes; @SerializedName("udp_supported") protected LoadBalancerProfileUDPSupported udpSupported; @@ -182,6 +184,15 @@ public List getTargetableLoadBalancerProfiles() { return targetableLoadBalancerProfiles; } + /** + * Gets the targetableResourceTypes. + * + * @return the targetableResourceTypes + */ + public LoadBalancerProfileTargetableResourceTypes getTargetableResourceTypes() { + return targetableResourceTypes; + } + /** * Gets the udpSupported. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTargetableResourceTypes.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTargetableResourceTypes.java new file mode 100644 index 0000000000..11dc5617bf --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTargetableResourceTypes.java @@ -0,0 +1,80 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * LoadBalancerProfileTargetableResourceTypes. + */ +public class LoadBalancerProfileTargetableResourceTypes extends GenericModel { + + /** + * The type for this profile field. + */ + public interface Type { + /** enum. */ + String X_ENUM = "enum"; + } + + /** + * The [resource types](https://cloud.ibm.com/docs/vpc?topic=vpc-nlb-vs-elb&interface=ui#lb-comparison-chart) that + * can be targeted by the load balancer pool member: + * - 'instance': Traffic is forwarded to the primary IP address for the instance's + * 'primary_network_interface' or 'primary_network_attachment'. + * - 'subnet_reserved_ip': Traffic is forwarded to the reserved IP address. + * - `load_balancer`: Traffic is forwarded to the load balancer. + * - `ip`: Traffic is forwarded to the IP address. + */ + public interface Values { + /** instance. */ + String INSTANCE = "instance"; + /** ip. */ + String IP = "ip"; + /** load_balancer. */ + String LOAD_BALANCER = "load_balancer"; + /** subnet_reserved_ip. */ + String SUBNET_RESERVED_IP = "subnet_reserved_ip"; + } + + protected String type; + protected List values; + + protected LoadBalancerProfileTargetableResourceTypes() { } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the values. + * + * The resource types that pool members of load balancers with this profile can target. + * + * @return the values + */ + public List getValues() { + return values; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRule.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRule.java index 6a7b2bfc26..528cb1492c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRule.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRule.java @@ -22,9 +22,11 @@ * NetworkACLRule. * * Classes which extend this class: - * - NetworkACLRuleNetworkACLRuleProtocolAll + * - NetworkACLRuleNetworkACLRuleProtocolAny + * - NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP * - NetworkACLRuleNetworkACLRuleProtocolICMP * - NetworkACLRuleNetworkACLRuleProtocolTCPUDP + * - NetworkACLRuleNetworkACLRuleProtocolIndividual */ public class NetworkACLRule extends GenericModel { @SuppressWarnings("unused") @@ -32,10 +34,264 @@ public class NetworkACLRule extends GenericModel { protected static java.util.Map> discriminatorMapping; static { discriminatorMapping = new java.util.HashMap<>(); - discriminatorMapping.put("all", NetworkACLRuleNetworkACLRuleProtocolAll.class); + discriminatorMapping.put("ah", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("any", NetworkACLRuleNetworkACLRuleProtocolAny.class); + discriminatorMapping.put("esp", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("gre", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); discriminatorMapping.put("icmp", NetworkACLRuleNetworkACLRuleProtocolICMP.class); + discriminatorMapping.put("icmp_tcp_udp", NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP.class); + discriminatorMapping.put("ip_in_ip", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("l2tp", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_0", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_10", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_100", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_101", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_102", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_103", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_104", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_105", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_106", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_107", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_108", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_109", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_11", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_110", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_111", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_113", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_114", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_116", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_117", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_118", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_119", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_12", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_120", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_121", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_122", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_123", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_124", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_125", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_126", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_127", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_128", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_129", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_13", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_130", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_131", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_133", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_134", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_135", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_136", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_137", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_138", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_139", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_14", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_140", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_141", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_142", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_143", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_144", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_145", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_146", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_147", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_148", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_149", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_15", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_150", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_151", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_152", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_153", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_154", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_155", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_156", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_157", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_158", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_159", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_16", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_160", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_161", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_162", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_163", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_164", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_165", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_166", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_167", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_168", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_169", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_170", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_171", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_172", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_173", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_174", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_175", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_176", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_177", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_178", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_179", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_18", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_180", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_181", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_182", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_183", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_184", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_185", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_186", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_187", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_188", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_189", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_19", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_190", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_191", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_192", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_193", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_194", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_195", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_196", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_197", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_198", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_199", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_2", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_20", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_200", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_201", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_202", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_203", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_204", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_205", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_206", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_207", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_208", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_209", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_21", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_210", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_211", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_212", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_213", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_214", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_215", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_216", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_217", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_218", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_219", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_22", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_220", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_221", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_222", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_223", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_224", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_225", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_226", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_227", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_228", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_229", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_23", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_230", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_231", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_232", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_233", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_234", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_235", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_236", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_237", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_238", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_239", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_24", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_240", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_241", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_242", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_243", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_244", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_245", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_246", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_247", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_248", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_249", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_25", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_250", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_251", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_252", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_253", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_254", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_255", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_26", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_27", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_28", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_29", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_3", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_30", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_31", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_32", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_33", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_34", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_35", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_36", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_37", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_38", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_39", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_40", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_41", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_42", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_43", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_44", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_45", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_48", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_49", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_5", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_52", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_53", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_54", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_55", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_56", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_57", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_58", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_59", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_60", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_61", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_62", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_63", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_64", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_65", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_66", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_67", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_68", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_69", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_7", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_70", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_71", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_72", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_73", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_74", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_75", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_76", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_77", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_78", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_79", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_8", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_80", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_81", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_82", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_83", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_84", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_85", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_86", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_87", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_88", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_89", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_9", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_90", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_91", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_92", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_93", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_94", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_95", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_96", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_97", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_98", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_99", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("rsvp", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("sctp", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); discriminatorMapping.put("tcp", NetworkACLRuleNetworkACLRuleProtocolTCPUDP.class); discriminatorMapping.put("udp", NetworkACLRuleNetworkACLRuleProtocolTCPUDP.class); + discriminatorMapping.put("vrrp", NetworkACLRuleNetworkACLRuleProtocolIndividual.class); } /** * The action to perform for a packet matching the rule. @@ -72,14 +328,522 @@ public interface IpVersion { * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** ah. */ + String AH = "ah"; + /** any. */ + String ANY = "any"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; /** icmp. */ String ICMP = "icmp"; + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; /** tcp. */ String TCP = "tcp"; /** udp. */ String UDP = "udp"; + /** vrrp. */ + String VRRP = "vrrp"; } protected String action; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItem.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItem.java index 21f69b5b1f..909240c431 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItem.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItem.java @@ -22,9 +22,11 @@ * NetworkACLRuleItem. * * Classes which extend this class: - * - NetworkACLRuleItemNetworkACLRuleProtocolAll + * - NetworkACLRuleItemNetworkACLRuleProtocolAny + * - NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP * - NetworkACLRuleItemNetworkACLRuleProtocolICMP * - NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP + * - NetworkACLRuleItemNetworkACLRuleProtocolIndividual */ public class NetworkACLRuleItem extends GenericModel { @SuppressWarnings("unused") @@ -32,10 +34,264 @@ public class NetworkACLRuleItem extends GenericModel { protected static java.util.Map> discriminatorMapping; static { discriminatorMapping = new java.util.HashMap<>(); - discriminatorMapping.put("all", NetworkACLRuleItemNetworkACLRuleProtocolAll.class); + discriminatorMapping.put("ah", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("any", NetworkACLRuleItemNetworkACLRuleProtocolAny.class); + discriminatorMapping.put("esp", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("gre", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); discriminatorMapping.put("icmp", NetworkACLRuleItemNetworkACLRuleProtocolICMP.class); + discriminatorMapping.put("icmp_tcp_udp", NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP.class); + discriminatorMapping.put("ip_in_ip", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("l2tp", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_0", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_10", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_100", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_101", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_102", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_103", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_104", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_105", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_106", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_107", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_108", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_109", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_11", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_110", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_111", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_113", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_114", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_116", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_117", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_118", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_119", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_12", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_120", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_121", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_122", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_123", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_124", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_125", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_126", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_127", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_128", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_129", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_13", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_130", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_131", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_133", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_134", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_135", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_136", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_137", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_138", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_139", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_14", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_140", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_141", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_142", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_143", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_144", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_145", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_146", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_147", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_148", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_149", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_15", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_150", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_151", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_152", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_153", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_154", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_155", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_156", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_157", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_158", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_159", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_16", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_160", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_161", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_162", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_163", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_164", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_165", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_166", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_167", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_168", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_169", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_170", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_171", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_172", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_173", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_174", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_175", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_176", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_177", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_178", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_179", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_18", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_180", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_181", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_182", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_183", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_184", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_185", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_186", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_187", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_188", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_189", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_19", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_190", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_191", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_192", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_193", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_194", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_195", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_196", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_197", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_198", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_199", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_2", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_20", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_200", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_201", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_202", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_203", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_204", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_205", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_206", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_207", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_208", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_209", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_21", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_210", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_211", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_212", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_213", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_214", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_215", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_216", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_217", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_218", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_219", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_22", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_220", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_221", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_222", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_223", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_224", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_225", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_226", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_227", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_228", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_229", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_23", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_230", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_231", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_232", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_233", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_234", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_235", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_236", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_237", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_238", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_239", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_24", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_240", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_241", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_242", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_243", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_244", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_245", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_246", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_247", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_248", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_249", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_25", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_250", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_251", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_252", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_253", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_254", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_255", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_26", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_27", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_28", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_29", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_3", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_30", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_31", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_32", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_33", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_34", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_35", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_36", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_37", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_38", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_39", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_40", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_41", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_42", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_43", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_44", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_45", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_48", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_49", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_5", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_52", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_53", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_54", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_55", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_56", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_57", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_58", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_59", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_60", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_61", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_62", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_63", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_64", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_65", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_66", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_67", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_68", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_69", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_7", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_70", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_71", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_72", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_73", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_74", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_75", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_76", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_77", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_78", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_79", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_8", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_80", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_81", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_82", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_83", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_84", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_85", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_86", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_87", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_88", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_89", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_9", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_90", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_91", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_92", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_93", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_94", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_95", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_96", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_97", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_98", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("number_99", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("rsvp", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); + discriminatorMapping.put("sctp", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); discriminatorMapping.put("tcp", NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.class); discriminatorMapping.put("udp", NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP.class); + discriminatorMapping.put("vrrp", NetworkACLRuleItemNetworkACLRuleProtocolIndividual.class); } /** * The action to perform for a packet matching the rule. @@ -72,14 +328,522 @@ public interface IpVersion { * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** ah. */ + String AH = "ah"; + /** any. */ + String ANY = "any"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; /** icmp. */ String ICMP = "icmp"; + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; /** tcp. */ String TCP = "tcp"; /** udp. */ String UDP = "udp"; + /** vrrp. */ + String VRRP = "vrrp"; } protected String action; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAll.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAny.java similarity index 85% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAll.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAny.java index ca9e0f67f9..da8dde4977 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAll.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAny.java @@ -14,9 +14,9 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * A rule for ICMP, TCP and UDP traffic. + * NetworkACLRuleItemNetworkACLRuleProtocolAny. */ -public class NetworkACLRuleItemNetworkACLRuleProtocolAll extends NetworkACLRuleItem { +public class NetworkACLRuleItemNetworkACLRuleProtocolAny extends NetworkACLRuleItem { /** * The action to perform for a packet matching the rule. @@ -50,11 +50,11 @@ public interface IpVersion { * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** any. */ + String ANY = "any"; } - protected NetworkACLRuleItemNetworkACLRuleProtocolAll() { } + protected NetworkACLRuleItemNetworkACLRuleProtocolAny() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP.java new file mode 100644 index 0000000000..cdcc5f90af --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP. + */ +public class NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP extends NetworkACLRuleItem { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version for this rule. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + */ + public interface Protocol { + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + } + + + protected NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolIndividual.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolIndividual.java new file mode 100644 index 0000000000..e898280806 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolIndividual.java @@ -0,0 +1,577 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRuleItemNetworkACLRuleProtocolIndividual. + */ +public class NetworkACLRuleItemNetworkACLRuleProtocolIndividual extends NetworkACLRuleItem { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version for this rule. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + * + * The value must be the name of an individual protocol, excluding `icmp`, `tcp` and `udp`. Names for well known + * protocols are: + * - `ah`: AH (authentication header, protocol number `51`) + * - `esp`: ESP (encapsulating security payload, protocol number `50`) + * - `gre`: GRE (generic routing encapsulation, protocol number `47`) + * - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + * - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + * - `rsvp`: RSVP (reservation protocol, protocol number `46`) + * - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + * - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + * + * For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + */ + public interface Protocol { + /** ah. */ + String AH = "ah"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; + /** vrrp. */ + String VRRP = "vrrp"; + } + + + protected NetworkACLRuleItemNetworkACLRuleProtocolIndividual() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAll.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAny.java similarity index 85% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAll.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAny.java index 0bffec41ed..5e3e5784cf 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAll.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAny.java @@ -14,9 +14,9 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * A rule for ICMP, TCP and UDP traffic. + * NetworkACLRuleNetworkACLRuleProtocolAny. */ -public class NetworkACLRuleNetworkACLRuleProtocolAll extends NetworkACLRule { +public class NetworkACLRuleNetworkACLRuleProtocolAny extends NetworkACLRule { /** * The action to perform for a packet matching the rule. @@ -50,11 +50,11 @@ public interface IpVersion { * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** any. */ + String ANY = "any"; } - protected NetworkACLRuleNetworkACLRuleProtocolAll() { } + protected NetworkACLRuleNetworkACLRuleProtocolAny() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP.java new file mode 100644 index 0000000000..b45c6779ee --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP. + */ +public class NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP extends NetworkACLRule { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version for this rule. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + */ + public interface Protocol { + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + } + + + protected NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolIndividual.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolIndividual.java new file mode 100644 index 0000000000..70d17eea1d --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolIndividual.java @@ -0,0 +1,577 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRuleNetworkACLRuleProtocolIndividual. + */ +public class NetworkACLRuleNetworkACLRuleProtocolIndividual extends NetworkACLRule { + + /** + * The action to perform for a packet matching the rule. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version for this rule. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + * + * The value must be the name of an individual protocol, excluding `icmp`, `tcp` and `udp`. Names for well known + * protocols are: + * - `ah`: AH (authentication header, protocol number `51`) + * - `esp`: ESP (encapsulating security payload, protocol number `50`) + * - `gre`: GRE (generic routing encapsulation, protocol number `47`) + * - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + * - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + * - `rsvp`: RSVP (reservation protocol, protocol number `46`) + * - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + * - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + * + * For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + */ + public interface Protocol { + /** ah. */ + String AH = "ah"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; + /** vrrp. */ + String VRRP = "vrrp"; + } + + + protected NetworkACLRuleNetworkACLRuleProtocolIndividual() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatch.java index 9ae8c496ba..88cea25561 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePatch.java @@ -26,6 +26,8 @@ public class NetworkACLRulePatch extends GenericModel { /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ @@ -277,6 +279,8 @@ public Builder newBuilder() { * * The action to perform for a packet matching the rule. * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. + * * @return the action */ public String action() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototype.java index b686fc85e6..f929123e46 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototype.java @@ -20,14 +20,18 @@ * NetworkACLRulePrototype. * * Classes which extend this class: - * - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype + * - NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype + * - NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype * - NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype * - NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype + * - NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype */ public class NetworkACLRulePrototype extends GenericModel { /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ @@ -58,14 +62,522 @@ public interface IpVersion { * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** ah. */ + String AH = "ah"; + /** any. */ + String ANY = "any"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; /** icmp. */ String ICMP = "icmp"; + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; /** tcp. */ String TCP = "tcp"; /** udp. */ String UDP = "udp"; + /** vrrp. */ + String VRRP = "vrrp"; } protected String action; @@ -95,6 +607,8 @@ protected NetworkACLRulePrototype() { } * * The action to perform for a packet matching the rule. * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. + * * @return the action */ public String action() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContext.java index 13962503b1..96aca3c605 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContext.java @@ -20,14 +20,18 @@ * NetworkACLRulePrototypeNetworkACLContext. * * Classes which extend this class: - * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype + * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype + * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype + * - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype */ public class NetworkACLRulePrototypeNetworkACLContext extends GenericModel { /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ @@ -58,14 +62,522 @@ public interface IpVersion { * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** ah. */ + String AH = "ah"; + /** any. */ + String ANY = "any"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; /** icmp. */ String ICMP = "icmp"; + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; /** tcp. */ String TCP = "tcp"; /** udp. */ String UDP = "udp"; + /** vrrp. */ + String VRRP = "vrrp"; } protected String action; @@ -94,6 +606,8 @@ protected NetworkACLRulePrototypeNetworkACLContext() { } * * The action to perform for a packet matching the rule. * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. + * * @return the action */ public String action() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.java similarity index 82% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.java index 09ebb769f3..63b5c7a5bd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.java @@ -14,12 +14,14 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * A rule for ICMP, TCP and UDP traffic. + * NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype. */ -public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype extends NetworkACLRulePrototypeNetworkACLContext { +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype extends NetworkACLRulePrototypeNetworkACLContext { /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ @@ -50,8 +52,8 @@ public interface IpVersion { * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** any. */ + String ANY = "any"; } @@ -68,18 +70,18 @@ public static class Builder { private String protocol; /** - * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype instance. + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype instance. * - * @param networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype the instance to initialize the Builder with + * @param networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype the instance to initialize the Builder with */ - public Builder(NetworkACLRulePrototypeNetworkACLContext networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype) { - this.action = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.action; - this.destination = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.destination; - this.direction = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.direction; - this.ipVersion = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.ipVersion; - this.name = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.name; - this.source = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.source; - this.protocol = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototype.protocol; + public Builder(NetworkACLRulePrototypeNetworkACLContext networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype) { + this.action = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype.action; + this.destination = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype.direction; + this.ipVersion = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype.ipVersion; + this.name = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype.name; + this.source = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype.source; + this.protocol = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototype.protocol; } /** @@ -106,19 +108,19 @@ public Builder(String action, String destination, String direction, String sourc } /** - * Builds a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype. + * Builds a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype. * - * @return the new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype instance + * @return the new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype instance */ - public NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype build() { - return new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(this); + public NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype build() { + return new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype(this); } /** * Set the action. * * @param action the action - * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype builder */ public Builder action(String action) { this.action = action; @@ -129,7 +131,7 @@ public Builder action(String action) { * Set the destination. * * @param destination the destination - * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype builder */ public Builder destination(String destination) { this.destination = destination; @@ -140,7 +142,7 @@ public Builder destination(String destination) { * Set the direction. * * @param direction the direction - * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype builder */ public Builder direction(String direction) { this.direction = direction; @@ -151,7 +153,7 @@ public Builder direction(String direction) { * Set the ipVersion. * * @param ipVersion the ipVersion - * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype builder */ public Builder ipVersion(String ipVersion) { this.ipVersion = ipVersion; @@ -162,7 +164,7 @@ public Builder ipVersion(String ipVersion) { * Set the name. * * @param name the name - * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype builder */ public Builder name(String name) { this.name = name; @@ -173,7 +175,7 @@ public Builder name(String name) { * Set the source. * * @param source the source - * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype builder */ public Builder source(String source) { this.source = source; @@ -184,7 +186,7 @@ public Builder source(String source) { * Set the protocol. * * @param protocol the protocol - * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype builder */ public Builder protocol(String protocol) { this.protocol = protocol; @@ -192,9 +194,9 @@ public Builder protocol(String protocol) { } } - protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype() { } + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype() { } - protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype(Builder builder) { + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, "action cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, @@ -217,7 +219,7 @@ protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllProto /** * New builder. * - * @return a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype builder + * @return a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.java index a19015d450..fae86d202c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype.java @@ -20,6 +20,8 @@ public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPP /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype.java new file mode 100644 index 0000000000..564cc79d32 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype.java @@ -0,0 +1,228 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype extends NetworkACLRulePrototypeNetworkACLContext { + + /** + * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version for this rule. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + */ + public interface Protocol { + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private String destination; + private String direction; + private String ipVersion; + private String name; + private String source; + private String protocol; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototypeNetworkACLContext networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype) { + this.action = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype.action; + this.destination = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype.direction; + this.ipVersion = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype.ipVersion; + this.name = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype.name; + this.source = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype.source; + this.protocol = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype build() { + return new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the ipVersion. + * + * @param ipVersion the ipVersion + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder ipVersion(String ipVersion) { + this.ipVersion = ipVersion; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + destination = builder.destination; + direction = builder.direction; + ipVersion = builder.ipVersion; + name = builder.name; + source = builder.source; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.java new file mode 100644 index 0000000000..a414c9e796 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.java @@ -0,0 +1,745 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype extends NetworkACLRulePrototypeNetworkACLContext { + + /** + * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version for this rule. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + * + * The value must be the name of an individual protocol, excluding `icmp`, `tcp` and `udp`. Names for well known + * protocols are: + * - `ah`: AH (authentication header, protocol number `51`) + * - `esp`: ESP (encapsulating security payload, protocol number `50`) + * - `gre`: GRE (generic routing encapsulation, protocol number `47`) + * - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + * - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + * - `rsvp`: RSVP (reservation protocol, protocol number `46`) + * - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + * - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + * + * For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + */ + public interface Protocol { + /** ah. */ + String AH = "ah"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; + /** vrrp. */ + String VRRP = "vrrp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private String destination; + private String direction; + private String ipVersion; + private String name; + private String source; + private String protocol; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototypeNetworkACLContext networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype) { + this.action = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype.action; + this.destination = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype.direction; + this.ipVersion = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype.ipVersion; + this.name = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype.name; + this.source = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype.source; + this.protocol = networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype build() { + return new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the ipVersion. + * + * @param ipVersion the ipVersion + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder ipVersion(String ipVersion) { + this.ipVersion = ipVersion; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + destination = builder.destination; + direction = builder.direction; + ipVersion = builder.ipVersion; + name = builder.name; + source = builder.source; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.java index f171d8422a..3dd7698d4a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype.java @@ -20,6 +20,8 @@ public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUD /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.java similarity index 83% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.java index 703376e8a0..ab2f66d1c2 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.java @@ -14,12 +14,14 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * A rule for ICMP, TCP and UDP traffic. + * NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype. */ -public class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype extends NetworkACLRulePrototype { +public class NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype extends NetworkACLRulePrototype { /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ @@ -50,8 +52,8 @@ public interface IpVersion { * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** any. */ + String ANY = "any"; } @@ -69,19 +71,19 @@ public static class Builder { private String protocol; /** - * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype instance. + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype instance. * - * @param networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype the instance to initialize the Builder with + * @param networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype the instance to initialize the Builder with */ - public Builder(NetworkACLRulePrototype networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype) { - this.action = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.action; - this.before = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.before; - this.destination = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.destination; - this.direction = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.direction; - this.ipVersion = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.ipVersion; - this.name = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.name; - this.source = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.source; - this.protocol = networkAclRulePrototypeNetworkAclRuleProtocolAllPrototype.protocol; + public Builder(NetworkACLRulePrototype networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype) { + this.action = networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype.action; + this.before = networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype.before; + this.destination = networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype.direction; + this.ipVersion = networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype.ipVersion; + this.name = networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype.name; + this.source = networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype.source; + this.protocol = networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototype.protocol; } /** @@ -108,19 +110,19 @@ public Builder(String action, String destination, String direction, String sourc } /** - * Builds a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype. + * Builds a NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype. * - * @return the new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype instance + * @return the new NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype instance */ - public NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype build() { - return new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(this); + public NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype build() { + return new NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype(this); } /** * Set the action. * * @param action the action - * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder action(String action) { this.action = action; @@ -131,7 +133,7 @@ public Builder action(String action) { * Set the before. * * @param before the before - * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder before(NetworkACLRuleBeforePrototype before) { this.before = before; @@ -142,7 +144,7 @@ public Builder before(NetworkACLRuleBeforePrototype before) { * Set the destination. * * @param destination the destination - * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder destination(String destination) { this.destination = destination; @@ -153,7 +155,7 @@ public Builder destination(String destination) { * Set the direction. * * @param direction the direction - * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder direction(String direction) { this.direction = direction; @@ -164,7 +166,7 @@ public Builder direction(String direction) { * Set the ipVersion. * * @param ipVersion the ipVersion - * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder ipVersion(String ipVersion) { this.ipVersion = ipVersion; @@ -175,7 +177,7 @@ public Builder ipVersion(String ipVersion) { * Set the name. * * @param name the name - * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder name(String name) { this.name = name; @@ -186,7 +188,7 @@ public Builder name(String name) { * Set the source. * * @param source the source - * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder source(String source) { this.source = source; @@ -197,7 +199,7 @@ public Builder source(String source) { * Set the protocol. * * @param protocol the protocol - * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder protocol(String protocol) { this.protocol = protocol; @@ -205,9 +207,9 @@ public Builder protocol(String protocol) { } } - protected NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype() { } + protected NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype() { } - protected NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(Builder builder) { + protected NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, "action cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, @@ -231,7 +233,7 @@ protected NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype(Builder buil /** * New builder. * - * @return a NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype builder + * @return a NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.java index c88c309ab6..6858a5041a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype.java @@ -20,6 +20,8 @@ public class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype extends /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype.java new file mode 100644 index 0000000000..ea90138a87 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype.java @@ -0,0 +1,242 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype extends NetworkACLRulePrototype { + + /** + * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version for this rule. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + */ + public interface Protocol { + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private NetworkACLRuleBeforePrototype before; + private String destination; + private String direction; + private String ipVersion; + private String name; + private String source; + private String protocol; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototype networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype) { + this.action = networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype.action; + this.before = networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype.before; + this.destination = networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype.direction; + this.ipVersion = networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype.ipVersion; + this.name = networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype.name; + this.source = networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype.source; + this.protocol = networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype build() { + return new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the before. + * + * @param before the before + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder before(NetworkACLRuleBeforePrototype before) { + this.before = before; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the ipVersion. + * + * @param ipVersion the ipVersion + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder ipVersion(String ipVersion) { + this.ipVersion = ipVersion; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + before = builder.before; + destination = builder.destination; + direction = builder.direction; + ipVersion = builder.ipVersion; + name = builder.name; + source = builder.source; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.java new file mode 100644 index 0000000000..804d5cad7a --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.java @@ -0,0 +1,759 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype extends NetworkACLRulePrototype { + + /** + * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. + */ + public interface Action { + /** allow. */ + String ALLOW = "allow"; + /** deny. */ + String DENY = "deny"; + } + + /** + * The direction of traffic to match. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version for this rule. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + * + * The value must be the name of an individual protocol, excluding `icmp`, `tcp` and `udp`. Names for well known + * protocols are: + * - `ah`: AH (authentication header, protocol number `51`) + * - `esp`: ESP (encapsulating security payload, protocol number `50`) + * - `gre`: GRE (generic routing encapsulation, protocol number `47`) + * - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + * - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + * - `rsvp`: RSVP (reservation protocol, protocol number `46`) + * - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + * - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + * + * For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + */ + public interface Protocol { + /** ah. */ + String AH = "ah"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; + /** vrrp. */ + String VRRP = "vrrp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String action; + private NetworkACLRuleBeforePrototype before; + private String destination; + private String direction; + private String ipVersion; + private String name; + private String source; + private String protocol; + + /** + * Instantiates a new Builder from an existing NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype instance. + * + * @param networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype the instance to initialize the Builder with + */ + public Builder(NetworkACLRulePrototype networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype) { + this.action = networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype.action; + this.before = networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype.before; + this.destination = networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype.destination; + this.direction = networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype.direction; + this.ipVersion = networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype.ipVersion; + this.name = networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype.name; + this.source = networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype.source; + this.protocol = networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param action the action + * @param destination the destination + * @param direction the direction + * @param source the source + * @param protocol the protocol + */ + public Builder(String action, String destination, String direction, String source, String protocol) { + this.action = action; + this.destination = destination; + this.direction = direction; + this.source = source; + this.protocol = protocol; + } + + /** + * Builds a NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype. + * + * @return the new NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype instance + */ + public NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype build() { + return new NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype(this); + } + + /** + * Set the action. + * + * @param action the action + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder action(String action) { + this.action = action; + return this; + } + + /** + * Set the before. + * + * @param before the before + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder before(NetworkACLRuleBeforePrototype before) { + this.before = before; + return this; + } + + /** + * Set the destination. + * + * @param destination the destination + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the ipVersion. + * + * @param ipVersion the ipVersion + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder ipVersion(String ipVersion) { + this.ipVersion = ipVersion; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the source. + * + * @param source the source + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder source(String source) { + this.source = source; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype() { } + + protected NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.action, + "action cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.destination, + "destination cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.source, + "source cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + action = builder.action; + before = builder.before; + destination = builder.destination; + direction = builder.direction; + ipVersion = builder.ipVersion; + name = builder.name; + source = builder.source; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.java index fb79a1ba3f..2ef666c69a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype.java @@ -20,6 +20,8 @@ public class NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype extend /** * The action to perform for a packet matching the rule. + * + * Must not be `deny` if `protocol` is `icmp_tcp_udp`. */ public interface Action { /** allow. */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototype.java index 7e4dc9ae94..176ea37f77 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/NetworkInterfacePrototype.java @@ -206,10 +206,11 @@ public String name() { * Gets the primaryIp. * * The primary IP address to bind to the instance network interface. This can be - * specified using an existing reserved IP, or a prototype object for a new reserved IP. + * specified using an existing reserved IP, or a prototype object for a new reserved + * IP. * - * If an existing reserved IP or a prototype object with an address is specified, it must - * be available on the instance network interface's subnet. Otherwise, an + * If an existing reserved IP or a prototype object with an address is specified, it + * must be available on the instance network interface's subnet. Otherwise, an * available address on the subnet will be automatically selected and reserved. * * @return the primaryIp diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayAdvertisedCidrOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayAdvertisedCidrOptions.java new file mode 100644 index 0000000000..fc2f473eb5 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayAdvertisedCidrOptions.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The removeVpnGatewayAdvertisedCidr options. + */ +public class RemoveVpnGatewayAdvertisedCidrOptions extends GenericModel { + + protected String vpnGatewayId; + protected String cidr; + + /** + * Builder. + */ + public static class Builder { + private String vpnGatewayId; + private String cidr; + + /** + * Instantiates a new Builder from an existing RemoveVpnGatewayAdvertisedCidrOptions instance. + * + * @param removeVpnGatewayAdvertisedCidrOptions the instance to initialize the Builder with + */ + private Builder(RemoveVpnGatewayAdvertisedCidrOptions removeVpnGatewayAdvertisedCidrOptions) { + this.vpnGatewayId = removeVpnGatewayAdvertisedCidrOptions.vpnGatewayId; + this.cidr = removeVpnGatewayAdvertisedCidrOptions.cidr; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param vpnGatewayId the vpnGatewayId + * @param cidr the cidr + */ + public Builder(String vpnGatewayId, String cidr) { + this.vpnGatewayId = vpnGatewayId; + this.cidr = cidr; + } + + /** + * Builds a RemoveVpnGatewayAdvertisedCidrOptions. + * + * @return the new RemoveVpnGatewayAdvertisedCidrOptions instance + */ + public RemoveVpnGatewayAdvertisedCidrOptions build() { + return new RemoveVpnGatewayAdvertisedCidrOptions(this); + } + + /** + * Set the vpnGatewayId. + * + * @param vpnGatewayId the vpnGatewayId + * @return the RemoveVpnGatewayAdvertisedCidrOptions builder + */ + public Builder vpnGatewayId(String vpnGatewayId) { + this.vpnGatewayId = vpnGatewayId; + return this; + } + + /** + * Set the cidr. + * + * @param cidr the cidr + * @return the RemoveVpnGatewayAdvertisedCidrOptions builder + */ + public Builder cidr(String cidr) { + this.cidr = cidr; + return this; + } + } + + protected RemoveVpnGatewayAdvertisedCidrOptions() { } + + protected RemoveVpnGatewayAdvertisedCidrOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.vpnGatewayId, + "vpnGatewayId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.cidr, + "cidr cannot be empty"); + vpnGatewayId = builder.vpnGatewayId; + cidr = builder.cidr; + } + + /** + * New builder. + * + * @return a RemoveVpnGatewayAdvertisedCidrOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the vpnGatewayId. + * + * The VPN gateway identifier. + * + * @return the vpnGatewayId + */ + public String vpnGatewayId() { + return vpnGatewayId; + } + + /** + * Gets the cidr. + * + * The IP address range in CIDR block notation. + * + * @return the cidr + */ + public String cidr() { + return cidr; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceBareMetalServerInitializationOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceBareMetalServerInitializationOptions.java index 5b8b8f2b13..b338590094 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceBareMetalServerInitializationOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ReplaceBareMetalServerInitializationOptions.java @@ -26,6 +26,7 @@ public class ReplaceBareMetalServerInitializationOptions extends GenericModel { protected String id; protected ImageIdentity image; protected List keys; + protected BareMetalServerInitializationDefaultTrustedProfilePrototype defaultTrustedProfile; protected String userData; /** @@ -35,6 +36,7 @@ public static class Builder { private String id; private ImageIdentity image; private List keys; + private BareMetalServerInitializationDefaultTrustedProfilePrototype defaultTrustedProfile; private String userData; /** @@ -46,6 +48,7 @@ private Builder(ReplaceBareMetalServerInitializationOptions replaceBareMetalServ this.id = replaceBareMetalServerInitializationOptions.id; this.image = replaceBareMetalServerInitializationOptions.image; this.keys = replaceBareMetalServerInitializationOptions.keys; + this.defaultTrustedProfile = replaceBareMetalServerInitializationOptions.defaultTrustedProfile; this.userData = replaceBareMetalServerInitializationOptions.userData; } @@ -127,6 +130,17 @@ public Builder keys(List keys) { return this; } + /** + * Set the defaultTrustedProfile. + * + * @param defaultTrustedProfile the defaultTrustedProfile + * @return the ReplaceBareMetalServerInitializationOptions builder + */ + public Builder defaultTrustedProfile(BareMetalServerInitializationDefaultTrustedProfilePrototype defaultTrustedProfile) { + this.defaultTrustedProfile = defaultTrustedProfile; + return this; + } + /** * Set the userData. * @@ -151,6 +165,7 @@ protected ReplaceBareMetalServerInitializationOptions(Builder builder) { id = builder.id; image = builder.image; keys = builder.keys; + defaultTrustedProfile = builder.defaultTrustedProfile; userData = builder.userData; } @@ -202,6 +217,19 @@ public List keys() { return keys; } + /** + * Gets the defaultTrustedProfile. + * + * The default trusted profile to be used when initializing the bare metal server. + * + * If unspecified, no default trusted profile will be made available. + * + * @return the defaultTrustedProfile + */ + public BareMetalServerInitializationDefaultTrustedProfilePrototype defaultTrustedProfile() { + return defaultTrustedProfile; + } + /** * Gets the userData. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRule.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRule.java index 839725a19e..e609b33d99 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRule.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRule.java @@ -20,9 +20,11 @@ * SecurityGroupRule. * * Classes which extend this class: - * - SecurityGroupRuleSecurityGroupRuleProtocolAll + * - SecurityGroupRuleProtocolAny + * - SecurityGroupRuleProtocolICMPTCPUDP * - SecurityGroupRuleSecurityGroupRuleProtocolICMP * - SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP + * - SecurityGroupRuleProtocolIndividual */ public class SecurityGroupRule extends GenericModel { @SuppressWarnings("unused") @@ -30,10 +32,264 @@ public class SecurityGroupRule extends GenericModel { protected static java.util.Map> discriminatorMapping; static { discriminatorMapping = new java.util.HashMap<>(); - discriminatorMapping.put("all", SecurityGroupRuleSecurityGroupRuleProtocolAll.class); + discriminatorMapping.put("ah", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("any", SecurityGroupRuleProtocolAny.class); + discriminatorMapping.put("esp", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("gre", SecurityGroupRuleProtocolIndividual.class); discriminatorMapping.put("icmp", SecurityGroupRuleSecurityGroupRuleProtocolICMP.class); + discriminatorMapping.put("icmp_tcp_udp", SecurityGroupRuleProtocolICMPTCPUDP.class); + discriminatorMapping.put("ip_in_ip", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("l2tp", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_0", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_10", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_100", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_101", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_102", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_103", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_104", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_105", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_106", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_107", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_108", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_109", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_11", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_110", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_111", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_113", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_114", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_116", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_117", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_118", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_119", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_12", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_120", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_121", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_122", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_123", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_124", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_125", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_126", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_127", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_128", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_129", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_13", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_130", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_131", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_133", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_134", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_135", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_136", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_137", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_138", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_139", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_14", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_140", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_141", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_142", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_143", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_144", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_145", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_146", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_147", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_148", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_149", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_15", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_150", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_151", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_152", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_153", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_154", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_155", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_156", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_157", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_158", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_159", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_16", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_160", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_161", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_162", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_163", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_164", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_165", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_166", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_167", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_168", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_169", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_170", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_171", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_172", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_173", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_174", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_175", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_176", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_177", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_178", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_179", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_18", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_180", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_181", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_182", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_183", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_184", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_185", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_186", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_187", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_188", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_189", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_19", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_190", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_191", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_192", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_193", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_194", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_195", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_196", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_197", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_198", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_199", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_2", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_20", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_200", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_201", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_202", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_203", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_204", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_205", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_206", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_207", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_208", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_209", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_21", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_210", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_211", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_212", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_213", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_214", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_215", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_216", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_217", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_218", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_219", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_22", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_220", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_221", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_222", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_223", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_224", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_225", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_226", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_227", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_228", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_229", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_23", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_230", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_231", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_232", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_233", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_234", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_235", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_236", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_237", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_238", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_239", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_24", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_240", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_241", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_242", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_243", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_244", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_245", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_246", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_247", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_248", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_249", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_25", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_250", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_251", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_252", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_253", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_254", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_255", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_26", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_27", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_28", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_29", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_3", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_30", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_31", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_32", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_33", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_34", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_35", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_36", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_37", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_38", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_39", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_40", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_41", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_42", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_43", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_44", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_45", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_48", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_49", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_5", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_52", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_53", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_54", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_55", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_56", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_57", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_58", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_59", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_60", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_61", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_62", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_63", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_64", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_65", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_66", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_67", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_68", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_69", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_7", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_70", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_71", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_72", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_73", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_74", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_75", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_76", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_77", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_78", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_79", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_8", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_80", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_81", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_82", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_83", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_84", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_85", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_86", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_87", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_88", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_89", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_9", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_90", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_91", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_92", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_93", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_94", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_95", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_96", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_97", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_98", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("number_99", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("rsvp", SecurityGroupRuleProtocolIndividual.class); + discriminatorMapping.put("sctp", SecurityGroupRuleProtocolIndividual.class); discriminatorMapping.put("tcp", SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.class); discriminatorMapping.put("udp", SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.class); + discriminatorMapping.put("vrrp", SecurityGroupRuleProtocolIndividual.class); } /** * The direction of traffic to allow. @@ -64,14 +320,530 @@ public interface IpVersion { * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** ah. */ + String AH = "ah"; + /** any. */ + String ANY = "any"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; /** icmp. */ String ICMP = "icmp"; + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; /** tcp. */ String TCP = "tcp"; /** udp. */ String UDP = "udp"; + /** vrrp. */ + String VRRP = "vrrp"; + } + + /** + * The resource type. + */ + public interface ResourceType { + /** security_group_rule. */ + String SECURITY_GROUP_RULE = "security_group_rule"; } protected String direction; @@ -80,8 +852,11 @@ public interface Protocol { @SerializedName("ip_version") protected String ipVersion; protected SecurityGroupRuleLocal local; + protected String name; protected String protocol; protected SecurityGroupRuleRemote remote; + @SerializedName("resource_type") + protected String resourceType; protected Long code; protected Long type; @SerializedName("port_max") @@ -152,6 +927,17 @@ public SecurityGroupRuleLocal getLocal() { return local; } + /** + * Gets the name. + * + * The name for this security group rule. The name is unique across all rules in the security group. + * + * @return the name + */ + public String getName() { + return name; + } + /** * Gets the protocol. * @@ -179,6 +965,17 @@ public SecurityGroupRuleRemote getRemote() { return remote; } + /** + * Gets the resourceType. + * + * The resource type. + * + * @return the resourceType + */ + public String getResourceType() { + return resourceType; + } + /** * Gets the code. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatch.java index 95158f4ca1..dda82e972d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatch.java @@ -51,6 +51,7 @@ public interface IpVersion { @SerializedName("ip_version") protected String ipVersion; protected SecurityGroupRuleLocalPatch local; + protected String name; @SerializedName("port_max") protected Long portMax; @SerializedName("port_min") @@ -66,6 +67,7 @@ public static class Builder { private String direction; private String ipVersion; private SecurityGroupRuleLocalPatch local; + private String name; private Long portMax; private Long portMin; private SecurityGroupRuleRemotePatch remote; @@ -81,6 +83,7 @@ private Builder(SecurityGroupRulePatch securityGroupRulePatch) { this.direction = securityGroupRulePatch.direction; this.ipVersion = securityGroupRulePatch.ipVersion; this.local = securityGroupRulePatch.local; + this.name = securityGroupRulePatch.name; this.portMax = securityGroupRulePatch.portMax; this.portMin = securityGroupRulePatch.portMin; this.remote = securityGroupRulePatch.remote; @@ -146,6 +149,17 @@ public Builder local(SecurityGroupRuleLocalPatch local) { return this; } + /** + * Set the name. + * + * @param name the name + * @return the SecurityGroupRulePatch builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + /** * Set the portMax. * @@ -198,6 +212,7 @@ protected SecurityGroupRulePatch(Builder builder) { direction = builder.direction; ipVersion = builder.ipVersion; local = builder.local; + name = builder.name; portMax = builder.portMax; portMin = builder.portMin; remote = builder.remote; @@ -268,6 +283,17 @@ public SecurityGroupRuleLocalPatch local() { return local; } + /** + * Gets the name. + * + * The name for this security group rule. The name must not be used by another rule in the security group. + * + * @return the name + */ + public String name() { + return name; + } + /** * Gets the portMax. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolAny.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolAny.java new file mode 100644 index 0000000000..b0be791bcc --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolAny.java @@ -0,0 +1,62 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * A rule allowing traffic for any protocol. + */ +public class SecurityGroupRuleProtocolAny extends SecurityGroupRule { + + /** + * The direction of traffic to allow. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version to allow. The format of `local.address`, `remote.address`, + * `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + * + * If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP + * version. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The resource type. + */ + public interface ResourceType { + /** security_group_rule. */ + String SECURITY_GROUP_RULE = "security_group_rule"; + } + + /** + * The network protocol. + */ + public interface Protocol { + /** any. */ + String ANY = "any"; + } + + + protected SecurityGroupRuleProtocolAny() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAll.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolICMPTCPUDP.java similarity index 79% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAll.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolICMPTCPUDP.java index 1609357da1..90d5625bb6 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAll.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolICMPTCPUDP.java @@ -16,7 +16,7 @@ /** * A rule allowing ICMP, TCP and UDP traffic. */ -public class SecurityGroupRuleSecurityGroupRuleProtocolAll extends SecurityGroupRule { +public class SecurityGroupRuleProtocolICMPTCPUDP extends SecurityGroupRule { /** * The direction of traffic to allow. @@ -40,15 +40,23 @@ public interface IpVersion { String IPV4 = "ipv4"; } + /** + * The resource type. + */ + public interface ResourceType { + /** security_group_rule. */ + String SECURITY_GROUP_RULE = "security_group_rule"; + } + /** * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; } - protected SecurityGroupRuleSecurityGroupRuleProtocolAll() { } + protected SecurityGroupRuleProtocolICMPTCPUDP() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolIndividual.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolIndividual.java new file mode 100644 index 0000000000..c2f3016fbc --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolIndividual.java @@ -0,0 +1,579 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * A rule allowing traffic for one protocol (other than ICMP, TCP or UDP). + */ +public class SecurityGroupRuleProtocolIndividual extends SecurityGroupRule { + + /** + * The direction of traffic to allow. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version to allow. The format of `local.address`, `remote.address`, + * `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + * + * If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP + * version. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The resource type. + */ + public interface ResourceType { + /** security_group_rule. */ + String SECURITY_GROUP_RULE = "security_group_rule"; + } + + /** + * The network protocol to allow. + * + * The value must be the name of an individual protocol, excluding `icmp`, `tcp` and `udp`. Names for well known + * protocols are: + * - `ah`: AH (authentication header, protocol number `51`) + * - `esp`: ESP (encapsulating security payload, protocol number `50`) + * - `gre`: GRE (generic routing encapsulation, protocol number `47`) + * - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + * - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + * - `rsvp`: RSVP (reservation protocol, protocol number `46`) + * - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + * - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + * + * For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + */ + public interface Protocol { + /** ah. */ + String AH = "ah"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; + /** vrrp. */ + String VRRP = "vrrp"; + } + + + protected SecurityGroupRuleProtocolIndividual() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototype.java index e3e2a80ff3..bbebeb8eaa 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototype.java @@ -20,9 +20,11 @@ * SecurityGroupRulePrototype. * * Classes which extend this class: - * - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll + * - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype + * - SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype * - SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP * - SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP + * - SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype */ public class SecurityGroupRulePrototype extends GenericModel { @@ -52,20 +54,529 @@ public interface IpVersion { * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** ah. */ + String AH = "ah"; + /** any. */ + String ANY = "any"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; /** icmp. */ String ICMP = "icmp"; + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; /** tcp. */ String TCP = "tcp"; /** udp. */ String UDP = "udp"; + /** vrrp. */ + String VRRP = "vrrp"; } protected String direction; @SerializedName("ip_version") protected String ipVersion; protected SecurityGroupRuleLocalPrototype local; + protected String name; protected String protocol; protected SecurityGroupRuleRemotePrototype remote; protected Long code; @@ -118,6 +629,18 @@ public SecurityGroupRuleLocalPrototype local() { return local; } + /** + * Gets the name. + * + * The name for this security group rule. The name must not be used by another rule in the security group. If + * unspecified, the name will be a hyphenated list of randomly-selected words. + * + * @return the name + */ + public String name() { + return name; + } + /** * Gets the protocol. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.java similarity index 79% rename from modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.java rename to modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.java index 7b6732ddce..52b4b61809 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.java @@ -14,9 +14,9 @@ package com.ibm.cloud.is.vpc.v1.model; /** - * A rule allowing ICMP, TCP and UDP traffic. + * A rule allowing traffic for any protocol. */ -public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll extends SecurityGroupRulePrototype { +public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype extends SecurityGroupRulePrototype { /** * The direction of traffic to allow. @@ -44,8 +44,8 @@ public interface IpVersion { * The network protocol. */ public interface Protocol { - /** all. */ - String ALL = "all"; + /** any. */ + String ANY = "any"; } @@ -56,20 +56,22 @@ public static class Builder { private String direction; private String ipVersion; private SecurityGroupRuleLocalPrototype local; + private String name; private SecurityGroupRuleRemotePrototype remote; private String protocol; /** - * Instantiates a new Builder from an existing SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll instance. + * Instantiates a new Builder from an existing SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype instance. * - * @param securityGroupRulePrototypeSecurityGroupRuleProtocolAll the instance to initialize the Builder with + * @param securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype the instance to initialize the Builder with */ - public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGroupRuleProtocolAll) { - this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolAll.direction; - this.ipVersion = securityGroupRulePrototypeSecurityGroupRuleProtocolAll.ipVersion; - this.local = securityGroupRulePrototypeSecurityGroupRuleProtocolAll.local; - this.remote = securityGroupRulePrototypeSecurityGroupRuleProtocolAll.remote; - this.protocol = securityGroupRulePrototypeSecurityGroupRuleProtocolAll.protocol; + public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype) { + this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.direction; + this.ipVersion = securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.ipVersion; + this.local = securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.local; + this.name = securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.name; + this.remote = securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.remote; + this.protocol = securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.protocol; } /** @@ -90,19 +92,19 @@ public Builder(String direction, String protocol) { } /** - * Builds a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll. + * Builds a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype. * - * @return the new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll instance + * @return the new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype instance */ - public SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll build() { - return new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(this); + public SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype build() { + return new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype(this); } /** * Set the direction. * * @param direction the direction - * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll builder + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype builder */ public Builder direction(String direction) { this.direction = direction; @@ -113,7 +115,7 @@ public Builder direction(String direction) { * Set the ipVersion. * * @param ipVersion the ipVersion - * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll builder + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype builder */ public Builder ipVersion(String ipVersion) { this.ipVersion = ipVersion; @@ -124,18 +126,29 @@ public Builder ipVersion(String ipVersion) { * Set the local. * * @param local the local - * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll builder + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype builder */ public Builder local(SecurityGroupRuleLocalPrototype local) { this.local = local; return this; } + /** + * Set the name. + * + * @param name the name + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + /** * Set the remote. * * @param remote the remote - * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll builder + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype builder */ public Builder remote(SecurityGroupRuleRemotePrototype remote) { this.remote = remote; @@ -146,7 +159,7 @@ public Builder remote(SecurityGroupRuleRemotePrototype remote) { * Set the protocol. * * @param protocol the protocol - * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll builder + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype builder */ public Builder protocol(String protocol) { this.protocol = protocol; @@ -154,9 +167,9 @@ public Builder protocol(String protocol) { } } - protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll() { } + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype() { } - protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(Builder builder) { + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, "direction cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, @@ -164,6 +177,7 @@ protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(Builder builder direction = builder.direction; ipVersion = builder.ipVersion; local = builder.local; + name = builder.name; remote = builder.remote; protocol = builder.protocol; } @@ -171,7 +185,7 @@ protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll(Builder builder /** * New builder. * - * @return a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll builder + * @return a SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype builder */ public Builder newBuilder() { return new Builder(this); diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.java index a64970f46c..a7a41fe4de 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP.java @@ -56,6 +56,7 @@ public static class Builder { private String direction; private String ipVersion; private SecurityGroupRuleLocalPrototype local; + private String name; private SecurityGroupRuleRemotePrototype remote; private Long code; private String protocol; @@ -70,6 +71,7 @@ public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGrou this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.direction; this.ipVersion = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.ipVersion; this.local = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.local; + this.name = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.name; this.remote = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.remote; this.code = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.code; this.protocol = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmp.protocol; @@ -135,6 +137,17 @@ public Builder local(SecurityGroupRuleLocalPrototype local) { return this; } + /** + * Set the name. + * + * @param name the name + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + /** * Set the remote. * @@ -190,6 +203,7 @@ protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP(Builder builde direction = builder.direction; ipVersion = builder.ipVersion; local = builder.local; + name = builder.name; remote = builder.remote; code = builder.code; protocol = builder.protocol; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype.java new file mode 100644 index 0000000000..623b935e65 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype.java @@ -0,0 +1,194 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * A rule allowing ICMP, TCP and UDP traffic. + */ +public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype extends SecurityGroupRulePrototype { + + /** + * The direction of traffic to allow. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version to allow. The format of `local.address`, `remote.address`, + * `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + * + * If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP + * version. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol. + */ + public interface Protocol { + /** icmp_tcp_udp. */ + String ICMP_TCP_UDP = "icmp_tcp_udp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String direction; + private String ipVersion; + private SecurityGroupRuleLocalPrototype local; + private String name; + private SecurityGroupRuleRemotePrototype remote; + private String protocol; + + /** + * Instantiates a new Builder from an existing SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype instance. + * + * @param securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype the instance to initialize the Builder with + */ + public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype) { + this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.direction; + this.ipVersion = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.ipVersion; + this.local = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.local; + this.name = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.name; + this.remote = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.remote; + this.protocol = securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param direction the direction + * @param protocol the protocol + */ + public Builder(String direction, String protocol) { + this.direction = direction; + this.protocol = protocol; + } + + /** + * Builds a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype. + * + * @return the new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype instance + */ + public SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype build() { + return new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype(this); + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the ipVersion. + * + * @param ipVersion the ipVersion + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder ipVersion(String ipVersion) { + this.ipVersion = ipVersion; + return this; + } + + /** + * Set the local. + * + * @param local the local + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder local(SecurityGroupRuleLocalPrototype local) { + this.local = local; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the remote. + * + * @param remote the remote + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder remote(SecurityGroupRuleRemotePrototype remote) { + this.remote = remote; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype() { } + + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + direction = builder.direction; + ipVersion = builder.ipVersion; + local = builder.local; + name = builder.name; + remote = builder.remote; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.java new file mode 100644 index 0000000000..42350bb615 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.java @@ -0,0 +1,711 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype. + */ +public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype extends SecurityGroupRulePrototype { + + /** + * The direction of traffic to allow. + */ + public interface Direction { + /** inbound. */ + String INBOUND = "inbound"; + /** outbound. */ + String OUTBOUND = "outbound"; + } + + /** + * The IP version to allow. The format of `local.address`, `remote.address`, + * `local.cidr_block` or `remote.cidr_block` must match this property, if they are used. + * + * If `remote` references a security group, then this rule only applies to IP addresses in that group matching this IP + * version. + */ + public interface IpVersion { + /** ipv4. */ + String IPV4 = "ipv4"; + } + + /** + * The network protocol to allow. + * + * The value must be the name of an individual protocol, excluding `icmp`, `tcp` and `udp`. Names for well known + * protocols are: + * - `ah`: AH (authentication header, protocol number `51`) + * - `esp`: ESP (encapsulating security payload, protocol number `50`) + * - `gre`: GRE (generic routing encapsulation, protocol number `47`) + * - `ip_in_ip`: IP encapsulation within IP (protocol number `4`) + * - `l2tp`: L2TP (layer two tunneling protocol, protocol number `115`) + * - `rsvp`: RSVP (reservation protocol, protocol number `46`) + * - `sctp`: SCTP (stream control transmission protocol, protocol number `132`) + * - `vrrp`: VRRP (virtual router redundancy protocol, protocol number `112`) + * + * For other protocols, specify a value of `number_`*N*, where *N* is the network protocol number in decimal. + */ + public interface Protocol { + /** ah. */ + String AH = "ah"; + /** esp. */ + String ESP = "esp"; + /** gre. */ + String GRE = "gre"; + /** ip_in_ip. */ + String IP_IN_IP = "ip_in_ip"; + /** l2tp. */ + String L2TP = "l2tp"; + /** number_0. */ + String NUMBER_0 = "number_0"; + /** number_10. */ + String NUMBER_10 = "number_10"; + /** number_100. */ + String NUMBER_100 = "number_100"; + /** number_101. */ + String NUMBER_101 = "number_101"; + /** number_102. */ + String NUMBER_102 = "number_102"; + /** number_103. */ + String NUMBER_103 = "number_103"; + /** number_104. */ + String NUMBER_104 = "number_104"; + /** number_105. */ + String NUMBER_105 = "number_105"; + /** number_106. */ + String NUMBER_106 = "number_106"; + /** number_107. */ + String NUMBER_107 = "number_107"; + /** number_108. */ + String NUMBER_108 = "number_108"; + /** number_109. */ + String NUMBER_109 = "number_109"; + /** number_11. */ + String NUMBER_11 = "number_11"; + /** number_110. */ + String NUMBER_110 = "number_110"; + /** number_111. */ + String NUMBER_111 = "number_111"; + /** number_113. */ + String NUMBER_113 = "number_113"; + /** number_114. */ + String NUMBER_114 = "number_114"; + /** number_116. */ + String NUMBER_116 = "number_116"; + /** number_117. */ + String NUMBER_117 = "number_117"; + /** number_118. */ + String NUMBER_118 = "number_118"; + /** number_119. */ + String NUMBER_119 = "number_119"; + /** number_12. */ + String NUMBER_12 = "number_12"; + /** number_120. */ + String NUMBER_120 = "number_120"; + /** number_121. */ + String NUMBER_121 = "number_121"; + /** number_122. */ + String NUMBER_122 = "number_122"; + /** number_123. */ + String NUMBER_123 = "number_123"; + /** number_124. */ + String NUMBER_124 = "number_124"; + /** number_125. */ + String NUMBER_125 = "number_125"; + /** number_126. */ + String NUMBER_126 = "number_126"; + /** number_127. */ + String NUMBER_127 = "number_127"; + /** number_128. */ + String NUMBER_128 = "number_128"; + /** number_129. */ + String NUMBER_129 = "number_129"; + /** number_13. */ + String NUMBER_13 = "number_13"; + /** number_130. */ + String NUMBER_130 = "number_130"; + /** number_131. */ + String NUMBER_131 = "number_131"; + /** number_133. */ + String NUMBER_133 = "number_133"; + /** number_134. */ + String NUMBER_134 = "number_134"; + /** number_135. */ + String NUMBER_135 = "number_135"; + /** number_136. */ + String NUMBER_136 = "number_136"; + /** number_137. */ + String NUMBER_137 = "number_137"; + /** number_138. */ + String NUMBER_138 = "number_138"; + /** number_139. */ + String NUMBER_139 = "number_139"; + /** number_14. */ + String NUMBER_14 = "number_14"; + /** number_140. */ + String NUMBER_140 = "number_140"; + /** number_141. */ + String NUMBER_141 = "number_141"; + /** number_142. */ + String NUMBER_142 = "number_142"; + /** number_143. */ + String NUMBER_143 = "number_143"; + /** number_144. */ + String NUMBER_144 = "number_144"; + /** number_145. */ + String NUMBER_145 = "number_145"; + /** number_146. */ + String NUMBER_146 = "number_146"; + /** number_147. */ + String NUMBER_147 = "number_147"; + /** number_148. */ + String NUMBER_148 = "number_148"; + /** number_149. */ + String NUMBER_149 = "number_149"; + /** number_15. */ + String NUMBER_15 = "number_15"; + /** number_150. */ + String NUMBER_150 = "number_150"; + /** number_151. */ + String NUMBER_151 = "number_151"; + /** number_152. */ + String NUMBER_152 = "number_152"; + /** number_153. */ + String NUMBER_153 = "number_153"; + /** number_154. */ + String NUMBER_154 = "number_154"; + /** number_155. */ + String NUMBER_155 = "number_155"; + /** number_156. */ + String NUMBER_156 = "number_156"; + /** number_157. */ + String NUMBER_157 = "number_157"; + /** number_158. */ + String NUMBER_158 = "number_158"; + /** number_159. */ + String NUMBER_159 = "number_159"; + /** number_16. */ + String NUMBER_16 = "number_16"; + /** number_160. */ + String NUMBER_160 = "number_160"; + /** number_161. */ + String NUMBER_161 = "number_161"; + /** number_162. */ + String NUMBER_162 = "number_162"; + /** number_163. */ + String NUMBER_163 = "number_163"; + /** number_164. */ + String NUMBER_164 = "number_164"; + /** number_165. */ + String NUMBER_165 = "number_165"; + /** number_166. */ + String NUMBER_166 = "number_166"; + /** number_167. */ + String NUMBER_167 = "number_167"; + /** number_168. */ + String NUMBER_168 = "number_168"; + /** number_169. */ + String NUMBER_169 = "number_169"; + /** number_170. */ + String NUMBER_170 = "number_170"; + /** number_171. */ + String NUMBER_171 = "number_171"; + /** number_172. */ + String NUMBER_172 = "number_172"; + /** number_173. */ + String NUMBER_173 = "number_173"; + /** number_174. */ + String NUMBER_174 = "number_174"; + /** number_175. */ + String NUMBER_175 = "number_175"; + /** number_176. */ + String NUMBER_176 = "number_176"; + /** number_177. */ + String NUMBER_177 = "number_177"; + /** number_178. */ + String NUMBER_178 = "number_178"; + /** number_179. */ + String NUMBER_179 = "number_179"; + /** number_18. */ + String NUMBER_18 = "number_18"; + /** number_180. */ + String NUMBER_180 = "number_180"; + /** number_181. */ + String NUMBER_181 = "number_181"; + /** number_182. */ + String NUMBER_182 = "number_182"; + /** number_183. */ + String NUMBER_183 = "number_183"; + /** number_184. */ + String NUMBER_184 = "number_184"; + /** number_185. */ + String NUMBER_185 = "number_185"; + /** number_186. */ + String NUMBER_186 = "number_186"; + /** number_187. */ + String NUMBER_187 = "number_187"; + /** number_188. */ + String NUMBER_188 = "number_188"; + /** number_189. */ + String NUMBER_189 = "number_189"; + /** number_19. */ + String NUMBER_19 = "number_19"; + /** number_190. */ + String NUMBER_190 = "number_190"; + /** number_191. */ + String NUMBER_191 = "number_191"; + /** number_192. */ + String NUMBER_192 = "number_192"; + /** number_193. */ + String NUMBER_193 = "number_193"; + /** number_194. */ + String NUMBER_194 = "number_194"; + /** number_195. */ + String NUMBER_195 = "number_195"; + /** number_196. */ + String NUMBER_196 = "number_196"; + /** number_197. */ + String NUMBER_197 = "number_197"; + /** number_198. */ + String NUMBER_198 = "number_198"; + /** number_199. */ + String NUMBER_199 = "number_199"; + /** number_2. */ + String NUMBER_2 = "number_2"; + /** number_20. */ + String NUMBER_20 = "number_20"; + /** number_200. */ + String NUMBER_200 = "number_200"; + /** number_201. */ + String NUMBER_201 = "number_201"; + /** number_202. */ + String NUMBER_202 = "number_202"; + /** number_203. */ + String NUMBER_203 = "number_203"; + /** number_204. */ + String NUMBER_204 = "number_204"; + /** number_205. */ + String NUMBER_205 = "number_205"; + /** number_206. */ + String NUMBER_206 = "number_206"; + /** number_207. */ + String NUMBER_207 = "number_207"; + /** number_208. */ + String NUMBER_208 = "number_208"; + /** number_209. */ + String NUMBER_209 = "number_209"; + /** number_21. */ + String NUMBER_21 = "number_21"; + /** number_210. */ + String NUMBER_210 = "number_210"; + /** number_211. */ + String NUMBER_211 = "number_211"; + /** number_212. */ + String NUMBER_212 = "number_212"; + /** number_213. */ + String NUMBER_213 = "number_213"; + /** number_214. */ + String NUMBER_214 = "number_214"; + /** number_215. */ + String NUMBER_215 = "number_215"; + /** number_216. */ + String NUMBER_216 = "number_216"; + /** number_217. */ + String NUMBER_217 = "number_217"; + /** number_218. */ + String NUMBER_218 = "number_218"; + /** number_219. */ + String NUMBER_219 = "number_219"; + /** number_22. */ + String NUMBER_22 = "number_22"; + /** number_220. */ + String NUMBER_220 = "number_220"; + /** number_221. */ + String NUMBER_221 = "number_221"; + /** number_222. */ + String NUMBER_222 = "number_222"; + /** number_223. */ + String NUMBER_223 = "number_223"; + /** number_224. */ + String NUMBER_224 = "number_224"; + /** number_225. */ + String NUMBER_225 = "number_225"; + /** number_226. */ + String NUMBER_226 = "number_226"; + /** number_227. */ + String NUMBER_227 = "number_227"; + /** number_228. */ + String NUMBER_228 = "number_228"; + /** number_229. */ + String NUMBER_229 = "number_229"; + /** number_23. */ + String NUMBER_23 = "number_23"; + /** number_230. */ + String NUMBER_230 = "number_230"; + /** number_231. */ + String NUMBER_231 = "number_231"; + /** number_232. */ + String NUMBER_232 = "number_232"; + /** number_233. */ + String NUMBER_233 = "number_233"; + /** number_234. */ + String NUMBER_234 = "number_234"; + /** number_235. */ + String NUMBER_235 = "number_235"; + /** number_236. */ + String NUMBER_236 = "number_236"; + /** number_237. */ + String NUMBER_237 = "number_237"; + /** number_238. */ + String NUMBER_238 = "number_238"; + /** number_239. */ + String NUMBER_239 = "number_239"; + /** number_24. */ + String NUMBER_24 = "number_24"; + /** number_240. */ + String NUMBER_240 = "number_240"; + /** number_241. */ + String NUMBER_241 = "number_241"; + /** number_242. */ + String NUMBER_242 = "number_242"; + /** number_243. */ + String NUMBER_243 = "number_243"; + /** number_244. */ + String NUMBER_244 = "number_244"; + /** number_245. */ + String NUMBER_245 = "number_245"; + /** number_246. */ + String NUMBER_246 = "number_246"; + /** number_247. */ + String NUMBER_247 = "number_247"; + /** number_248. */ + String NUMBER_248 = "number_248"; + /** number_249. */ + String NUMBER_249 = "number_249"; + /** number_25. */ + String NUMBER_25 = "number_25"; + /** number_250. */ + String NUMBER_250 = "number_250"; + /** number_251. */ + String NUMBER_251 = "number_251"; + /** number_252. */ + String NUMBER_252 = "number_252"; + /** number_253. */ + String NUMBER_253 = "number_253"; + /** number_254. */ + String NUMBER_254 = "number_254"; + /** number_255. */ + String NUMBER_255 = "number_255"; + /** number_26. */ + String NUMBER_26 = "number_26"; + /** number_27. */ + String NUMBER_27 = "number_27"; + /** number_28. */ + String NUMBER_28 = "number_28"; + /** number_29. */ + String NUMBER_29 = "number_29"; + /** number_3. */ + String NUMBER_3 = "number_3"; + /** number_30. */ + String NUMBER_30 = "number_30"; + /** number_31. */ + String NUMBER_31 = "number_31"; + /** number_32. */ + String NUMBER_32 = "number_32"; + /** number_33. */ + String NUMBER_33 = "number_33"; + /** number_34. */ + String NUMBER_34 = "number_34"; + /** number_35. */ + String NUMBER_35 = "number_35"; + /** number_36. */ + String NUMBER_36 = "number_36"; + /** number_37. */ + String NUMBER_37 = "number_37"; + /** number_38. */ + String NUMBER_38 = "number_38"; + /** number_39. */ + String NUMBER_39 = "number_39"; + /** number_40. */ + String NUMBER_40 = "number_40"; + /** number_41. */ + String NUMBER_41 = "number_41"; + /** number_42. */ + String NUMBER_42 = "number_42"; + /** number_43. */ + String NUMBER_43 = "number_43"; + /** number_44. */ + String NUMBER_44 = "number_44"; + /** number_45. */ + String NUMBER_45 = "number_45"; + /** number_48. */ + String NUMBER_48 = "number_48"; + /** number_49. */ + String NUMBER_49 = "number_49"; + /** number_5. */ + String NUMBER_5 = "number_5"; + /** number_52. */ + String NUMBER_52 = "number_52"; + /** number_53. */ + String NUMBER_53 = "number_53"; + /** number_54. */ + String NUMBER_54 = "number_54"; + /** number_55. */ + String NUMBER_55 = "number_55"; + /** number_56. */ + String NUMBER_56 = "number_56"; + /** number_57. */ + String NUMBER_57 = "number_57"; + /** number_58. */ + String NUMBER_58 = "number_58"; + /** number_59. */ + String NUMBER_59 = "number_59"; + /** number_60. */ + String NUMBER_60 = "number_60"; + /** number_61. */ + String NUMBER_61 = "number_61"; + /** number_62. */ + String NUMBER_62 = "number_62"; + /** number_63. */ + String NUMBER_63 = "number_63"; + /** number_64. */ + String NUMBER_64 = "number_64"; + /** number_65. */ + String NUMBER_65 = "number_65"; + /** number_66. */ + String NUMBER_66 = "number_66"; + /** number_67. */ + String NUMBER_67 = "number_67"; + /** number_68. */ + String NUMBER_68 = "number_68"; + /** number_69. */ + String NUMBER_69 = "number_69"; + /** number_7. */ + String NUMBER_7 = "number_7"; + /** number_70. */ + String NUMBER_70 = "number_70"; + /** number_71. */ + String NUMBER_71 = "number_71"; + /** number_72. */ + String NUMBER_72 = "number_72"; + /** number_73. */ + String NUMBER_73 = "number_73"; + /** number_74. */ + String NUMBER_74 = "number_74"; + /** number_75. */ + String NUMBER_75 = "number_75"; + /** number_76. */ + String NUMBER_76 = "number_76"; + /** number_77. */ + String NUMBER_77 = "number_77"; + /** number_78. */ + String NUMBER_78 = "number_78"; + /** number_79. */ + String NUMBER_79 = "number_79"; + /** number_8. */ + String NUMBER_8 = "number_8"; + /** number_80. */ + String NUMBER_80 = "number_80"; + /** number_81. */ + String NUMBER_81 = "number_81"; + /** number_82. */ + String NUMBER_82 = "number_82"; + /** number_83. */ + String NUMBER_83 = "number_83"; + /** number_84. */ + String NUMBER_84 = "number_84"; + /** number_85. */ + String NUMBER_85 = "number_85"; + /** number_86. */ + String NUMBER_86 = "number_86"; + /** number_87. */ + String NUMBER_87 = "number_87"; + /** number_88. */ + String NUMBER_88 = "number_88"; + /** number_89. */ + String NUMBER_89 = "number_89"; + /** number_9. */ + String NUMBER_9 = "number_9"; + /** number_90. */ + String NUMBER_90 = "number_90"; + /** number_91. */ + String NUMBER_91 = "number_91"; + /** number_92. */ + String NUMBER_92 = "number_92"; + /** number_93. */ + String NUMBER_93 = "number_93"; + /** number_94. */ + String NUMBER_94 = "number_94"; + /** number_95. */ + String NUMBER_95 = "number_95"; + /** number_96. */ + String NUMBER_96 = "number_96"; + /** number_97. */ + String NUMBER_97 = "number_97"; + /** number_98. */ + String NUMBER_98 = "number_98"; + /** number_99. */ + String NUMBER_99 = "number_99"; + /** rsvp. */ + String RSVP = "rsvp"; + /** sctp. */ + String SCTP = "sctp"; + /** vrrp. */ + String VRRP = "vrrp"; + } + + + /** + * Builder. + */ + public static class Builder { + private String direction; + private String ipVersion; + private SecurityGroupRuleLocalPrototype local; + private String name; + private SecurityGroupRuleRemotePrototype remote; + private String protocol; + + /** + * Instantiates a new Builder from an existing SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype instance. + * + * @param securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype the instance to initialize the Builder with + */ + public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype) { + this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.direction; + this.ipVersion = securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.ipVersion; + this.local = securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.local; + this.name = securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.name; + this.remote = securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.remote; + this.protocol = securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.protocol; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param direction the direction + * @param protocol the protocol + */ + public Builder(String direction, String protocol) { + this.direction = direction; + this.protocol = protocol; + } + + /** + * Builds a SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype. + * + * @return the new SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype instance + */ + public SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype build() { + return new SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype(this); + } + + /** + * Set the direction. + * + * @param direction the direction + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype builder + */ + public Builder direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Set the ipVersion. + * + * @param ipVersion the ipVersion + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype builder + */ + public Builder ipVersion(String ipVersion) { + this.ipVersion = ipVersion; + return this; + } + + /** + * Set the local. + * + * @param local the local + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype builder + */ + public Builder local(SecurityGroupRuleLocalPrototype local) { + this.local = local; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the remote. + * + * @param remote the remote + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype builder + */ + public Builder remote(SecurityGroupRuleRemotePrototype remote) { + this.remote = remote; + return this; + } + + /** + * Set the protocol. + * + * @param protocol the protocol + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype builder + */ + public Builder protocol(String protocol) { + this.protocol = protocol; + return this; + } + } + + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype() { } + + protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.direction, + "direction cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.protocol, + "protocol cannot be null"); + direction = builder.direction; + ipVersion = builder.ipVersion; + local = builder.local; + name = builder.name; + remote = builder.remote; + protocol = builder.protocol; + } + + /** + * New builder. + * + * @return a SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.java index 1feeb151cc..9fc15bdd3f 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP.java @@ -58,6 +58,7 @@ public static class Builder { private String direction; private String ipVersion; private SecurityGroupRuleLocalPrototype local; + private String name; private SecurityGroupRuleRemotePrototype remote; private Long portMax; private Long portMin; @@ -72,6 +73,7 @@ public Builder(SecurityGroupRulePrototype securityGroupRulePrototypeSecurityGrou this.direction = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.direction; this.ipVersion = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.ipVersion; this.local = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.local; + this.name = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.name; this.remote = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.remote; this.portMax = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.portMax; this.portMin = securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudp.portMin; @@ -137,6 +139,17 @@ public Builder local(SecurityGroupRuleLocalPrototype local) { return this; } + /** + * Set the name. + * + * @param name the name + * @return the SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + /** * Set the remote. * @@ -192,6 +205,7 @@ protected SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP(Builder buil direction = builder.direction; ipVersion = builder.ipVersion; local = builder.local; + name = builder.name; remote = builder.remote; portMax = builder.portMax; portMin = builder.portMin; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMP.java index de1d3b94ff..6dae0d6c4a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMP.java @@ -40,6 +40,14 @@ public interface IpVersion { String IPV4 = "ipv4"; } + /** + * The resource type. + */ + public interface ResourceType { + /** security_group_rule. */ + String SECURITY_GROUP_RULE = "security_group_rule"; + } + /** * The network protocol. */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.java index 2356be5704..d4e3b28349 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP.java @@ -43,6 +43,14 @@ public interface IpVersion { String IPV4 = "ipv4"; } + /** + * The resource type. + */ + public interface ResourceType { + /** security_group_rule. */ + String SECURITY_GROUP_RULE = "security_group_rule"; + } + /** * The network protocol. */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Share.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Share.java index 0b02b24183..6ed48d93e5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Share.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Share.java @@ -58,11 +58,36 @@ public interface AccessorBindingRole { String ORIGIN = "origin"; } + public interface AllowedAccessProtocols { + /** nfs4. */ + String NFS4 = "nfs4"; + } + public interface AllowedTransitEncryptionModes { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; + } + + /** + * The data availability mode of the share: + * - `zonal`: The share's data will be available provided the `zone` of the share is + * available. Additionally, disasters affecting the zone may lead to data loss. + * - `regional`: The share's data will be available provided at least one zone in the + * region is available. Additionally, disasters affecting the entire region may lead + * to data loss. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface AvailabilityMode { + /** regional. */ + String REGIONAL = "regional"; + /** zonal. */ + String ZONAL = "zonal"; } /** @@ -156,8 +181,13 @@ public interface ResourceType { protected String accessorBindingRole; @SerializedName("accessor_bindings") protected List accessorBindings; + @SerializedName("allowed_access_protocols") + protected List allowedAccessProtocols; @SerializedName("allowed_transit_encryption_modes") protected List allowedTransitEncryptionModes; + @SerializedName("availability_mode") + protected String availabilityMode; + protected Long bandwidth; @SerializedName("created_at") protected Date createdAt; protected String crn; @@ -206,6 +236,8 @@ public interface ResourceType { protected ShareReference sourceShare; @SerializedName("source_snapshot") protected ShareSourceSnapshot sourceSnapshot; + @SerializedName("storage_generation") + protected Long storageGeneration; @SerializedName("user_tags") protected List userTags; protected ZoneReference zone; @@ -258,12 +290,29 @@ public List getAccessorBindings() { return accessorBindings; } + /** + * Gets the allowedAccessProtocols. + * + * The access protocols to allow for this share: + * - `nfs4`: NFSv4 is used to access this share via its associated share mount target. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the allowedAccessProtocols + */ + public List getAllowedAccessProtocols() { + return allowedAccessProtocols; + } + /** * Gets the allowedTransitEncryptionModes. * * The transit encryption modes allowed for this share: * - `none`: Not encrypted in transit. - * - `user_managed`: Encrypted in transit using an instance identity certificate. + * - `ipsec`: Encrypted in transit using an instance identity certificate. + * - `stunnel`: Encrypted in transit using a connection via the installed stunnel + * client. * * The enumerated values for this property may * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. @@ -274,6 +323,36 @@ public List getAllowedTransitEncryptionModes() { return allowedTransitEncryptionModes; } + /** + * Gets the availabilityMode. + * + * The data availability mode of the share: + * - `zonal`: The share's data will be available provided the `zone` of the share is + * available. Additionally, disasters affecting the zone may lead to data loss. + * - `regional`: The share's data will be available provided at least one zone in the + * region is available. Additionally, disasters affecting the entire region may lead + * to data loss. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the availabilityMode + */ + public String getAvailabilityMode() { + return availabilityMode; + } + + /** + * Gets the bandwidth. + * + * The maximum bandwidth (in megabits per second) for the share. + * + * @return the bandwidth + */ + public Long getBandwidth() { + return bandwidth; + } + /** * Gets the createdAt. * @@ -356,10 +435,9 @@ public ShareInitialOwner getInitialOwner() { /** * Gets the iops. * - * The maximum input/output operations per second (IOPS) for the file share. In addition, each client accessing the - * share will be restricted to 48,000 IOPS. + * The maximum input/output operations per second (IOPS) for the file share. * - * The maximum IOPS for a share may increase in the future. + * The maximum IOPS for a share as defined by the share's profile may increase in the future. * * @return the iops */ @@ -624,6 +702,23 @@ public ShareSourceSnapshot getSourceSnapshot() { return sourceSnapshot; } + /** + * Gets the storageGeneration. + * + * The [storage + * generation](https://cloud.ibm.com/docs/vpc?topic=vpc-block-storage-profiles&interface=api#using-api-iops-profiles): + * - `1`: The first storage generation + * - `2`: The second storage generation + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the storageGeneration + */ + public Long getStorageGeneration() { + return storageGeneration; + } + /** * Gets the userTags. * @@ -640,6 +735,8 @@ public List getUserTags() { * * The zone this file share resides in. * + * This property will be absent for shares with an `availability_mode` of `regional`. + * * @return the zone */ public ZoneReference getZone() { diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTarget.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTarget.java index 5f56195468..12aa36c67e 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTarget.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTarget.java @@ -40,6 +40,18 @@ public interface AccessControlMode { String VPC = "vpc"; } + /** + * The protocol used to access the share for this share mount target: + * - `nfs4`: NFSv4 will be used. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface AccessProtocol { + /** nfs4. */ + String NFS4 = "nfs4"; + } + /** * The lifecycle state of the mount target. */ @@ -70,21 +82,27 @@ public interface ResourceType { /** * The transit encryption mode for this share mount target: - * - `none`: Not encrypted in transit - * - `user_managed`: Encrypted in transit using an instance identity certificate + * - `none`: Not encrypted in transit. + * - `ipsec`: Encrypted in transit using an instance identity certificate. + * - `stunnel`: Encrypted in transit using a connection via the installed stunnel + * client. * * The enumerated values for this property may * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. */ public interface TransitEncryption { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } @SerializedName("access_control_mode") protected String accessControlMode; + @SerializedName("access_protocol") + protected String accessProtocol; @SerializedName("created_at") protected Date createdAt; protected String href; @@ -125,6 +143,21 @@ public String getAccessControlMode() { return accessControlMode; } + /** + * Gets the accessProtocol. + * + * The protocol used to access the share for this share mount target: + * - `nfs4`: NFSv4 will be used. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the accessProtocol + */ + public String getAccessProtocol() { + return accessProtocol; + } + /** * Gets the createdAt. * @@ -243,8 +276,10 @@ public SubnetReference getSubnet() { * Gets the transitEncryption. * * The transit encryption mode for this share mount target: - * - `none`: Not encrypted in transit - * - `user_managed`: Encrypted in transit using an instance identity certificate + * - `none`: Not encrypted in transit. + * - `ipsec`: Encrypted in transit using an instance identity certificate. + * - `stunnel`: Encrypted in transit using a connection via the installed stunnel + * client. * * The enumerated values for this property may * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototype.java index 4020359ada..e46533895c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototype.java @@ -25,22 +25,39 @@ */ public class ShareMountTargetPrototype extends GenericModel { + /** + * The protocol to use to access the share for this share mount target: + * - `nfs4`: NFSv4 will be used. + * + * The specified value must be listed in the share's `allowed_access_protocols`. + */ + public interface AccessProtocol { + /** nfs4. */ + String NFS4 = "nfs4"; + } + /** * The transit encryption mode to use for this share mount target: * - `none`: Not encrypted in transit. - * - `user_managed`: Encrypted in transit using an instance identity certificate. The - * `access_control_mode` for the share must be `security_group`. + * - `ipsec`: Encrypted in transit using an instance identity certificate. The + * `access_control_mode` for the share must be `security_group`. + * - `stunnel`: Encrypted in transit using an stunnel connection. The + * `access_control_mode` for the share must be `security_group`. * * The specified value must be listed in the share's * `allowed_transit_encryption_modes`. */ public interface TransitEncryption { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } + @SerializedName("access_protocol") + protected String accessProtocol; protected String name; @SerializedName("transit_encryption") protected String transitEncryption; @@ -50,6 +67,20 @@ public interface TransitEncryption { protected ShareMountTargetPrototype() { } + /** + * Gets the accessProtocol. + * + * The protocol to use to access the share for this share mount target: + * - `nfs4`: NFSv4 will be used. + * + * The specified value must be listed in the share's `allowed_access_protocols`. + * + * @return the accessProtocol + */ + public String accessProtocol() { + return accessProtocol; + } + /** * Gets the name. * @@ -67,8 +98,10 @@ public String name() { * * The transit encryption mode to use for this share mount target: * - `none`: Not encrypted in transit. - * - `user_managed`: Encrypted in transit using an instance identity certificate. The - * `access_control_mode` for the share must be `security_group`. + * - `ipsec`: Encrypted in transit using an instance identity certificate. The + * `access_control_mode` for the share must be `security_group`. + * - `stunnel`: Encrypted in transit using an stunnel connection. The + * `access_control_mode` for the share must be `security_group`. * * The specified value must be listed in the share's * `allowed_transit_encryption_modes`. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.java index 00bbc84881..0e70dc0856 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.java @@ -29,20 +29,35 @@ */ public class ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup extends ShareMountTargetPrototype { + /** + * The protocol to use to access the share for this share mount target: + * - `nfs4`: NFSv4 will be used. + * + * The specified value must be listed in the share's `allowed_access_protocols`. + */ + public interface AccessProtocol { + /** nfs4. */ + String NFS4 = "nfs4"; + } + /** * The transit encryption mode to use for this share mount target: * - `none`: Not encrypted in transit. - * - `user_managed`: Encrypted in transit using an instance identity certificate. The - * `access_control_mode` for the share must be `security_group`. + * - `ipsec`: Encrypted in transit using an instance identity certificate. The + * `access_control_mode` for the share must be `security_group`. + * - `stunnel`: Encrypted in transit using an stunnel connection. The + * `access_control_mode` for the share must be `security_group`. * * The specified value must be listed in the share's * `allowed_transit_encryption_modes`. */ public interface TransitEncryption { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } @@ -50,6 +65,7 @@ public interface TransitEncryption { * Builder. */ public static class Builder { + private String accessProtocol; private String name; private String transitEncryption; private ShareMountTargetVirtualNetworkInterfacePrototype virtualNetworkInterface; @@ -60,6 +76,7 @@ public static class Builder { * @param shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup the instance to initialize the Builder with */ public Builder(ShareMountTargetPrototype shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup) { + this.accessProtocol = shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.accessProtocol; this.name = shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.name; this.transitEncryption = shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.transitEncryption; this.virtualNetworkInterface = shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.virtualNetworkInterface; @@ -74,9 +91,13 @@ public Builder() { /** * Instantiates a new builder with required properties. * + * @param accessProtocol the accessProtocol + * @param transitEncryption the transitEncryption * @param virtualNetworkInterface the virtualNetworkInterface */ - public Builder(ShareMountTargetVirtualNetworkInterfacePrototype virtualNetworkInterface) { + public Builder(String accessProtocol, String transitEncryption, ShareMountTargetVirtualNetworkInterfacePrototype virtualNetworkInterface) { + this.accessProtocol = accessProtocol; + this.transitEncryption = transitEncryption; this.virtualNetworkInterface = virtualNetworkInterface; } @@ -89,6 +110,17 @@ public ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup return new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(this); } + /** + * Set the accessProtocol. + * + * @param accessProtocol the accessProtocol + * @return the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup builder + */ + public Builder accessProtocol(String accessProtocol) { + this.accessProtocol = accessProtocol; + return this; + } + /** * Set the name. * @@ -126,8 +158,13 @@ public Builder virtualNetworkInterface(ShareMountTargetVirtualNetworkInterfacePr protected ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup() { } protected ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.accessProtocol, + "accessProtocol cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.transitEncryption, + "transitEncryption cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.virtualNetworkInterface, "virtualNetworkInterface cannot be null"); + accessProtocol = builder.accessProtocol; name = builder.name; transitEncryption = builder.transitEncryption; virtualNetworkInterface = builder.virtualNetworkInterface; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.java index b4bcde7b30..c7d879cae9 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.java @@ -21,20 +21,35 @@ */ public class ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC extends ShareMountTargetPrototype { + /** + * The protocol to use to access the share for this share mount target: + * - `nfs4`: NFSv4 will be used. + * + * The specified value must be listed in the share's `allowed_access_protocols`. + */ + public interface AccessProtocol { + /** nfs4. */ + String NFS4 = "nfs4"; + } + /** * The transit encryption mode to use for this share mount target: * - `none`: Not encrypted in transit. - * - `user_managed`: Encrypted in transit using an instance identity certificate. The - * `access_control_mode` for the share must be `security_group`. + * - `ipsec`: Encrypted in transit using an instance identity certificate. The + * `access_control_mode` for the share must be `security_group`. + * - `stunnel`: Encrypted in transit using an stunnel connection. The + * `access_control_mode` for the share must be `security_group`. * * The specified value must be listed in the share's * `allowed_transit_encryption_modes`. */ public interface TransitEncryption { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } @@ -42,6 +57,7 @@ public interface TransitEncryption { * Builder. */ public static class Builder { + private String accessProtocol; private String name; private String transitEncryption; private VPCIdentity vpc; @@ -52,6 +68,7 @@ public static class Builder { * @param shareMountTargetPrototypeShareMountTargetByAccessControlModeVpc the instance to initialize the Builder with */ public Builder(ShareMountTargetPrototype shareMountTargetPrototypeShareMountTargetByAccessControlModeVpc) { + this.accessProtocol = shareMountTargetPrototypeShareMountTargetByAccessControlModeVpc.accessProtocol; this.name = shareMountTargetPrototypeShareMountTargetByAccessControlModeVpc.name; this.transitEncryption = shareMountTargetPrototypeShareMountTargetByAccessControlModeVpc.transitEncryption; this.vpc = shareMountTargetPrototypeShareMountTargetByAccessControlModeVpc.vpc; @@ -66,9 +83,13 @@ public Builder() { /** * Instantiates a new builder with required properties. * + * @param accessProtocol the accessProtocol + * @param transitEncryption the transitEncryption * @param vpc the vpc */ - public Builder(VPCIdentity vpc) { + public Builder(String accessProtocol, String transitEncryption, VPCIdentity vpc) { + this.accessProtocol = accessProtocol; + this.transitEncryption = transitEncryption; this.vpc = vpc; } @@ -81,6 +102,17 @@ public ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC build() { return new ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(this); } + /** + * Set the accessProtocol. + * + * @param accessProtocol the accessProtocol + * @return the ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC builder + */ + public Builder accessProtocol(String accessProtocol) { + this.accessProtocol = accessProtocol; + return this; + } + /** * Set the name. * @@ -118,8 +150,13 @@ public Builder vpc(VPCIdentity vpc) { protected ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC() { } protected ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.accessProtocol, + "accessProtocol cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.transitEncryption, + "transitEncryption cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.vpc, "vpc cannot be null"); + accessProtocol = builder.accessProtocol; name = builder.name; transitEncryption = builder.transitEncryption; vpc = builder.vpc; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePatch.java index 077efc4111..ec21c36663 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePatch.java @@ -43,17 +43,27 @@ public interface AccessControlMode { String VPC = "vpc"; } + public interface AllowedAccessProtocols { + /** nfs4. */ + String NFS4 = "nfs4"; + } + public interface AllowedTransitEncryptionModes { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } @SerializedName("access_control_mode") protected String accessControlMode; + @SerializedName("allowed_access_protocols") + protected List allowedAccessProtocols; @SerializedName("allowed_transit_encryption_modes") protected List allowedTransitEncryptionModes; + protected Long bandwidth; protected Long iops; protected String name; protected ShareProfileIdentity profile; @@ -68,7 +78,9 @@ public interface AllowedTransitEncryptionModes { */ public static class Builder { private String accessControlMode; + private List allowedAccessProtocols; private List allowedTransitEncryptionModes; + private Long bandwidth; private Long iops; private String name; private ShareProfileIdentity profile; @@ -83,7 +95,9 @@ public static class Builder { */ private Builder(SharePatch sharePatch) { this.accessControlMode = sharePatch.accessControlMode; + this.allowedAccessProtocols = sharePatch.allowedAccessProtocols; this.allowedTransitEncryptionModes = sharePatch.allowedTransitEncryptionModes; + this.bandwidth = sharePatch.bandwidth; this.iops = sharePatch.iops; this.name = sharePatch.name; this.profile = sharePatch.profile; @@ -107,6 +121,22 @@ public SharePatch build() { return new SharePatch(this); } + /** + * Adds a new element to allowedAccessProtocols. + * + * @param allowedAccessProtocols the new element to be added + * @return the SharePatch builder + */ + public Builder addAllowedAccessProtocols(String allowedAccessProtocols) { + com.ibm.cloud.sdk.core.util.Validator.notNull(allowedAccessProtocols, + "allowedAccessProtocols cannot be null"); + if (this.allowedAccessProtocols == null) { + this.allowedAccessProtocols = new ArrayList(); + } + this.allowedAccessProtocols.add(allowedAccessProtocols); + return this; + } + /** * Adds a new element to allowedTransitEncryptionModes. * @@ -150,6 +180,18 @@ public Builder accessControlMode(String accessControlMode) { return this; } + /** + * Set the allowedAccessProtocols. + * Existing allowedAccessProtocols will be replaced. + * + * @param allowedAccessProtocols the allowedAccessProtocols + * @return the SharePatch builder + */ + public Builder allowedAccessProtocols(List allowedAccessProtocols) { + this.allowedAccessProtocols = allowedAccessProtocols; + return this; + } + /** * Set the allowedTransitEncryptionModes. * Existing allowedTransitEncryptionModes will be replaced. @@ -162,6 +204,17 @@ public Builder allowedTransitEncryptionModes(List allowedTransitEncrypti return this; } + /** + * Set the bandwidth. + * + * @param bandwidth the bandwidth + * @return the SharePatch builder + */ + public Builder bandwidth(long bandwidth) { + this.bandwidth = bandwidth; + return this; + } + /** * Set the iops. * @@ -234,7 +287,9 @@ protected SharePatch() { } protected SharePatch(Builder builder) { accessControlMode = builder.accessControlMode; + allowedAccessProtocols = builder.allowedAccessProtocols; allowedTransitEncryptionModes = builder.allowedTransitEncryptionModes; + bandwidth = builder.bandwidth; iops = builder.iops; name = builder.name; profile = builder.profile; @@ -270,6 +325,22 @@ public String accessControlMode() { return accessControlMode; } + /** + * Gets the allowedAccessProtocols. + * + * The access protocols to allow for this share (replacing any existing access protocols). + * + * If the share has existing mount targets, the set of allowed access protocols must contain all `access_protocol` + * modes specified by existing mount targets. + * + * For this property to be updated, the `accessor_binding_role` must be `none`. + * + * @return the allowedAccessProtocols + */ + public List allowedAccessProtocols() { + return allowedAccessProtocols; + } + /** * Gets the allowedTransitEncryptionModes. * @@ -285,6 +356,21 @@ public List allowedTransitEncryptionModes() { return allowedTransitEncryptionModes; } + /** + * Gets the bandwidth. + * + * The maximum bandwidth (in megabits per second) for the share. + * + * For this property to be changed, the share `accessor_binding_role` must not be + * `accessor`, the share profile must not have a `bandwidth.type` of `dependent` or + * `fixed`, and the specified value must be within the `bandwidth` range of the share's profile. + * + * @return the bandwidth + */ + public Long bandwidth() { + return bandwidth; + } + /** * Gets the iops. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfile.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfile.java index d6a6097016..df562100c7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfile.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfile.java @@ -40,6 +40,13 @@ public interface ResourceType { String SHARE_PROFILE = "share_profile"; } + @SerializedName("allowed_access_protocols") + protected ShareProfileAllowedAccessProtocols allowedAccessProtocols; + @SerializedName("allowed_transit_encryption_modes") + protected ShareProfileAllowedTransitEncryptionModes allowedTransitEncryptionModes; + @SerializedName("availability_modes") + protected ShareProfileAvailabilityModes availabilityModes; + protected ShareProfileBandwidth bandwidth; protected ShareProfileCapacity capacity; protected String family; protected String href; @@ -47,9 +54,55 @@ public interface ResourceType { protected String name; @SerializedName("resource_type") protected String resourceType; + @SerializedName("storage_generation") + protected ShareProfileStorageGeneration storageGeneration; protected ShareProfile() { } + /** + * Gets the allowedAccessProtocols. + * + * The possible allowed access protocols for a share with this profile. + * + * @return the allowedAccessProtocols + */ + public ShareProfileAllowedAccessProtocols getAllowedAccessProtocols() { + return allowedAccessProtocols; + } + + /** + * Gets the allowedTransitEncryptionModes. + * + * The possible allowed transit encryption modes for a share with this profile. + * + * @return the allowedTransitEncryptionModes + */ + public ShareProfileAllowedTransitEncryptionModes getAllowedTransitEncryptionModes() { + return allowedTransitEncryptionModes; + } + + /** + * Gets the availabilityModes. + * + * The data availability mode of a share with this profile. + * + * @return the availabilityModes + */ + public ShareProfileAvailabilityModes getAvailabilityModes() { + return availabilityModes; + } + + /** + * Gets the bandwidth. + * + * The permitted bandwidth (in megabits per second) for a share with this profile. + * + * @return the bandwidth + */ + public ShareProfileBandwidth getBandwidth() { + return bandwidth; + } + /** * Gets the capacity. * @@ -118,5 +171,16 @@ public String getName() { public String getResourceType() { return resourceType; } + + /** + * Gets the storageGeneration. + * + * The storage generation for a share with this profile. + * + * @return the storageGeneration + */ + public ShareProfileStorageGeneration getStorageGeneration() { + return storageGeneration; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocols.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocols.java new file mode 100644 index 0000000000..19a34e4818 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocols.java @@ -0,0 +1,91 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ShareProfileAllowedAccessProtocols. + * + * Classes which extend this class: + * - ShareProfileAllowedAccessProtocolsSubset + */ +public class ShareProfileAllowedAccessProtocols extends GenericModel { + + public interface XDefault { + /** nfs4. */ + String NFS4 = "nfs4"; + } + + /** + * The type for this profile field. + */ + public interface Type { + /** subset. */ + String SUBSET = "subset"; + } + + public interface Values { + /** nfs4. */ + String NFS4 = "nfs4"; + } + + @SerializedName("default") + protected List xDefault; + protected String type; + protected List values; + + protected ShareProfileAllowedAccessProtocols() { } + + /** + * Gets the xDefault. + * + * The default allowed access protocol modes for shares with this profile. + * + * @return the xDefault + */ + public List getXDefault() { + return xDefault; + } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the values. + * + * The possible allowed access protocols for shares with this profile: + * - `nfs4`: NFSv4 will be used. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the values + */ + public List getValues() { + return values; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsSubset.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsSubset.java new file mode 100644 index 0000000000..632f9d499f --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsSubset.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * ShareProfileAllowedAccessProtocolsSubset. + */ +public class ShareProfileAllowedAccessProtocolsSubset extends ShareProfileAllowedAccessProtocols { + + public interface XDefault { + /** nfs4. */ + String NFS4 = "nfs4"; + } + + /** + * The type for this profile field. + */ + public interface Type { + /** subset. */ + String SUBSET = "subset"; + } + + public interface Values { + /** nfs4. */ + String NFS4 = "nfs4"; + } + + + protected ShareProfileAllowedAccessProtocolsSubset() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModes.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModes.java new file mode 100644 index 0000000000..50254873cd --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModes.java @@ -0,0 +1,103 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ShareProfileAllowedTransitEncryptionModes. + * + * Classes which extend this class: + * - ShareProfileAllowedTransitEncryptionModesSubset + */ +public class ShareProfileAllowedTransitEncryptionModes extends GenericModel { + + public interface XDefault { + /** ipsec. */ + String IPSEC = "ipsec"; + /** none. */ + String NONE = "none"; + /** stunnel. */ + String STUNNEL = "stunnel"; + } + + /** + * The type for this profile field. + */ + public interface Type { + /** subset. */ + String SUBSET = "subset"; + } + + public interface Values { + /** ipsec. */ + String IPSEC = "ipsec"; + /** none. */ + String NONE = "none"; + /** stunnel. */ + String STUNNEL = "stunnel"; + } + + @SerializedName("default") + protected List xDefault; + protected String type; + protected List values; + + protected ShareProfileAllowedTransitEncryptionModes() { } + + /** + * Gets the xDefault. + * + * The default allowed transit encryption modes for shares with this profile. + * + * @return the xDefault + */ + public List getXDefault() { + return xDefault; + } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the values. + * + * The allowed [transit encryption + * modes](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-about&interface=ui#fs-eit) for a share with + * this profile: + * - `none`: Not encrypted in transit. + * - `ipsec`: Encrypted in transit using an instance identity certificate. + * - `stunnel`: Encrypted in transit using a connection via an stunnel connection. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the values + */ + public List getValues() { + return values; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesSubset.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesSubset.java new file mode 100644 index 0000000000..f967c54e48 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesSubset.java @@ -0,0 +1,50 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * ShareProfileAllowedTransitEncryptionModesSubset. + */ +public class ShareProfileAllowedTransitEncryptionModesSubset extends ShareProfileAllowedTransitEncryptionModes { + + public interface XDefault { + /** ipsec. */ + String IPSEC = "ipsec"; + /** none. */ + String NONE = "none"; + /** stunnel. */ + String STUNNEL = "stunnel"; + } + + /** + * The type for this profile field. + */ + public interface Type { + /** subset. */ + String SUBSET = "subset"; + } + + public interface Values { + /** ipsec. */ + String IPSEC = "ipsec"; + /** none. */ + String NONE = "none"; + /** stunnel. */ + String STUNNEL = "stunnel"; + } + + + protected ShareProfileAllowedTransitEncryptionModesSubset() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModes.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModes.java new file mode 100644 index 0000000000..9a9755f5ae --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModes.java @@ -0,0 +1,124 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ShareProfileAvailabilityModes. + * + * Classes which extend this class: + * - ShareProfileAvailabilityModesEnum + * - ShareProfileAvailabilityModesFixed + */ +public class ShareProfileAvailabilityModes extends GenericModel { + + /** + * The default data availability mode for this profile. + */ + public interface XDefault { + /** regional. */ + String REGIONAL = "regional"; + /** zonal. */ + String ZONAL = "zonal"; + } + + /** + * The type for this profile field. + */ + public interface Type { + /** enum. */ + String X_ENUM = "enum"; + } + + public interface Values { + /** regional. */ + String REGIONAL = "regional"; + /** zonal. */ + String ZONAL = "zonal"; + } + + /** + * The value for this profile field. + */ + public interface Value { + /** regional. */ + String REGIONAL = "regional"; + /** zonal. */ + String ZONAL = "zonal"; + } + + @SerializedName("default") + protected String xDefault; + protected String type; + protected List values; + protected String value; + + protected ShareProfileAvailabilityModes() { } + + /** + * Gets the xDefault. + * + * The default data availability mode for this profile. + * + * @return the xDefault + */ + public String getXDefault() { + return xDefault; + } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the values. + * + * The data availability mode of the share: + * - `zonal`: The data availability of this share is limited only to a single zone of a + * given region as provided by the `zone` of the share. + * - `regional`: The data availability of this share covers all zones in the region where + * the share is created. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the values + */ + public List getValues() { + return values; + } + + /** + * Gets the value. + * + * The value for this profile field. + * + * @return the value + */ + public String getValue() { + return value; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesEnum.java new file mode 100644 index 0000000000..f9cb33205f --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesEnum.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The permitted data availability modes for a share with this profile. + */ +public class ShareProfileAvailabilityModesEnum extends ShareProfileAvailabilityModes { + + /** + * The default data availability mode for this profile. + */ + public interface XDefault { + /** regional. */ + String REGIONAL = "regional"; + /** zonal. */ + String ZONAL = "zonal"; + } + + /** + * The type for this profile field. + */ + public interface Type { + /** enum. */ + String X_ENUM = "enum"; + } + + public interface Values { + /** regional. */ + String REGIONAL = "regional"; + /** zonal. */ + String ZONAL = "zonal"; + } + + + protected ShareProfileAvailabilityModesEnum() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesFixed.java new file mode 100644 index 0000000000..1048742956 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesFixed.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The data availability mode for a share with this profile is fixed. + */ +public class ShareProfileAvailabilityModesFixed extends ShareProfileAvailabilityModes { + + /** + * The type for this profile field. + */ + public interface Type { + /** fixed. */ + String FIXED = "fixed"; + } + + /** + * The value for this profile field. + */ + public interface Value { + /** regional. */ + String REGIONAL = "regional"; + /** zonal. */ + String ZONAL = "zonal"; + } + + + protected ShareProfileAvailabilityModesFixed() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidth.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidth.java new file mode 100644 index 0000000000..00e8750443 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidth.java @@ -0,0 +1,127 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ShareProfileBandwidth. + * + * Classes which extend this class: + * - ShareProfileBandwidthRange + * - ShareProfileBandwidthDependent + * - ShareProfileBandwidthFixed + * - ShareProfileBandwidthEnum + * - ShareProfileBandwidthDependentRange + */ +public class ShareProfileBandwidth extends GenericModel { + + /** + * The type for this profile field. + */ + public interface Type { + /** range. */ + String RANGE = "range"; + } + + @SerializedName("default") + protected Long xDefault; + protected Long max; + protected Long min; + protected Long step; + protected String type; + protected Long value; + protected List values; + + protected ShareProfileBandwidth() { } + + /** + * Gets the xDefault. + * + * The default value for this profile field. + * + * @return the xDefault + */ + public Long getXDefault() { + return xDefault; + } + + /** + * Gets the max. + * + * The maximum value for this profile field. + * + * @return the max + */ + public Long getMax() { + return max; + } + + /** + * Gets the min. + * + * The minimum value for this profile field. + * + * @return the min + */ + public Long getMin() { + return min; + } + + /** + * Gets the step. + * + * The increment step value for this profile field. + * + * @return the step + */ + public Long getStep() { + return step; + } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the value. + * + * @return the value + */ + public Long getValue() { + return value; + } + + /** + * Gets the values. + * + * The permitted values for this profile field. + * + * @return the values + */ + public List getValues() { + return values; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependent.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependent.java new file mode 100644 index 0000000000..fec18bb4f4 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependent.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The permitted bandwidth for a share with this profile depends on its configuration. + */ +public class ShareProfileBandwidthDependent extends ShareProfileBandwidth { + + /** + * The type for this profile field. + */ + public interface Type { + /** dependent. */ + String DEPENDENT = "dependent"; + } + + + protected ShareProfileBandwidthDependent() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentRange.java new file mode 100644 index 0000000000..f43f848d87 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentRange.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The permitted bandwidth range of a share with this profile depends on its configuration. + */ +public class ShareProfileBandwidthDependentRange extends ShareProfileBandwidth { + + /** + * The type for this profile field. + */ + public interface Type { + /** dependent_range. */ + String DEPENDENT_RANGE = "dependent_range"; + } + + + protected ShareProfileBandwidthDependentRange() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthEnum.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthEnum.java new file mode 100644 index 0000000000..c568ce52fe --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthEnum.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The permitted bandwidth values of a share with this profile. + */ +public class ShareProfileBandwidthEnum extends ShareProfileBandwidth { + + /** + * The type for this profile field. + */ + public interface Type { + /** enum. */ + String X_ENUM = "enum"; + } + + + protected ShareProfileBandwidthEnum() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthFixed.java new file mode 100644 index 0000000000..010d0d0fd6 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthFixed.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The permitted bandwidth of a share with this profile is fixed. + */ +public class ShareProfileBandwidthFixed extends ShareProfileBandwidth { + + /** + * The type for this profile field. + */ + public interface Type { + /** fixed. */ + String FIXED = "fixed"; + } + + + protected ShareProfileBandwidthFixed() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthRange.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthRange.java new file mode 100644 index 0000000000..de846ce919 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthRange.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The permitted bandwidth range (in megabits per second) of a share with this profile. + */ +public class ShareProfileBandwidthRange extends ShareProfileBandwidth { + + /** + * The type for this profile field. + */ + public interface Type { + /** range. */ + String RANGE = "range"; + } + + + protected ShareProfileBandwidthRange() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGeneration.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGeneration.java new file mode 100644 index 0000000000..c3dd6bbb03 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGeneration.java @@ -0,0 +1,61 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * ShareProfileStorageGeneration. + * + * Classes which extend this class: + * - ShareProfileStorageGenerationFixed + */ +public class ShareProfileStorageGeneration extends GenericModel { + + /** + * The type for this profile field. + */ + public interface Type { + /** fixed. */ + String FIXED = "fixed"; + } + + protected String type; + protected Long value; + + protected ShareProfileStorageGeneration() { } + + /** + * Gets the type. + * + * The type for this profile field. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the value. + * + * The value for this profile field. + * + * @return the value + */ + public Long getValue() { + return value; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationFixed.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationFixed.java new file mode 100644 index 0000000000..5e6a9f2d40 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationFixed.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The storage generation value of a share with this profile is fixed. + */ +public class ShareProfileStorageGenerationFixed extends ShareProfileStorageGeneration { + + /** + * The type for this profile field. + */ + public interface Type { + /** fixed. */ + String FIXED = "fixed"; + } + + + protected ShareProfileStorageGenerationFixed() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototype.java index 181f0918be..02e01243b3 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototype.java @@ -30,10 +30,12 @@ public class SharePrototype extends GenericModel { public interface AllowedTransitEncryptionModes { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } /** @@ -52,6 +54,11 @@ public interface AccessControlMode { String VPC = "vpc"; } + public interface AllowedAccessProtocols { + /** nfs4. */ + String NFS4 = "nfs4"; + } + @SerializedName("allowed_transit_encryption_modes") protected List allowedTransitEncryptionModes; @SerializedName("mount_targets") @@ -63,6 +70,9 @@ public interface AccessControlMode { protected List userTags; @SerializedName("access_control_mode") protected String accessControlMode; + @SerializedName("allowed_access_protocols") + protected List allowedAccessProtocols; + protected Long bandwidth; @SerializedName("encryption_key") protected EncryptionKeyIdentity encryptionKey; @SerializedName("initial_owner") @@ -88,9 +98,10 @@ protected SharePrototype() { } * Gets the allowedTransitEncryptionModes. * * The transit encryption modes to allow for this share. If unspecified: - * - If share mount targets are specified, and those share mount targets all specify a - * `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - * - Otherwise, all `transit_encryption` modes will be allowed. + * - If share mount targets are specified, then only transit encryption modes + * specified by those share mount target will be allowed. + * - Otherwise, the default allowed transit encryption modes from the profile will be + * used. * * @return the allowedTransitEncryptionModes */ @@ -128,6 +139,9 @@ public String name() { * unspecified, a replica may be subsequently added by creating a new file share with a * `source_share` referencing this file share. * + * Replica file shares can only be created for shares with an `availability_mode` of + * `zonal`. + * * @return the replicaShare */ public SharePrototypeShareContext replicaShare() { @@ -162,6 +176,38 @@ public String accessControlMode() { return accessControlMode; } + /** + * Gets the allowedAccessProtocols. + * + * The access protocols to allow for this share. If unspecified: + * - If share mount targets are specified, only the access protocols specified by those + * share mount target will be allowed. + * - Otherwise, the default access protocols from the profile will be used. + * + * @return the allowedAccessProtocols + */ + public List allowedAccessProtocols() { + return allowedAccessProtocols; + } + + /** + * Gets the bandwidth. + * + * The maximum bandwidth (in megabits per second) for the file share. + * + * If the share profile has a `bandwidth.type` of `dependent` or `fixed`, this property is system-managed and must not + * be specified. Otherwise, the specified value must be within the `bandwidth` range of the share's profile. + * + * Provided the property is user-managed, if it is unspecified, its value will be set based on the specified [`size` + * and + * `iops`](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles&interface=api). + * + * @return the bandwidth + */ + public Long bandwidth() { + return bandwidth; + } + /** * Gets the encryptionKey. * @@ -248,6 +294,9 @@ public Long size() { * The zone this file share will reside in. For a replica share in the same region as * the source share, this must be a different zone from the source share. * + * This property must be specified if the share profile `availability_mode` is `zonal`, + * and must not be specified otherwise. + * * @return the zone */ public ZoneIdentity zone() { @@ -273,9 +322,12 @@ public String replicationCronSpec() { /** * Gets the sourceShare. * - * The source file share for this replica file share. The specified file share must not - * already have a replica, and must not be a replica. If source file share is specified - * by CRN, it may be in an [associated partner + * The source file share for this replica file share. The specified file share must: + * - Not already have a replica. + * - Not be a replica. + * - Have a `storage_generation` of `1`. + * + * If source file share is specified by CRN, it may be in an [associated partner * region](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-replication). * * @return the sourceShare diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareByOriginShare.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareByOriginShare.java index 226312356f..6b3f898641 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareByOriginShare.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareByOriginShare.java @@ -18,16 +18,21 @@ /** * Create an accessor file share for an existing file share. The values for - * `access_control_mode`, `encryption_key`, `initial_owner`, `iops`, `profile`, `size`, and - * `zone` will be inherited from `origin_share`. + * `access_control_mode`, `allowed_access_protocols`, `bandwidth`, `encryption_key`, + * `initial_owner`, `iops`, `profile`, `size`, and `zone` will be inherited from + * `origin_share`. + * + * Accessor file shares can only be created for shares with a `storage_generation` of `1`. */ public class SharePrototypeShareByOriginShare extends SharePrototype { public interface AllowedTransitEncryptionModes { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } @@ -41,6 +46,7 @@ public static class Builder { private SharePrototypeShareContext replicaShare; private List userTags; private ShareIdentity originShare; + private ResourceGroupIdentity resourceGroup; /** * Instantiates a new Builder from an existing SharePrototypeShareByOriginShare instance. @@ -54,6 +60,7 @@ public Builder(SharePrototype sharePrototypeShareByOriginShare) { this.replicaShare = sharePrototypeShareByOriginShare.replicaShare; this.userTags = sharePrototypeShareByOriginShare.userTags; this.originShare = sharePrototypeShareByOriginShare.originShare; + this.resourceGroup = sharePrototypeShareByOriginShare.resourceGroup; } /** @@ -196,6 +203,17 @@ public Builder originShare(ShareIdentity originShare) { this.originShare = originShare; return this; } + + /** + * Set the resourceGroup. + * + * @param resourceGroup the resourceGroup + * @return the SharePrototypeShareByOriginShare builder + */ + public Builder resourceGroup(ResourceGroupIdentity resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } } protected SharePrototypeShareByOriginShare() { } @@ -209,6 +227,7 @@ protected SharePrototypeShareByOriginShare(Builder builder) { replicaShare = builder.replicaShare; userTags = builder.userTags; originShare = builder.originShare; + resourceGroup = builder.resourceGroup; } /** diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySize.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySize.java index 919caf5153..b5fd452785 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySize.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySize.java @@ -22,10 +22,12 @@ public class SharePrototypeShareBySize extends SharePrototype { public interface AllowedTransitEncryptionModes { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } /** @@ -44,6 +46,11 @@ public interface AccessControlMode { String VPC = "vpc"; } + public interface AllowedAccessProtocols { + /** nfs4. */ + String NFS4 = "nfs4"; + } + /** * Builder. @@ -55,6 +62,8 @@ public static class Builder { private SharePrototypeShareContext replicaShare; private List userTags; private String accessControlMode; + private List allowedAccessProtocols; + private Long bandwidth; private EncryptionKeyIdentity encryptionKey; private ShareInitialOwner initialOwner; private Long iops; @@ -75,6 +84,8 @@ public Builder(SharePrototype sharePrototypeShareBySize) { this.replicaShare = sharePrototypeShareBySize.replicaShare; this.userTags = sharePrototypeShareBySize.userTags; this.accessControlMode = sharePrototypeShareBySize.accessControlMode; + this.allowedAccessProtocols = sharePrototypeShareBySize.allowedAccessProtocols; + this.bandwidth = sharePrototypeShareBySize.bandwidth; this.encryptionKey = sharePrototypeShareBySize.encryptionKey; this.initialOwner = sharePrototypeShareBySize.initialOwner; this.iops = sharePrototypeShareBySize.iops; @@ -95,12 +106,10 @@ public Builder() { * * @param profile the profile * @param size the size - * @param zone the zone */ - public Builder(ShareProfileIdentity profile, Long size, ZoneIdentity zone) { + public Builder(ShareProfileIdentity profile, Long size) { this.profile = profile; this.size = size; - this.zone = zone; } /** @@ -160,6 +169,22 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Adds a new element to allowedAccessProtocols. + * + * @param allowedAccessProtocols the new element to be added + * @return the SharePrototypeShareBySize builder + */ + public Builder addAllowedAccessProtocols(String allowedAccessProtocols) { + com.ibm.cloud.sdk.core.util.Validator.notNull(allowedAccessProtocols, + "allowedAccessProtocols cannot be null"); + if (this.allowedAccessProtocols == null) { + this.allowedAccessProtocols = new ArrayList(); + } + this.allowedAccessProtocols.add(allowedAccessProtocols); + return this; + } + /** * Set the allowedTransitEncryptionModes. * Existing allowedTransitEncryptionModes will be replaced. @@ -229,6 +254,29 @@ public Builder accessControlMode(String accessControlMode) { return this; } + /** + * Set the allowedAccessProtocols. + * Existing allowedAccessProtocols will be replaced. + * + * @param allowedAccessProtocols the allowedAccessProtocols + * @return the SharePrototypeShareBySize builder + */ + public Builder allowedAccessProtocols(List allowedAccessProtocols) { + this.allowedAccessProtocols = allowedAccessProtocols; + return this; + } + + /** + * Set the bandwidth. + * + * @param bandwidth the bandwidth + * @return the SharePrototypeShareBySize builder + */ + public Builder bandwidth(long bandwidth) { + this.bandwidth = bandwidth; + return this; + } + /** * Set the encryptionKey. * @@ -314,14 +362,14 @@ protected SharePrototypeShareBySize(Builder builder) { "profile cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.size, "size cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, - "zone cannot be null"); allowedTransitEncryptionModes = builder.allowedTransitEncryptionModes; mountTargets = builder.mountTargets; name = builder.name; replicaShare = builder.replicaShare; userTags = builder.userTags; accessControlMode = builder.accessControlMode; + allowedAccessProtocols = builder.allowedAccessProtocols; + bandwidth = builder.bandwidth; encryptionKey = builder.encryptionKey; initialOwner = builder.initialOwner; iops = builder.iops; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceShare.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceShare.java index 5c9eb2dfe3..5e30cd998b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceShare.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceShare.java @@ -18,15 +18,21 @@ /** * Create a replica file share for an existing file share. The values for - * `access_control_mode`, `encryption_key`, `initial_owner`, and `size` will be inherited from `source_share`. + * `access_control_mode`, `allowed_access_protocols`, `bandwidth`, `encryption_key`, + * `initial_owner`, and `size` will be inherited from the `source_share`. + * + * Replica file shares can only be created if the source share has a `storage_generation` of + * `1`. */ public class SharePrototypeShareBySourceShare extends SharePrototype { public interface AllowedTransitEncryptionModes { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } @@ -79,13 +85,11 @@ public Builder() { * @param profile the profile * @param replicationCronSpec the replicationCronSpec * @param sourceShare the sourceShare - * @param zone the zone */ - public Builder(ShareProfileIdentity profile, String replicationCronSpec, ShareIdentity sourceShare, ZoneIdentity zone) { + public Builder(ShareProfileIdentity profile, String replicationCronSpec, ShareIdentity sourceShare) { this.profile = profile; this.replicationCronSpec = replicationCronSpec; this.sourceShare = sourceShare; - this.zone = zone; } /** @@ -290,8 +294,6 @@ protected SharePrototypeShareBySourceShare(Builder builder) { "replicationCronSpec cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceShare, "sourceShare cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, - "zone cannot be null"); allowedTransitEncryptionModes = builder.allowedTransitEncryptionModes; mountTargets = builder.mountTargets; name = builder.name; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceSnapshot.java index 76a93c23ac..fadad3b3f5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceSnapshot.java @@ -17,16 +17,23 @@ import java.util.List; /** - * Create a file share from a source snapshot. The initial value for `access_control_mode`, and the zone the file share - * resides in will be inherited from `source_snapshot`. + * Create a file share from a source snapshot. The initial value for `access_control_mode`, + * `initial_owner` and `zone` will be inherited from `source_snapshot`. */ public class SharePrototypeShareBySourceSnapshot extends SharePrototype { public interface AllowedTransitEncryptionModes { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; + } + + public interface AllowedAccessProtocols { + /** nfs4. */ + String NFS4 = "nfs4"; } @@ -39,6 +46,8 @@ public static class Builder { private String name; private SharePrototypeShareContext replicaShare; private List userTags; + private List allowedAccessProtocols; + private Long bandwidth; private EncryptionKeyIdentity encryptionKey; private ShareInitialOwner initialOwner; private Long iops; @@ -58,6 +67,8 @@ public Builder(SharePrototype sharePrototypeShareBySourceSnapshot) { this.name = sharePrototypeShareBySourceSnapshot.name; this.replicaShare = sharePrototypeShareBySourceSnapshot.replicaShare; this.userTags = sharePrototypeShareBySourceSnapshot.userTags; + this.allowedAccessProtocols = sharePrototypeShareBySourceSnapshot.allowedAccessProtocols; + this.bandwidth = sharePrototypeShareBySourceSnapshot.bandwidth; this.encryptionKey = sharePrototypeShareBySourceSnapshot.encryptionKey; this.initialOwner = sharePrototypeShareBySourceSnapshot.initialOwner; this.iops = sharePrototypeShareBySourceSnapshot.iops; @@ -141,6 +152,22 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Adds a new element to allowedAccessProtocols. + * + * @param allowedAccessProtocols the new element to be added + * @return the SharePrototypeShareBySourceSnapshot builder + */ + public Builder addAllowedAccessProtocols(String allowedAccessProtocols) { + com.ibm.cloud.sdk.core.util.Validator.notNull(allowedAccessProtocols, + "allowedAccessProtocols cannot be null"); + if (this.allowedAccessProtocols == null) { + this.allowedAccessProtocols = new ArrayList(); + } + this.allowedAccessProtocols.add(allowedAccessProtocols); + return this; + } + /** * Set the allowedTransitEncryptionModes. * Existing allowedTransitEncryptionModes will be replaced. @@ -199,6 +226,29 @@ public Builder userTags(List userTags) { return this; } + /** + * Set the allowedAccessProtocols. + * Existing allowedAccessProtocols will be replaced. + * + * @param allowedAccessProtocols the allowedAccessProtocols + * @return the SharePrototypeShareBySourceSnapshot builder + */ + public Builder allowedAccessProtocols(List allowedAccessProtocols) { + this.allowedAccessProtocols = allowedAccessProtocols; + return this; + } + + /** + * Set the bandwidth. + * + * @param bandwidth the bandwidth + * @return the SharePrototypeShareBySourceSnapshot builder + */ + public Builder bandwidth(long bandwidth) { + this.bandwidth = bandwidth; + return this; + } + /** * Set the encryptionKey. * @@ -289,6 +339,8 @@ protected SharePrototypeShareBySourceSnapshot(Builder builder) { name = builder.name; replicaShare = builder.replicaShare; userTags = builder.userTags; + allowedAccessProtocols = builder.allowedAccessProtocols; + bandwidth = builder.bandwidth; encryptionKey = builder.encryptionKey; initialOwner = builder.initialOwner; iops = builder.iops; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareContext.java index 3c61e26290..262f58102d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareContext.java @@ -23,14 +23,19 @@ * Configuration for a replica file share to create and associate with this file share. If unspecified, a replica may be * subsequently added by creating a new file share with a * `source_share` referencing this file share. + * + * Replica file shares can only be created for shares with an `availability_mode` of + * `zonal`. */ public class SharePrototypeShareContext extends GenericModel { public interface AllowedTransitEncryptionModes { + /** ipsec. */ + String IPSEC = "ipsec"; /** none. */ String NONE = "none"; - /** user_managed. */ - String USER_MANAGED = "user_managed"; + /** stunnel. */ + String STUNNEL = "stunnel"; } @SerializedName("allowed_transit_encryption_modes") @@ -90,12 +95,10 @@ public Builder() { * * @param profile the profile * @param replicationCronSpec the replicationCronSpec - * @param zone the zone */ - public Builder(ShareProfileIdentity profile, String replicationCronSpec, ZoneIdentity zone) { + public Builder(ShareProfileIdentity profile, String replicationCronSpec) { this.profile = profile; this.replicationCronSpec = replicationCronSpec; - this.zone = zone; } /** @@ -265,8 +268,6 @@ protected SharePrototypeShareContext(Builder builder) { "profile cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.replicationCronSpec, "replicationCronSpec cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.zone, - "zone cannot be null"); allowedTransitEncryptionModes = builder.allowedTransitEncryptionModes; iops = builder.iops; mountTargets = builder.mountTargets; @@ -291,9 +292,10 @@ public Builder newBuilder() { * Gets the allowedTransitEncryptionModes. * * The transit encryption modes to allow for this share. If unspecified: - * - If share mount targets are specified, and those share mount targets all specify a - * `transit_encryption` of `user_managed`, then only `user_managed` will be allowed. - * - Otherwise, all `transit_encryption` modes will be allowed. + * - If share mount targets are specified, then only transit encryption modes + * specified by those share mount target will be allowed. + * - Otherwise, the default allowed transit encryption modes from the profile will be + * used. * * @return the allowedTransitEncryptionModes */ @@ -345,7 +347,9 @@ public String name() { * Gets the profile. * * The [profile](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-profiles) to use - * for this file share. The profile must support the share's specified IOPS and size. + * for this file share. The profile must: + * - support the share's specified IOPS and size, and + * - have the same `storage_generation` as the share. * * @return the profile */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshot.java index 72407d5297..939d7069ed 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshot.java @@ -314,7 +314,8 @@ public List getUserTags() { /** * Gets the zone. * - * The zone this share snapshot resides in. + * The zone this share snapshot resides in. For shares with `availability_mode` of + * `regional`, this property will be absent. * * @return the zone */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshotPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshotPatch.java index c2fe4b0874..27d6d995c1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshotPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshotPatch.java @@ -26,6 +26,7 @@ */ public class ShareSnapshotPatch extends GenericModel { + protected String name; @SerializedName("user_tags") protected List userTags; @@ -33,6 +34,7 @@ public class ShareSnapshotPatch extends GenericModel { * Builder. */ public static class Builder { + private String name; private List userTags; /** @@ -41,6 +43,7 @@ public static class Builder { * @param shareSnapshotPatch the instance to initialize the Builder with */ private Builder(ShareSnapshotPatch shareSnapshotPatch) { + this.name = shareSnapshotPatch.name; this.userTags = shareSnapshotPatch.userTags; } @@ -75,6 +78,17 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Set the name. + * + * @param name the name + * @return the ShareSnapshotPatch builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + /** * Set the userTags. * Existing userTags will be replaced. @@ -91,6 +105,7 @@ public Builder userTags(List userTags) { protected ShareSnapshotPatch() { } protected ShareSnapshotPatch(Builder builder) { + name = builder.name; userTags = builder.userTags; } @@ -103,6 +118,19 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the name. + * + * The name for this share snapshot. The name must be unique among all snapshots for the file share. For this property + * to be changed, the share's `replication_role` must not be + * `replica`. + * + * @return the name + */ + public String name() { + return name; + } + /** * Gets the userTags. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Snapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Snapshot.java index 2ead88ab62..8b8e2f453b 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Snapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Snapshot.java @@ -64,6 +64,8 @@ public interface ResourceType { String SNAPSHOT = "snapshot"; } + @SerializedName("allowed_use") + protected SnapshotAllowedUse allowedUse; @SerializedName("backup_policy_plan") protected BackupPolicyPlanReference backupPolicyPlan; protected Boolean bootable; @@ -112,6 +114,22 @@ public interface ResourceType { protected Snapshot() { } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against the requested instance properties to + * determine compatibility. While bare metal servers cannot be provisioned from snapshots, + * an image or volume created from this snapshot will inherit its `allowed_use` value. + * + * Only present on bootable snapshots. The value of this property will be inherited from + * the source volume or source snapshot at snapshot creation, but can be changed. + * + * @return the allowedUse + */ + public SnapshotAllowedUse getAllowedUse() { + return allowedUse; + } + /** * Gets the backupPolicyPlan. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUse.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUse.java new file mode 100644 index 0000000000..961a883cd3 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUse.java @@ -0,0 +1,81 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * SnapshotAllowedUse. + */ +public class SnapshotAllowedUse extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + protected SnapshotAllowedUse() { } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * @return the apiVersion + */ + public String getApiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using the image data in + * this snapshot. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String getBareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this + * snapshot. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String getInstance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePatch.java new file mode 100644 index 0000000000..4166c6f0e8 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePatch.java @@ -0,0 +1,166 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * SnapshotAllowedUsePatch. + */ +public class SnapshotAllowedUsePatch extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + /** + * Builder. + */ + public static class Builder { + private String apiVersion; + private String bareMetalServer; + private String instance; + + /** + * Instantiates a new Builder from an existing SnapshotAllowedUsePatch instance. + * + * @param snapshotAllowedUsePatch the instance to initialize the Builder with + */ + private Builder(SnapshotAllowedUsePatch snapshotAllowedUsePatch) { + this.apiVersion = snapshotAllowedUsePatch.apiVersion; + this.bareMetalServer = snapshotAllowedUsePatch.bareMetalServer; + this.instance = snapshotAllowedUsePatch.instance; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a SnapshotAllowedUsePatch. + * + * @return the new SnapshotAllowedUsePatch instance + */ + public SnapshotAllowedUsePatch build() { + return new SnapshotAllowedUsePatch(this); + } + + /** + * Set the apiVersion. + * + * @param apiVersion the apiVersion + * @return the SnapshotAllowedUsePatch builder + */ + public Builder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Set the bareMetalServer. + * + * @param bareMetalServer the bareMetalServer + * @return the SnapshotAllowedUsePatch builder + */ + public Builder bareMetalServer(String bareMetalServer) { + this.bareMetalServer = bareMetalServer; + return this; + } + + /** + * Set the instance. + * + * @param instance the instance + * @return the SnapshotAllowedUsePatch builder + */ + public Builder instance(String instance) { + this.instance = instance; + return this; + } + } + + protected SnapshotAllowedUsePatch() { } + + protected SnapshotAllowedUsePatch(Builder builder) { + apiVersion = builder.apiVersion; + bareMetalServer = builder.bareMetalServer; + instance = builder.instance; + } + + /** + * New builder. + * + * @return a SnapshotAllowedUsePatch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * If specified, the value must be between `2019-01-01` and today's date (in UTC). + * + * @return the apiVersion + */ + public String apiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using the image data in + * this snapshot. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String bareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this + * snapshot. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String instance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePrototype.java new file mode 100644 index 0000000000..738cbe4f02 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePrototype.java @@ -0,0 +1,171 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * SnapshotAllowedUsePrototype. + */ +public class SnapshotAllowedUsePrototype extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + /** + * Builder. + */ + public static class Builder { + private String apiVersion; + private String bareMetalServer; + private String instance; + + /** + * Instantiates a new Builder from an existing SnapshotAllowedUsePrototype instance. + * + * @param snapshotAllowedUsePrototype the instance to initialize the Builder with + */ + private Builder(SnapshotAllowedUsePrototype snapshotAllowedUsePrototype) { + this.apiVersion = snapshotAllowedUsePrototype.apiVersion; + this.bareMetalServer = snapshotAllowedUsePrototype.bareMetalServer; + this.instance = snapshotAllowedUsePrototype.instance; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a SnapshotAllowedUsePrototype. + * + * @return the new SnapshotAllowedUsePrototype instance + */ + public SnapshotAllowedUsePrototype build() { + return new SnapshotAllowedUsePrototype(this); + } + + /** + * Set the apiVersion. + * + * @param apiVersion the apiVersion + * @return the SnapshotAllowedUsePrototype builder + */ + public Builder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Set the bareMetalServer. + * + * @param bareMetalServer the bareMetalServer + * @return the SnapshotAllowedUsePrototype builder + */ + public Builder bareMetalServer(String bareMetalServer) { + this.bareMetalServer = bareMetalServer; + return this; + } + + /** + * Set the instance. + * + * @param instance the instance + * @return the SnapshotAllowedUsePrototype builder + */ + public Builder instance(String instance) { + this.instance = instance; + return this; + } + } + + protected SnapshotAllowedUsePrototype() { } + + protected SnapshotAllowedUsePrototype(Builder builder) { + apiVersion = builder.apiVersion; + bareMetalServer = builder.bareMetalServer; + instance = builder.instance; + } + + /** + * New builder. + * + * @return a SnapshotAllowedUsePrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * If specified, the value must be between `2019-01-01` and today's date (in UTC). If unspecified, the `version` query + * parameter value will be used. + * + * @return the apiVersion + */ + public String apiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using the image data in + * this snapshot. + * + * If unspecified, the expression will be set to `true`. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String bareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this + * snapshot. + * + * If unspecified, the expression will be set to `true`. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String instance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotConsistencyGroupPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotConsistencyGroupPrototype.java index f601cbe578..7eaabe612d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotConsistencyGroupPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotConsistencyGroupPrototype.java @@ -75,8 +75,9 @@ public ResourceGroupIdentity resourceGroup() { /** * Gets the snapshots. * - * The data-consistent member snapshots to create. All snapshots must specify a - * `source_volume` attached to the same virtual server instance. + * The data-consistent member snapshots to create. Each snapshot must specify a + * `source_volume` attached to the same virtual server instance, and all source volumes must have a + * `storage_generation` value of `1`. * * @return the snapshots */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfileCollection.java new file mode 100644 index 0000000000..d543e36ce1 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfileCollection.java @@ -0,0 +1,92 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * SnapshotInstanceProfileCollection. + */ +public class SnapshotInstanceProfileCollection extends GenericModel { + + protected PageLink first; + @SerializedName("instance_profiles") + protected List instanceProfiles; + protected Long limit; + protected PageLink next; + @SerializedName("total_count") + protected Long totalCount; + + protected SnapshotInstanceProfileCollection() { } + + /** + * Gets the first. + * + * A link to the first page of resources. + * + * @return the first + */ + public PageLink getFirst() { + return first; + } + + /** + * Gets the instanceProfiles. + * + * A page of instance profiles compatible with the snapshot. + * + * @return the instanceProfiles + */ + public List getInstanceProfiles() { + return instanceProfiles; + } + + /** + * Gets the limit. + * + * The maximum number of resources that can be returned by the request. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the next. + * + * A link to the next page of resources. This property is present for all pages + * except the last page. + * + * @return the next + */ + public PageLink getNext() { + return next; + } + + /** + * Gets the totalCount. + * + * The total number of resources across all pages. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfilesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfilesPager.java new file mode 100644 index 0000000000..2ab31ed999 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfilesPager.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * SnapshotInstanceProfilesPager can be used to simplify the use of the "listSnapshotInstanceProfiles" method. + */ +public class SnapshotInstanceProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListSnapshotInstanceProfilesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected SnapshotInstanceProfilesPager() { } + + /** + * Constructs a new SnapshotInstanceProfilesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listSnapshotInstanceProfiles" method + * @param options the ListSnapshotInstanceProfilesOptions instance to be used to invoke the "listSnapshotInstanceProfiles" method + */ + public SnapshotInstanceProfilesPager(Vpc client, ListSnapshotInstanceProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<InstanceProfileReference> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListSnapshotInstanceProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + SnapshotInstanceProfileCollection result = client.listSnapshotInstanceProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getInstanceProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<InstanceProfileReference> containing all results returned by the "listSnapshotInstanceProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatch.java index 51eb4ac68e..a4bfbeb71c 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatch.java @@ -26,6 +26,8 @@ */ public class SnapshotPatch extends GenericModel { + @SerializedName("allowed_use") + protected SnapshotAllowedUsePatch allowedUse; protected String name; @SerializedName("user_tags") protected List userTags; @@ -34,6 +36,7 @@ public class SnapshotPatch extends GenericModel { * Builder. */ public static class Builder { + private SnapshotAllowedUsePatch allowedUse; private String name; private List userTags; @@ -43,6 +46,7 @@ public static class Builder { * @param snapshotPatch the instance to initialize the Builder with */ private Builder(SnapshotPatch snapshotPatch) { + this.allowedUse = snapshotPatch.allowedUse; this.name = snapshotPatch.name; this.userTags = snapshotPatch.userTags; } @@ -78,6 +82,17 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the SnapshotPatch builder + */ + public Builder allowedUse(SnapshotAllowedUsePatch allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the name. * @@ -105,6 +120,7 @@ public Builder userTags(List userTags) { protected SnapshotPatch() { } protected SnapshotPatch(Builder builder) { + allowedUse = builder.allowedUse; name = builder.name; userTags = builder.userTags; } @@ -118,6 +134,21 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against the requested instance properties to + * determine compatibility. While bare metal servers cannot be provisioned from snapshots, + * an image or volume created from this snapshot will inherit its `allowed_use` value. + * + * Can only be specified for bootable snapshots. + * + * @return the allowedUse + */ + public SnapshotAllowedUsePatch allowedUse() { + return allowedUse; + } + /** * Gets the name. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java index 37b4be6008..1fdbfa77bb 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototype.java @@ -27,6 +27,8 @@ */ public class SnapshotPrototype extends GenericModel { + @SerializedName("allowed_use") + protected SnapshotAllowedUsePrototype allowedUse; protected List clones; protected String name; @SerializedName("resource_group") @@ -42,6 +44,20 @@ public class SnapshotPrototype extends GenericModel { protected SnapshotPrototype() { } + /** + * Gets the allowedUse. + * + * The usage constraints to match against the requested instance or bare metal server + * properties to determine compatibility. + * + * Can only be specified for bootable snapshots. + * + * @return the allowedUse + */ + public SnapshotAllowedUsePrototype allowedUse() { + return allowedUse; + } + /** * Gets the clones. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshot.java index b79f8bd36f..f5914280ca 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshot.java @@ -26,6 +26,7 @@ public class SnapshotPrototypeSnapshotBySourceSnapshot extends SnapshotPrototype * Builder. */ public static class Builder { + private SnapshotAllowedUsePrototype allowedUse; private List clones; private String name; private ResourceGroupIdentity resourceGroup; @@ -39,6 +40,7 @@ public static class Builder { * @param snapshotPrototypeSnapshotBySourceSnapshot the instance to initialize the Builder with */ public Builder(SnapshotPrototype snapshotPrototypeSnapshotBySourceSnapshot) { + this.allowedUse = snapshotPrototypeSnapshotBySourceSnapshot.allowedUse; this.clones = snapshotPrototypeSnapshotBySourceSnapshot.clones; this.name = snapshotPrototypeSnapshotBySourceSnapshot.name; this.resourceGroup = snapshotPrototypeSnapshotBySourceSnapshot.resourceGroup; @@ -103,6 +105,17 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the SnapshotPrototypeSnapshotBySourceSnapshot builder + */ + public Builder allowedUse(SnapshotAllowedUsePrototype allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the clones. * Existing clones will be replaced. @@ -177,6 +190,7 @@ protected SnapshotPrototypeSnapshotBySourceSnapshot() { } protected SnapshotPrototypeSnapshotBySourceSnapshot(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceSnapshot, "sourceSnapshot cannot be null"); + allowedUse = builder.allowedUse; clones = builder.clones; name = builder.name; resourceGroup = builder.resourceGroup; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolume.java index e98e1d38ab..1a0192c13d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolume.java @@ -26,6 +26,7 @@ public class SnapshotPrototypeSnapshotBySourceVolume extends SnapshotPrototype { * Builder. */ public static class Builder { + private SnapshotAllowedUsePrototype allowedUse; private List clones; private String name; private ResourceGroupIdentity resourceGroup; @@ -38,6 +39,7 @@ public static class Builder { * @param snapshotPrototypeSnapshotBySourceVolume the instance to initialize the Builder with */ public Builder(SnapshotPrototype snapshotPrototypeSnapshotBySourceVolume) { + this.allowedUse = snapshotPrototypeSnapshotBySourceVolume.allowedUse; this.clones = snapshotPrototypeSnapshotBySourceVolume.clones; this.name = snapshotPrototypeSnapshotBySourceVolume.name; this.resourceGroup = snapshotPrototypeSnapshotBySourceVolume.resourceGroup; @@ -101,6 +103,17 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the SnapshotPrototypeSnapshotBySourceVolume builder + */ + public Builder allowedUse(SnapshotAllowedUsePrototype allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the clones. * Existing clones will be replaced. @@ -164,6 +177,7 @@ protected SnapshotPrototypeSnapshotBySourceVolume() { } protected SnapshotPrototypeSnapshotBySourceVolume(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceVolume, "sourceVolume cannot be null"); + allowedUse = builder.allowedUse; clones = builder.clones; name = builder.name; resourceGroup = builder.resourceGroup; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayResourceBindingOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayResourceBindingOptions.java new file mode 100644 index 0000000000..af6ed01bfd --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayResourceBindingOptions.java @@ -0,0 +1,166 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.Map; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * The updateEndpointGatewayResourceBinding options. + */ +public class UpdateEndpointGatewayResourceBindingOptions extends GenericModel { + + protected String endpointGatewayId; + protected String id; + protected Map endpointGatewayResourceBindingPatch; + + /** + * Builder. + */ + public static class Builder { + private String endpointGatewayId; + private String id; + private Map endpointGatewayResourceBindingPatch; + + /** + * Instantiates a new Builder from an existing UpdateEndpointGatewayResourceBindingOptions instance. + * + * @param updateEndpointGatewayResourceBindingOptions the instance to initialize the Builder with + */ + private Builder(UpdateEndpointGatewayResourceBindingOptions updateEndpointGatewayResourceBindingOptions) { + this.endpointGatewayId = updateEndpointGatewayResourceBindingOptions.endpointGatewayId; + this.id = updateEndpointGatewayResourceBindingOptions.id; + this.endpointGatewayResourceBindingPatch = updateEndpointGatewayResourceBindingOptions.endpointGatewayResourceBindingPatch; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param endpointGatewayId the endpointGatewayId + * @param id the id + * @param endpointGatewayResourceBindingPatch the endpointGatewayResourceBindingPatch + */ + public Builder(String endpointGatewayId, String id, Map endpointGatewayResourceBindingPatch) { + this.endpointGatewayId = endpointGatewayId; + this.id = id; + this.endpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatch; + } + + /** + * Builds a UpdateEndpointGatewayResourceBindingOptions. + * + * @return the new UpdateEndpointGatewayResourceBindingOptions instance + */ + public UpdateEndpointGatewayResourceBindingOptions build() { + return new UpdateEndpointGatewayResourceBindingOptions(this); + } + + /** + * Set the endpointGatewayId. + * + * @param endpointGatewayId the endpointGatewayId + * @return the UpdateEndpointGatewayResourceBindingOptions builder + */ + public Builder endpointGatewayId(String endpointGatewayId) { + this.endpointGatewayId = endpointGatewayId; + return this; + } + + /** + * Set the id. + * + * @param id the id + * @return the UpdateEndpointGatewayResourceBindingOptions builder + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Set the endpointGatewayResourceBindingPatch. + * + * @param endpointGatewayResourceBindingPatch the endpointGatewayResourceBindingPatch + * @return the UpdateEndpointGatewayResourceBindingOptions builder + */ + public Builder endpointGatewayResourceBindingPatch(Map endpointGatewayResourceBindingPatch) { + this.endpointGatewayResourceBindingPatch = endpointGatewayResourceBindingPatch; + return this; + } + } + + protected UpdateEndpointGatewayResourceBindingOptions() { } + + protected UpdateEndpointGatewayResourceBindingOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.endpointGatewayId, + "endpointGatewayId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.id, + "id cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.endpointGatewayResourceBindingPatch, + "endpointGatewayResourceBindingPatch cannot be null"); + endpointGatewayId = builder.endpointGatewayId; + id = builder.id; + endpointGatewayResourceBindingPatch = builder.endpointGatewayResourceBindingPatch; + } + + /** + * New builder. + * + * @return a UpdateEndpointGatewayResourceBindingOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the endpointGatewayId. + * + * The endpoint gateway identifier. + * + * @return the endpointGatewayId + */ + public String endpointGatewayId() { + return endpointGatewayId; + } + + /** + * Gets the id. + * + * The resource binding identifier. + * + * @return the id + */ + public String id() { + return id; + } + + /** + * Gets the endpointGatewayResourceBindingPatch. + * + * The endpoint gateway resource binding patch. + * + * @return the endpointGatewayResourceBindingPatch + */ + public Map endpointGatewayResourceBindingPatch() { + return endpointGatewayResourceBindingPatch; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVirtualNetworkInterfaceOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVirtualNetworkInterfaceOptions.java index 6dccdd8af8..713e8c1023 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVirtualNetworkInterfaceOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVirtualNetworkInterfaceOptions.java @@ -24,6 +24,7 @@ public class UpdateVirtualNetworkInterfaceOptions extends GenericModel { protected String id; protected Map virtualNetworkInterfacePatch; + protected String ifMatch; /** * Builder. @@ -31,6 +32,7 @@ public class UpdateVirtualNetworkInterfaceOptions extends GenericModel { public static class Builder { private String id; private Map virtualNetworkInterfacePatch; + private String ifMatch; /** * Instantiates a new Builder from an existing UpdateVirtualNetworkInterfaceOptions instance. @@ -40,6 +42,7 @@ public static class Builder { private Builder(UpdateVirtualNetworkInterfaceOptions updateVirtualNetworkInterfaceOptions) { this.id = updateVirtualNetworkInterfaceOptions.id; this.virtualNetworkInterfacePatch = updateVirtualNetworkInterfaceOptions.virtualNetworkInterfacePatch; + this.ifMatch = updateVirtualNetworkInterfaceOptions.ifMatch; } /** @@ -89,6 +92,17 @@ public Builder virtualNetworkInterfacePatch(Map virtualNetworkIn this.virtualNetworkInterfacePatch = virtualNetworkInterfacePatch; return this; } + + /** + * Set the ifMatch. + * + * @param ifMatch the ifMatch + * @return the UpdateVirtualNetworkInterfaceOptions builder + */ + public Builder ifMatch(String ifMatch) { + this.ifMatch = ifMatch; + return this; + } } protected UpdateVirtualNetworkInterfaceOptions() { } @@ -100,6 +114,7 @@ protected UpdateVirtualNetworkInterfaceOptions(Builder builder) { "virtualNetworkInterfacePatch cannot be null"); id = builder.id; virtualNetworkInterfacePatch = builder.virtualNetworkInterfacePatch; + ifMatch = builder.ifMatch; } /** @@ -132,5 +147,17 @@ public String id() { public Map virtualNetworkInterfacePatch() { return virtualNetworkInterfacePatch; } + + /** + * Gets the ifMatch. + * + * If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + * Required if the request body includes an array. + * + * @return the ifMatch + */ + public String ifMatch() { + return ifMatch; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptions.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptions.java index e97abeb092..2fc12daccd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptions.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptions.java @@ -25,6 +25,7 @@ public class UpdateVpnGatewayConnectionOptions extends GenericModel { protected String vpnGatewayId; protected String id; protected Map vpnGatewayConnectionPatch; + protected String ifMatch; /** * Builder. @@ -33,6 +34,7 @@ public static class Builder { private String vpnGatewayId; private String id; private Map vpnGatewayConnectionPatch; + private String ifMatch; /** * Instantiates a new Builder from an existing UpdateVpnGatewayConnectionOptions instance. @@ -43,6 +45,7 @@ private Builder(UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOpti this.vpnGatewayId = updateVpnGatewayConnectionOptions.vpnGatewayId; this.id = updateVpnGatewayConnectionOptions.id; this.vpnGatewayConnectionPatch = updateVpnGatewayConnectionOptions.vpnGatewayConnectionPatch; + this.ifMatch = updateVpnGatewayConnectionOptions.ifMatch; } /** @@ -105,6 +108,17 @@ public Builder vpnGatewayConnectionPatch(Map vpnGatewayConnectio this.vpnGatewayConnectionPatch = vpnGatewayConnectionPatch; return this; } + + /** + * Set the ifMatch. + * + * @param ifMatch the ifMatch + * @return the UpdateVpnGatewayConnectionOptions builder + */ + public Builder ifMatch(String ifMatch) { + this.ifMatch = ifMatch; + return this; + } } protected UpdateVpnGatewayConnectionOptions() { } @@ -119,6 +133,7 @@ protected UpdateVpnGatewayConnectionOptions(Builder builder) { vpnGatewayId = builder.vpnGatewayId; id = builder.id; vpnGatewayConnectionPatch = builder.vpnGatewayConnectionPatch; + ifMatch = builder.ifMatch; } /** @@ -162,5 +177,17 @@ public String id() { public Map vpnGatewayConnectionPatch() { return vpnGatewayConnectionPatch; } + + /** + * Gets the ifMatch. + * + * If present, the request will fail if the specified ETag value does not match the resource's current ETag value. + * Required if the request body includes an array. + * + * @return the ifMatch + */ + public String ifMatch() { + return ifMatch; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPC.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPC.java index be7b19040d..d9eec78595 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPC.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPC.java @@ -104,8 +104,7 @@ protected VPC() { } * Gets the classicAccess. * * Indicates whether this VPC is connected to Classic Infrastructure. If true, this VPC's resources have private - * network connectivity to the account's Classic Infrastructure resources. Only one VPC, per region, may be connected - * in this way. This value is set at creation and subsequently immutable. + * network connectivity to the account's Classic Infrastructure resources. * * @return the classicAccess */ diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCDNSPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCDNSPatch.java index 30c365a446..9f496c4e65 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCDNSPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCDNSPatch.java @@ -101,7 +101,7 @@ public Builder newBuilder() { * * Indicates whether this VPC is enabled as a DNS name resolution hub. * - * Updating the value to `true` requires `allow_dns_resolution_binding` to be `true` for all endpoint gateways + * Updating the value to `true` requires `dns_resolution_binding_mode` be set to `primary` for all endpoint gateways * residing in this VPC. * * Changing the value requires `dns.resolution_binding_count` to be zero. diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCDNSResolutionBinding.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCDNSResolutionBinding.java index 04a7ed95c4..f0c6b7f1a1 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCDNSResolutionBinding.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPCDNSResolutionBinding.java @@ -105,8 +105,9 @@ public Date getCreatedAt() { /** * Gets the endpointGateways. * - * The endpoint gateways that have `allow_dns_resolution_binding` set to `true` and reside in the VPC that has - * `dns.enable_hub` set to `false`. + * The endpoint gateways that have `dns_resolution_binding_mode` set to either `primary` or `per_resource_binding` and + * reside in the VPC that has `dns.enable_hub` set to + * `false`. * * The endpoint gateways may be remote and therefore may not be directly retrievable. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGateway.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGateway.java index 174cebb58a..bf53467cc7 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGateway.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGateway.java @@ -107,6 +107,10 @@ public interface Mode { protected SubnetReference subnet; protected VPCReference vpc; protected String mode; + @SerializedName("advertised_cidrs") + protected List advertisedCidrs; + @SerializedName("local_asn") + protected Long localAsn; protected VPNGateway() { } @@ -289,5 +293,28 @@ public VPCReference getVpc() { public String getMode() { return mode; } + + /** + * Gets the advertisedCidrs. + * + * The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + * advertise routes with these CIDRs as route destinations. + * + * @return the advertisedCidrs + */ + public List getAdvertisedCidrs() { + return advertisedCidrs; + } + + /** + * Gets the localAsn. + * + * The local autonomous system number (ASN) for this VPN gateway and its connections. + * + * @return the localAsn + */ + public Long getLocalAsn() { + return localAsn; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayAdvertisedCIDRCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayAdvertisedCIDRCollection.java new file mode 100644 index 0000000000..ffbebe9f2a --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayAdvertisedCIDRCollection.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayAdvertisedCIDRCollection. + */ +public class VPNGatewayAdvertisedCIDRCollection extends GenericModel { + + @SerializedName("advertised_cidrs") + protected List advertisedCidrs; + + protected VPNGatewayAdvertisedCIDRCollection() { } + + /** + * Gets the advertisedCidrs. + * + * The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + * advertise routes with these CIDRs as route destinations. + * + * @return the advertisedCidrs + */ + public List getAdvertisedCidrs() { + return advertisedCidrs; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocal.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocal.java new file mode 100644 index 0000000000..d0a0ef53d5 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocal.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayConnectionDynamicRouteModeLocal. + */ +public class VPNGatewayConnectionDynamicRouteModeLocal extends GenericModel { + + @SerializedName("ike_identities") + protected List ikeIdentities; + + protected VPNGatewayConnectionDynamicRouteModeLocal() { } + + /** + * Gets the ikeIdentities. + * + * The local IKE identities. + * + * A VPN gateway in dynamic route mode consists of two members in active-active mode. The first identity applies to + * the first member, and the second identity applies to the second member. + * + * @return the ikeIdentities + */ + public List getIkeIdentities() { + return ikeIdentities; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalPrototype.java new file mode 100644 index 0000000000..be38193729 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalPrototype.java @@ -0,0 +1,115 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * VPNGatewayConnectionDynamicRouteModeLocalPrototype. + */ +public class VPNGatewayConnectionDynamicRouteModeLocalPrototype extends VPNGatewayConnectionLocalPrototype { + + /** + * Builder. + */ + public static class Builder { + private List ikeIdentities; + + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionDynamicRouteModeLocalPrototype instance. + * + * @param vpnGatewayConnectionDynamicRouteModeLocalPrototype the instance to initialize the Builder with + */ + private Builder(VPNGatewayConnectionDynamicRouteModeLocalPrototype vpnGatewayConnectionDynamicRouteModeLocalPrototype) { + this.ikeIdentities = vpnGatewayConnectionDynamicRouteModeLocalPrototype.ikeIdentities; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a VPNGatewayConnectionDynamicRouteModeLocalPrototype. + * + * @return the new VPNGatewayConnectionDynamicRouteModeLocalPrototype instance + */ + public VPNGatewayConnectionDynamicRouteModeLocalPrototype build() { + return new VPNGatewayConnectionDynamicRouteModeLocalPrototype(this); + } + + /** + * Adds a new element to ikeIdentities. + * + * @param ikeIdentities the new element to be added + * @return the VPNGatewayConnectionDynamicRouteModeLocalPrototype builder + */ + public Builder addIkeIdentities(VPNGatewayConnectionIKEIdentityPrototype ikeIdentities) { + com.ibm.cloud.sdk.core.util.Validator.notNull(ikeIdentities, + "ikeIdentities cannot be null"); + if (this.ikeIdentities == null) { + this.ikeIdentities = new ArrayList(); + } + this.ikeIdentities.add(ikeIdentities); + return this; + } + + /** + * Set the ikeIdentities. + * Existing ikeIdentities will be replaced. + * + * @param ikeIdentities the ikeIdentities + * @return the VPNGatewayConnectionDynamicRouteModeLocalPrototype builder + */ + public Builder ikeIdentities(List ikeIdentities) { + this.ikeIdentities = ikeIdentities; + return this; + } + } + + protected VPNGatewayConnectionDynamicRouteModeLocalPrototype() { } + + protected VPNGatewayConnectionDynamicRouteModeLocalPrototype(Builder builder) { + ikeIdentities = builder.ikeIdentities; + } + + /** + * New builder. + * + * @return a VPNGatewayConnectionDynamicRouteModeLocalPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the ikeIdentities. + * + * The local IKE identities to use. + * + * A VPN gateway in dynamic route mode consists of two members in active-active mode. The first specified identity + * will be applied to the first member, and the second specified identity will be applied to the second member. + * + * If unspecified, then `type` will be `ipv4_address` and `value` will be the public IP address of the member's VPN + * connection tunnel. + * + * @return the ikeIdentities + */ + public List ikeIdentities() { + return ikeIdentities; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeer.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeer.java new file mode 100644 index 0000000000..54b06169aa --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeer.java @@ -0,0 +1,102 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayConnectionDynamicRouteModePeer. + * + * Classes which extend this class: + * - VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress + * - VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN + */ +public class VPNGatewayConnectionDynamicRouteModePeer extends GenericModel { + + /** + * Indicates whether `peer.address` or `peer.fqdn` is used. + */ + public interface Type { + /** address. */ + String ADDRESS = "address"; + /** fqdn. */ + String FQDN = "fqdn"; + } + + protected Long asn; + @SerializedName("ike_identity") + protected VPNGatewayConnectionIKEIdentity ikeIdentity; + protected String type; + protected String address; + protected String fqdn; + + protected VPNGatewayConnectionDynamicRouteModePeer() { } + + /** + * Gets the asn. + * + * The peer autonomous system number (ASN) for this VPN gateway connection. + * + * @return the asn + */ + public Long getAsn() { + return asn; + } + + /** + * Gets the ikeIdentity. + * + * The peer IKE identity. + * + * @return the ikeIdentity + */ + public VPNGatewayConnectionIKEIdentity getIkeIdentity() { + return ikeIdentity; + } + + /** + * Gets the type. + * + * Indicates whether `peer.address` or `peer.fqdn` is used. + * + * @return the type + */ + public String getType() { + return type; + } + + /** + * Gets the address. + * + * The IP address of the peer VPN gateway for this connection. + * + * @return the address + */ + public String getAddress() { + return address; + } + + /** + * Gets the fqdn. + * + * The FQDN of the peer VPN gateway for this connection. + * + * @return the fqdn + */ + public String getFqdn() { + return fqdn; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototype.java new file mode 100644 index 0000000000..fd610119d7 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototype.java @@ -0,0 +1,81 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayConnectionDynamicRouteModePeerPrototype. + * + * Classes which extend this class: + * - VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress + * - VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN + */ +public class VPNGatewayConnectionDynamicRouteModePeerPrototype extends VPNGatewayConnectionPeerPrototype { + + + protected VPNGatewayConnectionDynamicRouteModePeerPrototype() { } + + /** + * Gets the asn. + * + * The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + * [restricted ASN list]( + * https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + * reserved and unavailable. + * + * @return the asn + */ + public Long asn() { + return asn; + } + + /** + * Gets the ikeIdentity. + * + * The peer IKE identity to use. + * + * If unspecified: + * - If `peer.address` is specified, the `type` will be `ipv4_address`, and + * the `value` will be `peer.address`. + * - If `peer.fqdn` is specified, the `type` will be `fqdn`, and the `value` + * will be `peer.fqdn`. + * + * @return the ikeIdentity + */ + public VPNGatewayConnectionIKEIdentityPrototype ikeIdentity() { + return ikeIdentity; + } + + /** + * Gets the address. + * + * The IP address of the peer VPN gateway for this connection. + * + * @return the address + */ + public String address() { + return address; + } + + /** + * Gets the fqdn. + * + * The FQDN of the peer VPN gateway for this connection. + * + * @return the fqdn + */ + public String fqdn() { + return fqdn; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.java new file mode 100644 index 0000000000..6c134bd859 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.java @@ -0,0 +1,122 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress. + */ +public class VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress extends VPNGatewayConnectionDynamicRouteModePeerPrototype { + + + /** + * Builder. + */ + public static class Builder { + private Long asn; + private VPNGatewayConnectionIKEIdentityPrototype ikeIdentity; + private String address; + + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress instance. + * + * @param vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddress the instance to initialize the Builder with + */ + public Builder(VPNGatewayConnectionDynamicRouteModePeerPrototype vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddress) { + this.asn = vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddress.asn; + this.ikeIdentity = vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddress.ikeIdentity; + this.address = vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddress.address; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param asn the asn + * @param address the address + */ + public Builder(Long asn, String address) { + this.asn = asn; + this.address = address; + } + + /** + * Builds a VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress. + * + * @return the new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress instance + */ + public VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress build() { + return new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(this); + } + + /** + * Set the asn. + * + * @param asn the asn + * @return the VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress builder + */ + public Builder asn(long asn) { + this.asn = asn; + return this; + } + + /** + * Set the ikeIdentity. + * + * @param ikeIdentity the ikeIdentity + * @return the VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress builder + */ + public Builder ikeIdentity(VPNGatewayConnectionIKEIdentityPrototype ikeIdentity) { + this.ikeIdentity = ikeIdentity; + return this; + } + + /** + * Set the address. + * + * @param address the address + * @return the VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress builder + */ + public Builder address(String address) { + this.address = address; + return this; + } + } + + protected VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress() { } + + protected VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.asn, + "asn cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.address, + "address cannot be null"); + asn = builder.asn; + ikeIdentity = builder.ikeIdentity; + address = builder.address; + } + + /** + * New builder. + * + * @return a VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN.java new file mode 100644 index 0000000000..c68284b57f --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN.java @@ -0,0 +1,122 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN. + */ +public class VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN extends VPNGatewayConnectionDynamicRouteModePeerPrototype { + + + /** + * Builder. + */ + public static class Builder { + private Long asn; + private VPNGatewayConnectionIKEIdentityPrototype ikeIdentity; + private String fqdn; + + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN instance. + * + * @param vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdn the instance to initialize the Builder with + */ + public Builder(VPNGatewayConnectionDynamicRouteModePeerPrototype vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdn) { + this.asn = vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdn.asn; + this.ikeIdentity = vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdn.ikeIdentity; + this.fqdn = vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdn.fqdn; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param asn the asn + * @param fqdn the fqdn + */ + public Builder(Long asn, String fqdn) { + this.asn = asn; + this.fqdn = fqdn; + } + + /** + * Builds a VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN. + * + * @return the new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN instance + */ + public VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN build() { + return new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN(this); + } + + /** + * Set the asn. + * + * @param asn the asn + * @return the VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN builder + */ + public Builder asn(long asn) { + this.asn = asn; + return this; + } + + /** + * Set the ikeIdentity. + * + * @param ikeIdentity the ikeIdentity + * @return the VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN builder + */ + public Builder ikeIdentity(VPNGatewayConnectionIKEIdentityPrototype ikeIdentity) { + this.ikeIdentity = ikeIdentity; + return this; + } + + /** + * Set the fqdn. + * + * @param fqdn the fqdn + * @return the VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN builder + */ + public Builder fqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + } + + protected VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN() { } + + protected VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.asn, + "asn cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.fqdn, + "fqdn cannot be null"); + asn = builder.asn; + ikeIdentity = builder.ikeIdentity; + fqdn = builder.fqdn; + } + + /** + * New builder. + * + * @return a VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress.java new file mode 100644 index 0000000000..c5bce3f459 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress.java @@ -0,0 +1,34 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress. + */ +public class VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress extends VPNGatewayConnectionDynamicRouteModePeer { + + /** + * Indicates whether `peer.address` or `peer.fqdn` is used. + */ + public interface Type { + /** address. */ + String ADDRESS = "address"; + /** fqdn. */ + String FQDN = "fqdn"; + } + + + protected VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN.java new file mode 100644 index 0000000000..4892ed1c0f --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN.java @@ -0,0 +1,34 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN. + */ +public class VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN extends VPNGatewayConnectionDynamicRouteModePeer { + + /** + * Indicates whether `peer.address` or `peer.fqdn` is used. + */ + public interface Type { + /** address. */ + String ADDRESS = "address"; + /** fqdn. */ + String FQDN = "fqdn"; + } + + + protected VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeTunnel.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeTunnel.java new file mode 100644 index 0000000000..7eeb19317a --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeTunnel.java @@ -0,0 +1,146 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayConnectionDynamicRouteModeTunnel. + */ +public class VPNGatewayConnectionDynamicRouteModeTunnel extends GenericModel { + + /** + * BGP routing protocol state as defined in + * [RFC 4721](https://www.rfc-editor.org/rfc/rfc4271#section-8.2.2). + */ + public interface ProtocolState { + /** active. */ + String ACTIVE = "active"; + /** connect. */ + String CONNECT = "connect"; + /** established. */ + String ESTABLISHED = "established"; + /** idle. */ + String IDLE = "idle"; + /** open_confirm. */ + String OPEN_CONFIRM = "open_confirm"; + /** open_sent. */ + String OPEN_SENT = "open_sent"; + } + + /** + * The status of the VPN Tunnel. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface Status { + /** down. */ + String DOWN = "down"; + /** up. */ + String UP = "up"; + } + + @SerializedName("neighbor_ip") + protected IP neighborIp; + @SerializedName("protocol_state") + protected String protocolState; + @SerializedName("public_ip") + protected IP publicIp; + protected String status; + @SerializedName("status_reasons") + protected List statusReasons; + @SerializedName("tunnel_interface_ip") + protected IP tunnelInterfaceIp; + + protected VPNGatewayConnectionDynamicRouteModeTunnel() { } + + /** + * Gets the neighborIp. + * + * The IP address of the neighbor on the virtual tunnel interface. + * This serves as the destination address for BGP peering sessions on the peer gateway + * within the tunnel. + * + * @return the neighborIp + */ + public IP getNeighborIp() { + return neighborIp; + } + + /** + * Gets the protocolState. + * + * BGP routing protocol state as defined in + * [RFC 4721](https://www.rfc-editor.org/rfc/rfc4271#section-8.2.2). + * + * @return the protocolState + */ + public String getProtocolState() { + return protocolState; + } + + /** + * Gets the publicIp. + * + * The IP address of the VPN gateway member in which the tunnel resides. + * + * @return the publicIp + */ + public IP getPublicIp() { + return publicIp; + } + + /** + * Gets the status. + * + * The status of the VPN Tunnel. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the statusReasons. + * + * The reasons for the current status (if any). + * + * @return the statusReasons + */ + public List getStatusReasons() { + return statusReasons; + } + + /** + * Gets the tunnelInterfaceIp. + * + * The IP address assigned to the VPN gateway's virtual tunnel interface. + * This serves as the source address for BGP peering sessions initiated from the VPN + * gateway towards the peer gateway within the tunnel. + * + * @return the tunnelInterfaceIp + */ + public IP getTunnelInterfaceIp() { + return tunnelInterfaceIp; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatch.java index 80f3701270..062e91bc30 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatch.java @@ -13,6 +13,8 @@ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import com.google.gson.annotations.SerializedName; @@ -40,6 +42,19 @@ public interface EstablishMode { String PEER_ONLY = "peer_only"; } + /** + * The routing protocol for this VPN gateway connection. For this property to be specified, `mode` must be `route`. + * + * - `none`: No routing protocol will be used. + * - `bgp`: The BGP routing protocol will be used. + */ + public interface RoutingProtocol { + /** bgp. */ + String BGP = "bgp"; + /** none. */ + String NONE = "none"; + } + @SerializedName("admin_state_up") protected Boolean adminStateUp; @SerializedName("dead_peer_detection") @@ -55,6 +70,9 @@ public interface EstablishMode { protected String name; protected VPNGatewayConnectionPeerPatch peer; protected String psk; + @SerializedName("routing_protocol") + protected String routingProtocol; + protected List tunnels; /** * Builder. @@ -69,6 +87,8 @@ public static class Builder { private String name; private VPNGatewayConnectionPeerPatch peer; private String psk; + private String routingProtocol; + private List tunnels; /** * Instantiates a new Builder from an existing VPNGatewayConnectionPatch instance. @@ -85,6 +105,8 @@ private Builder(VPNGatewayConnectionPatch vpnGatewayConnectionPatch) { this.name = vpnGatewayConnectionPatch.name; this.peer = vpnGatewayConnectionPatch.peer; this.psk = vpnGatewayConnectionPatch.psk; + this.routingProtocol = vpnGatewayConnectionPatch.routingProtocol; + this.tunnels = vpnGatewayConnectionPatch.tunnels; } /** @@ -102,6 +124,22 @@ public VPNGatewayConnectionPatch build() { return new VPNGatewayConnectionPatch(this); } + /** + * Adds a new element to tunnels. + * + * @param tunnels the new element to be added + * @return the VPNGatewayConnectionPatch builder + */ + public Builder addTunnels(VPNGatewayConnectionTunnel tunnels) { + com.ibm.cloud.sdk.core.util.Validator.notNull(tunnels, + "tunnels cannot be null"); + if (this.tunnels == null) { + this.tunnels = new ArrayList(); + } + this.tunnels.add(tunnels); + return this; + } + /** * Set the adminStateUp. * @@ -200,6 +238,29 @@ public Builder psk(String psk) { this.psk = psk; return this; } + + /** + * Set the routingProtocol. + * + * @param routingProtocol the routingProtocol + * @return the VPNGatewayConnectionPatch builder + */ + public Builder routingProtocol(String routingProtocol) { + this.routingProtocol = routingProtocol; + return this; + } + + /** + * Set the tunnels. + * Existing tunnels will be replaced. + * + * @param tunnels the tunnels + * @return the VPNGatewayConnectionPatch builder + */ + public Builder tunnels(List tunnels) { + this.tunnels = tunnels; + return this; + } } protected VPNGatewayConnectionPatch() { } @@ -214,6 +275,8 @@ protected VPNGatewayConnectionPatch(Builder builder) { name = builder.name; peer = builder.peer; psk = builder.psk; + routingProtocol = builder.routingProtocol; + tunnels = builder.tunnels; } /** @@ -336,6 +399,32 @@ public String psk() { return psk; } + /** + * Gets the routingProtocol. + * + * The routing protocol for this VPN gateway connection. For this property to be specified, `mode` must be `route`. + * + * - `none`: No routing protocol will be used. + * - `bgp`: The BGP routing protocol will be used. + * + * @return the routingProtocol + */ + public String routingProtocol() { + return routingProtocol; + } + + /** + * Gets the tunnels. + * + * The VPN tunnel configuration to use for this VPN gateway connection + * (in dynamic route mode). + * + * @return the tunnels + */ + public List tunnels() { + return tunnels; + } + /** * Construct a JSON merge-patch from the VPNGatewayConnectionPatch. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatch.java index 5af1b6ec22..f10420a780 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatch.java @@ -21,11 +21,13 @@ * Classes which extend this class: * - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch * - VPNGatewayConnectionPeerPatchVPNGatewayConnectionStaticRouteModePeerPatch + * - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch */ public class VPNGatewayConnectionPeerPatch extends GenericModel { protected String address; protected String fqdn; + protected Long asn; protected VPNGatewayConnectionPeerPatch() { } @@ -50,5 +52,19 @@ public String address() { public String fqdn() { return fqdn; } + + /** + * Gets the asn. + * + * The peer autonomous system number (ASN) for this VPN gateway connection. The ASN values in the + * [restricted ASN list]( + * https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + * reserved and unavailable. + * + * @return the asn + */ + public Long asn() { + return asn; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.java new file mode 100644 index 0000000000..26341b08bf --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch.java @@ -0,0 +1,29 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * The peer VPN gateway for this connection. If `peer.type` is `ipv4_address`, only `peer.address` may be specified. If + * `peer.type` is fqdn, only `peer.fqdn` may be specified. + * + * Classes which extend this class: + * - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch + * - VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch + */ +public class VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch extends VPNGatewayConnectionPeerPatch { + + + protected VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.java new file mode 100644 index 0000000000..413e388d39 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.java @@ -0,0 +1,93 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch. + */ +public class VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch extends VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch { + + + /** + * Builder. + */ + public static class Builder { + private Long asn; + private String address; + + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch instance. + * + * @param vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatch the instance to initialize the Builder with + */ + public Builder(VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatch) { + this.asn = vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatch.asn; + this.address = vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatch.address; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch. + * + * @return the new VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch instance + */ + public VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch build() { + return new VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch(this); + } + + /** + * Set the asn. + * + * @param asn the asn + * @return the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch builder + */ + public Builder asn(long asn) { + this.asn = asn; + return this; + } + + /** + * Set the address. + * + * @param address the address + * @return the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch builder + */ + public Builder address(String address) { + this.address = address; + return this; + } + } + + protected VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch() { } + + protected VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch(Builder builder) { + asn = builder.asn; + address = builder.address; + } + + /** + * New builder. + * + * @return a VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch.java new file mode 100644 index 0000000000..4c06a30ea0 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch.java @@ -0,0 +1,93 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch. + */ +public class VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch extends VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch { + + + /** + * Builder. + */ + public static class Builder { + private Long asn; + private String fqdn; + + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch instance. + * + * @param vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatch the instance to initialize the Builder with + */ + public Builder(VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatch) { + this.asn = vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatch.asn; + this.fqdn = vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatch.fqdn; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch. + * + * @return the new VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch instance + */ + public VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch build() { + return new VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch(this); + } + + /** + * Set the asn. + * + * @param asn the asn + * @return the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch builder + */ + public Builder asn(long asn) { + this.asn = asn; + return this; + } + + /** + * Set the fqdn. + * + * @param fqdn the fqdn + * @return the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch builder + */ + public Builder fqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + } + + protected VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch() { } + + protected VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch(Builder builder) { + asn = builder.asn; + fqdn = builder.fqdn; + } + + /** + * New builder. + * + * @return a VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPrototype.java index a0ff9aad0e..d21adf5f02 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPrototype.java @@ -21,6 +21,7 @@ */ public class VPNGatewayConnectionPeerPrototype extends GenericModel { + protected Long asn; protected List cidrs; @SerializedName("ike_identity") protected VPNGatewayConnectionIKEIdentityPrototype ikeIdentity; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototype.java index 785a788819..411ddcbe1d 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototype.java @@ -13,6 +13,8 @@ package com.ibm.cloud.is.vpc.v1.model; +import java.util.List; + import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -21,6 +23,7 @@ * * Classes which extend this class: * - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype + * - VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype * - VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype */ public class VPNGatewayConnectionPrototype extends GenericModel { @@ -67,6 +70,7 @@ public interface RoutingProtocol { protected Boolean distributeTraffic; @SerializedName("routing_protocol") protected String routingProtocol; + protected List tunnels; protected VPNGatewayConnectionPrototype() { } @@ -199,5 +203,17 @@ public VPNGatewayConnectionPeerPrototype peer() { public String routingProtocol() { return routingProtocol; } + + /** + * Gets the tunnels. + * + * The VPN tunnel configuration to use for this VPN gateway connection + * (in dynamic route mode). + * + * @return the tunnels + */ + public List tunnels() { + return tunnels; + } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.java new file mode 100644 index 0000000000..793fa8725c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.java @@ -0,0 +1,300 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype. + */ +public class VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype extends VPNGatewayConnectionPrototype { + + /** + * The establish mode of the VPN gateway connection: + * - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol + * negotiations or rekeying processes. + * - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway + * connection. Additionally, the peer is responsible for initiating the rekeying process + * after the connection is established. If rekeying does not occur, the VPN gateway + * connection will be brought down after its lifetime expires. + */ + public interface EstablishMode { + /** bidirectional. */ + String BIDIRECTIONAL = "bidirectional"; + /** peer_only. */ + String PEER_ONLY = "peer_only"; + } + + /** + * The routing protocol for this VPN gateway connection. + */ + public interface RoutingProtocol { + /** bgp. */ + String BGP = "bgp"; + } + + + /** + * Builder. + */ + public static class Builder { + private Boolean adminStateUp; + private VPNGatewayConnectionDPDPrototype deadPeerDetection; + private String establishMode; + private VPNGatewayConnectionIKEPolicyPrototype ikePolicy; + private VPNGatewayConnectionIPsecPolicyPrototype ipsecPolicy; + private String name; + private String psk; + private Boolean distributeTraffic; + private VPNGatewayConnectionDynamicRouteModeLocalPrototype local; + private VPNGatewayConnectionDynamicRouteModePeerPrototype peer; + private String routingProtocol; + private List tunnels; + + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype instance. + * + * @param vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype the instance to initialize the Builder with + */ + public Builder(VPNGatewayConnectionPrototype vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype) { + this.adminStateUp = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.adminStateUp; + this.deadPeerDetection = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.deadPeerDetection; + this.establishMode = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.establishMode; + this.ikePolicy = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.ikePolicy; + this.ipsecPolicy = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.ipsecPolicy; + this.name = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.name; + this.psk = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.psk; + this.distributeTraffic = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.distributeTraffic; + this.local = (VPNGatewayConnectionDynamicRouteModeLocalPrototype) vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.local; + this.peer = (VPNGatewayConnectionDynamicRouteModePeerPrototype) vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.peer; + this.routingProtocol = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.routingProtocol; + this.tunnels = vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototype.tunnels; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param psk the psk + * @param peer the peer + * @param routingProtocol the routingProtocol + * @param tunnels the tunnels + */ + public Builder(String psk, VPNGatewayConnectionDynamicRouteModePeerPrototype peer, String routingProtocol, List tunnels) { + this.psk = psk; + this.peer = peer; + this.routingProtocol = routingProtocol; + this.tunnels = tunnels; + } + + /** + * Builds a VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype. + * + * @return the new VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype instance + */ + public VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype build() { + return new VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype(this); + } + + /** + * Adds a new element to tunnels. + * + * @param tunnels the new element to be added + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder addTunnels(VPNGatewayConnectionTunnelPrototype tunnels) { + com.ibm.cloud.sdk.core.util.Validator.notNull(tunnels, + "tunnels cannot be null"); + if (this.tunnels == null) { + this.tunnels = new ArrayList(); + } + this.tunnels.add(tunnels); + return this; + } + + /** + * Set the adminStateUp. + * + * @param adminStateUp the adminStateUp + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder adminStateUp(Boolean adminStateUp) { + this.adminStateUp = adminStateUp; + return this; + } + + /** + * Set the deadPeerDetection. + * + * @param deadPeerDetection the deadPeerDetection + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder deadPeerDetection(VPNGatewayConnectionDPDPrototype deadPeerDetection) { + this.deadPeerDetection = deadPeerDetection; + return this; + } + + /** + * Set the establishMode. + * + * @param establishMode the establishMode + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder establishMode(String establishMode) { + this.establishMode = establishMode; + return this; + } + + /** + * Set the ikePolicy. + * + * @param ikePolicy the ikePolicy + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder ikePolicy(VPNGatewayConnectionIKEPolicyPrototype ikePolicy) { + this.ikePolicy = ikePolicy; + return this; + } + + /** + * Set the ipsecPolicy. + * + * @param ipsecPolicy the ipsecPolicy + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder ipsecPolicy(VPNGatewayConnectionIPsecPolicyPrototype ipsecPolicy) { + this.ipsecPolicy = ipsecPolicy; + return this; + } + + /** + * Set the name. + * + * @param name the name + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Set the psk. + * + * @param psk the psk + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder psk(String psk) { + this.psk = psk; + return this; + } + + /** + * Set the distributeTraffic. + * + * @param distributeTraffic the distributeTraffic + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder distributeTraffic(Boolean distributeTraffic) { + this.distributeTraffic = distributeTraffic; + return this; + } + + /** + * Set the local. + * + * @param local the local + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder local(VPNGatewayConnectionDynamicRouteModeLocalPrototype local) { + this.local = local; + return this; + } + + /** + * Set the peer. + * + * @param peer the peer + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder peer(VPNGatewayConnectionDynamicRouteModePeerPrototype peer) { + this.peer = peer; + return this; + } + + /** + * Set the routingProtocol. + * + * @param routingProtocol the routingProtocol + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder routingProtocol(String routingProtocol) { + this.routingProtocol = routingProtocol; + return this; + } + + /** + * Set the tunnels. + * Existing tunnels will be replaced. + * + * @param tunnels the tunnels + * @return the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder tunnels(List tunnels) { + this.tunnels = tunnels; + return this; + } + } + + protected VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype() { } + + protected VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.psk, + "psk cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.peer, + "peer cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.routingProtocol, + "routingProtocol cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.tunnels, + "tunnels cannot be null"); + adminStateUp = builder.adminStateUp; + deadPeerDetection = builder.deadPeerDetection; + establishMode = builder.establishMode; + ikePolicy = builder.ikePolicy; + ipsecPolicy = builder.ipsecPolicy; + name = builder.name; + psk = builder.psk; + distributeTraffic = builder.distributeTraffic; + local = builder.local; + peer = builder.peer; + routingProtocol = builder.routingProtocol; + tunnels = builder.tunnels; + } + + /** + * New builder. + * + * @return a VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteMode.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteMode.java index 5213295306..bec9ea9bfd 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteMode.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteMode.java @@ -18,6 +18,7 @@ * * Classes which extend this class: * - VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode + * - VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode */ public class VPNGatewayConnectionRouteMode extends VPNGatewayConnection { @SuppressWarnings("unused") @@ -25,6 +26,7 @@ public class VPNGatewayConnectionRouteMode extends VPNGatewayConnection { protected static java.util.Map> discriminatorMapping; static { discriminatorMapping = new java.util.HashMap<>(); + discriminatorMapping.put("bgp", VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.class); discriminatorMapping.put("none", VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode.class); } /** diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.java new file mode 100644 index 0000000000..a56edc3a85 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode.java @@ -0,0 +1,90 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode. + */ +public class VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode extends VPNGatewayConnectionRouteMode { + + /** + * The authentication mode. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface AuthenticationMode { + /** psk. */ + String PSK = "psk"; + } + + /** + * The establish mode of the VPN gateway connection: + * - `bidirectional`: Either side of the VPN gateway can initiate IKE protocol + * negotiations or rekeying processes. + * - `peer_only`: Only the peer can initiate IKE protocol negotiations for this VPN gateway + * connection. Additionally, the peer is responsible for initiating the rekeying process + * after the connection is established. If rekeying does not occur, the VPN gateway + * connection will be brought down after its lifetime expires. + */ + public interface EstablishMode { + /** bidirectional. */ + String BIDIRECTIONAL = "bidirectional"; + /** peer_only. */ + String PEER_ONLY = "peer_only"; + } + + /** + * The mode of the VPN gateway. + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface Mode { + /** policy. */ + String POLICY = "policy"; + /** route. */ + String ROUTE = "route"; + } + + /** + * The resource type. + */ + public interface ResourceType { + /** vpn_gateway_connection. */ + String VPN_GATEWAY_CONNECTION = "vpn_gateway_connection"; + } + + /** + * The status of a VPN gateway connection. + */ + public interface Status { + /** down. */ + String DOWN = "down"; + /** up. */ + String UP = "up"; + } + + /** + * The routing protocol for this VPN gateway connection. + */ + public interface RoutingProtocol { + /** bgp. */ + String BGP = "bgp"; + } + + + protected VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnel.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnel.java new file mode 100644 index 0000000000..57efa0266f --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnel.java @@ -0,0 +1,126 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayConnectionTunnel. + */ +public class VPNGatewayConnectionTunnel extends GenericModel { + + @SerializedName("neighbor_ip") + protected IP neighborIp; + @SerializedName("tunnel_interface_ip") + protected IP tunnelInterfaceIp; + + /** + * Builder. + */ + public static class Builder { + private IP neighborIp; + private IP tunnelInterfaceIp; + + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionTunnel instance. + * + * @param vpnGatewayConnectionTunnel the instance to initialize the Builder with + */ + private Builder(VPNGatewayConnectionTunnel vpnGatewayConnectionTunnel) { + this.neighborIp = vpnGatewayConnectionTunnel.neighborIp; + this.tunnelInterfaceIp = vpnGatewayConnectionTunnel.tunnelInterfaceIp; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a VPNGatewayConnectionTunnel. + * + * @return the new VPNGatewayConnectionTunnel instance + */ + public VPNGatewayConnectionTunnel build() { + return new VPNGatewayConnectionTunnel(this); + } + + /** + * Set the neighborIp. + * + * @param neighborIp the neighborIp + * @return the VPNGatewayConnectionTunnel builder + */ + public Builder neighborIp(IP neighborIp) { + this.neighborIp = neighborIp; + return this; + } + + /** + * Set the tunnelInterfaceIp. + * + * @param tunnelInterfaceIp the tunnelInterfaceIp + * @return the VPNGatewayConnectionTunnel builder + */ + public Builder tunnelInterfaceIp(IP tunnelInterfaceIp) { + this.tunnelInterfaceIp = tunnelInterfaceIp; + return this; + } + } + + protected VPNGatewayConnectionTunnel() { } + + protected VPNGatewayConnectionTunnel(Builder builder) { + neighborIp = builder.neighborIp; + tunnelInterfaceIp = builder.tunnelInterfaceIp; + } + + /** + * New builder. + * + * @return a VPNGatewayConnectionTunnel builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the neighborIp. + * + * The IP address of the neighbor on the virtual tunnel interface. + * This serves as the destination address for BGP peering sessions on the peer gateway + * within the tunnel. + * + * @return the neighborIp + */ + public IP neighborIp() { + return neighborIp; + } + + /** + * Gets the tunnelInterfaceIp. + * + * The IP address assigned to the VPN gateway's virtual tunnel interface. + * This serves as the source address for BGP peering sessions initiated from the VPN + * gateway towards the peer gateway within the tunnel. + * + * @return the tunnelInterfaceIp + */ + public IP tunnelInterfaceIp() { + return tunnelInterfaceIp; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelPrototype.java new file mode 100644 index 0000000000..819c801989 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelPrototype.java @@ -0,0 +1,141 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayConnectionTunnelPrototype. + */ +public class VPNGatewayConnectionTunnelPrototype extends GenericModel { + + @SerializedName("neighbor_ip") + protected IP neighborIp; + @SerializedName("tunnel_interface_ip") + protected IP tunnelInterfaceIp; + + /** + * Builder. + */ + public static class Builder { + private IP neighborIp; + private IP tunnelInterfaceIp; + + /** + * Instantiates a new Builder from an existing VPNGatewayConnectionTunnelPrototype instance. + * + * @param vpnGatewayConnectionTunnelPrototype the instance to initialize the Builder with + */ + private Builder(VPNGatewayConnectionTunnelPrototype vpnGatewayConnectionTunnelPrototype) { + this.neighborIp = vpnGatewayConnectionTunnelPrototype.neighborIp; + this.tunnelInterfaceIp = vpnGatewayConnectionTunnelPrototype.tunnelInterfaceIp; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Instantiates a new builder with required properties. + * + * @param neighborIp the neighborIp + * @param tunnelInterfaceIp the tunnelInterfaceIp + */ + public Builder(IP neighborIp, IP tunnelInterfaceIp) { + this.neighborIp = neighborIp; + this.tunnelInterfaceIp = tunnelInterfaceIp; + } + + /** + * Builds a VPNGatewayConnectionTunnelPrototype. + * + * @return the new VPNGatewayConnectionTunnelPrototype instance + */ + public VPNGatewayConnectionTunnelPrototype build() { + return new VPNGatewayConnectionTunnelPrototype(this); + } + + /** + * Set the neighborIp. + * + * @param neighborIp the neighborIp + * @return the VPNGatewayConnectionTunnelPrototype builder + */ + public Builder neighborIp(IP neighborIp) { + this.neighborIp = neighborIp; + return this; + } + + /** + * Set the tunnelInterfaceIp. + * + * @param tunnelInterfaceIp the tunnelInterfaceIp + * @return the VPNGatewayConnectionTunnelPrototype builder + */ + public Builder tunnelInterfaceIp(IP tunnelInterfaceIp) { + this.tunnelInterfaceIp = tunnelInterfaceIp; + return this; + } + } + + protected VPNGatewayConnectionTunnelPrototype() { } + + protected VPNGatewayConnectionTunnelPrototype(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.neighborIp, + "neighborIp cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.tunnelInterfaceIp, + "tunnelInterfaceIp cannot be null"); + neighborIp = builder.neighborIp; + tunnelInterfaceIp = builder.tunnelInterfaceIp; + } + + /** + * New builder. + * + * @return a VPNGatewayConnectionTunnelPrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the neighborIp. + * + * The IP address of the neighbor on the virtual tunnel interface. + * This serves as the destination address for BGP peering sessions on the peer gateway + * within the tunnel. + * + * @return the neighborIp + */ + public IP neighborIp() { + return neighborIp; + } + + /** + * Gets the tunnelInterfaceIp. + * + * The IP address assigned to the VPN gateway's virtual tunnel interface. + * This serves as the source address for BGP peering sessions initiated from the VPN + * gateway towards the peer gateway within the tunnel. + * + * @return the tunnelInterfaceIp + */ + public IP tunnelInterfaceIp() { + return tunnelInterfaceIp; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatch.java index d3eac85292..62d9661843 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatch.java @@ -15,6 +15,7 @@ import java.util.Map; +import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; import com.ibm.cloud.sdk.core.util.GsonSingleton; @@ -23,12 +24,15 @@ */ public class VPNGatewayPatch extends GenericModel { + @SerializedName("local_asn") + protected Long localAsn; protected String name; /** * Builder. */ public static class Builder { + private Long localAsn; private String name; /** @@ -37,6 +41,7 @@ public static class Builder { * @param vpnGatewayPatch the instance to initialize the Builder with */ private Builder(VPNGatewayPatch vpnGatewayPatch) { + this.localAsn = vpnGatewayPatch.localAsn; this.name = vpnGatewayPatch.name; } @@ -55,6 +60,17 @@ public VPNGatewayPatch build() { return new VPNGatewayPatch(this); } + /** + * Set the localAsn. + * + * @param localAsn the localAsn + * @return the VPNGatewayPatch builder + */ + public Builder localAsn(long localAsn) { + this.localAsn = localAsn; + return this; + } + /** * Set the name. * @@ -70,6 +86,7 @@ public Builder name(String name) { protected VPNGatewayPatch() { } protected VPNGatewayPatch(Builder builder) { + localAsn = builder.localAsn; name = builder.name; } @@ -82,6 +99,20 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the localAsn. + * + * The local autonomous system number (ASN) for this VPN gateway and its connections. The ASN values in the + * [restricted ASN list]( + * https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + * reserved and unavailable. + * + * @return the localAsn + */ + public Long localAsn() { + return localAsn; + } + /** * Gets the name. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototype.java index d96d1e5639..ab11092e76 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototype.java @@ -13,6 +13,8 @@ package com.ibm.cloud.is.vpc.v1.model; +import java.util.List; + import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -37,6 +39,10 @@ public interface Mode { @SerializedName("resource_group") protected ResourceGroupIdentity resourceGroup; protected SubnetIdentity subnet; + @SerializedName("advertised_cidrs") + protected List advertisedCidrs; + @SerializedName("local_asn") + protected Long localAsn; protected String mode; protected VPNGatewayPrototype() { } @@ -76,6 +82,32 @@ public SubnetIdentity subnet() { return subnet; } + /** + * Gets the advertisedCidrs. + * + * The static CIDRs advertised through any enabled routing protocol (for example, BGP). The routing protocol will + * advertise routes with these CIDRs as route destinations. + * + * @return the advertisedCidrs + */ + public List advertisedCidrs() { + return advertisedCidrs; + } + + /** + * Gets the localAsn. + * + * The local autonomous system number (ASN) for this VPN gateway and its connections. The ASN values in the + * [restricted ASN list]( + * https://cloud.ibm.com/docs/vpc?topic=vpc-planning-considerations-vpn#dynamic-route-based-considerations) are + * reserved and unavailable. + * + * @return the localAsn + */ + public Long localAsn() { + return localAsn; + } + /** * Gets the mode. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototype.java index faf07361f1..5000b385c5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototype.java @@ -13,6 +13,9 @@ package com.ibm.cloud.is.vpc.v1.model; +import java.util.ArrayList; +import java.util.List; + /** * VPNGatewayPrototypeVPNGatewayRouteModePrototype. */ @@ -34,6 +37,8 @@ public static class Builder { private String name; private ResourceGroupIdentity resourceGroup; private SubnetIdentity subnet; + private List advertisedCidrs; + private Long localAsn; private String mode; /** @@ -45,6 +50,8 @@ public Builder(VPNGatewayPrototype vpnGatewayPrototypeVpnGatewayRouteModePrototy this.name = vpnGatewayPrototypeVpnGatewayRouteModePrototype.name; this.resourceGroup = vpnGatewayPrototypeVpnGatewayRouteModePrototype.resourceGroup; this.subnet = vpnGatewayPrototypeVpnGatewayRouteModePrototype.subnet; + this.advertisedCidrs = vpnGatewayPrototypeVpnGatewayRouteModePrototype.advertisedCidrs; + this.localAsn = vpnGatewayPrototypeVpnGatewayRouteModePrototype.localAsn; this.mode = vpnGatewayPrototypeVpnGatewayRouteModePrototype.mode; } @@ -72,6 +79,22 @@ public VPNGatewayPrototypeVPNGatewayRouteModePrototype build() { return new VPNGatewayPrototypeVPNGatewayRouteModePrototype(this); } + /** + * Adds a new element to advertisedCidrs. + * + * @param advertisedCidrs the new element to be added + * @return the VPNGatewayPrototypeVPNGatewayRouteModePrototype builder + */ + public Builder addAdvertisedCidrs(String advertisedCidrs) { + com.ibm.cloud.sdk.core.util.Validator.notNull(advertisedCidrs, + "advertisedCidrs cannot be null"); + if (this.advertisedCidrs == null) { + this.advertisedCidrs = new ArrayList(); + } + this.advertisedCidrs.add(advertisedCidrs); + return this; + } + /** * Set the name. * @@ -105,6 +128,29 @@ public Builder subnet(SubnetIdentity subnet) { return this; } + /** + * Set the advertisedCidrs. + * Existing advertisedCidrs will be replaced. + * + * @param advertisedCidrs the advertisedCidrs + * @return the VPNGatewayPrototypeVPNGatewayRouteModePrototype builder + */ + public Builder advertisedCidrs(List advertisedCidrs) { + this.advertisedCidrs = advertisedCidrs; + return this; + } + + /** + * Set the localAsn. + * + * @param localAsn the localAsn + * @return the VPNGatewayPrototypeVPNGatewayRouteModePrototype builder + */ + public Builder localAsn(long localAsn) { + this.localAsn = localAsn; + return this; + } + /** * Set the mode. * @@ -125,6 +171,8 @@ protected VPNGatewayPrototypeVPNGatewayRouteModePrototype(Builder builder) { name = builder.name; resourceGroup = builder.resourceGroup; subnet = builder.subnet; + advertisedCidrs = builder.advertisedCidrs; + localAsn = builder.localAsn; mode = builder.mode; } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnection.java new file mode 100644 index 0000000000..baee355b1c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnection.java @@ -0,0 +1,154 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.Date; +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayServiceConnection. + */ +public class VPNGatewayServiceConnection extends GenericModel { + + /** + * The lifecycle state of the VPN gateway service connection. + */ + public interface LifecycleState { + /** deleting. */ + String DELETING = "deleting"; + /** failed. */ + String FAILED = "failed"; + /** pending. */ + String PENDING = "pending"; + /** stable. */ + String STABLE = "stable"; + /** suspended. */ + String SUSPENDED = "suspended"; + /** updating. */ + String UPDATING = "updating"; + /** waiting. */ + String WAITING = "waiting"; + } + + /** + * The status of this VPN gateway service connection: + * - `degraded`: operating with compromised performance. + * - `down`: not operational. + * - `up`: operating normally. + */ + public interface Status { + /** degraded. */ + String DEGRADED = "degraded"; + /** down. */ + String DOWN = "down"; + /** up. */ + String UP = "up"; + } + + @SerializedName("created_at") + protected Date createdAt; + protected VPNGatewayServiceConnectionCreator creator; + protected String id; + @SerializedName("lifecycle_reasons") + protected List lifecycleReasons; + @SerializedName("lifecycle_state") + protected String lifecycleState; + protected String status; + @SerializedName("status_reasons") + protected List statusReasons; + + protected VPNGatewayServiceConnection() { } + + /** + * Gets the createdAt. + * + * The date and time that this VPN gateway service connection was created. + * + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * Gets the creator. + * + * @return the creator + */ + public VPNGatewayServiceConnectionCreator getCreator() { + return creator; + } + + /** + * Gets the id. + * + * The unique identifier for this VPN gateway service connection. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the lifecycleReasons. + * + * The reasons for the current `lifecycle_state` (if any). + * + * @return the lifecycleReasons + */ + public List getLifecycleReasons() { + return lifecycleReasons; + } + + /** + * Gets the lifecycleState. + * + * The lifecycle state of the VPN gateway service connection. + * + * @return the lifecycleState + */ + public String getLifecycleState() { + return lifecycleState; + } + + /** + * Gets the status. + * + * The status of this VPN gateway service connection: + * - `degraded`: operating with compromised performance. + * - `down`: not operational. + * - `up`: operating normally. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the statusReasons. + * + * The reasons for the current VPN gateway service connection status (if any). + * + * @return the statusReasons + */ + public List getStatusReasons() { + return statusReasons; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCollection.java new file mode 100644 index 0000000000..0a1b9b646c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCollection.java @@ -0,0 +1,92 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayServiceConnectionCollection. + */ +public class VPNGatewayServiceConnectionCollection extends GenericModel { + + protected PageLink first; + protected Long limit; + protected PageLink next; + @SerializedName("service_connections") + protected List serviceConnections; + @SerializedName("total_count") + protected Long totalCount; + + protected VPNGatewayServiceConnectionCollection() { } + + /** + * Gets the first. + * + * A link to the first page of resources. + * + * @return the first + */ + public PageLink getFirst() { + return first; + } + + /** + * Gets the limit. + * + * The maximum number of resources that can be returned by the request. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the next. + * + * A link to the next page of resources. This property is present for all pages + * except the last page. + * + * @return the next + */ + public PageLink getNext() { + return next; + } + + /** + * Gets the serviceConnections. + * + * A page of service connections for the VPN gateway. + * + * @return the serviceConnections + */ + public List getServiceConnections() { + return serviceConnections; + } + + /** + * Gets the totalCount. + * + * The total number of resources across all pages. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreator.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreator.java new file mode 100644 index 0000000000..4eab6632ca --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreator.java @@ -0,0 +1,75 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayServiceConnectionCreator. + * + * Classes which extend this class: + * - VPNGatewayServiceConnectionCreatorTransitGatewayReference + */ +public class VPNGatewayServiceConnectionCreator extends GenericModel { + + /** + * The resource type. + */ + public interface ResourceType { + /** transit_gateway. */ + String TRANSIT_GATEWAY = "transit_gateway"; + } + + protected String crn; + protected String id; + @SerializedName("resource_type") + protected String resourceType; + + protected VPNGatewayServiceConnectionCreator() { } + + /** + * Gets the crn. + * + * The CRN for this transit gateway. + * + * @return the crn + */ + public String getCrn() { + return crn; + } + + /** + * Gets the id. + * + * The unique identifier for this transit gateway. + * + * @return the id + */ + public String getId() { + return id; + } + + /** + * Gets the resourceType. + * + * The resource type. + * + * @return the resourceType + */ + public String getResourceType() { + return resourceType; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTransitGatewayReference.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTransitGatewayReference.java new file mode 100644 index 0000000000..1bb4e193e8 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTransitGatewayReference.java @@ -0,0 +1,32 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +/** + * VPNGatewayServiceConnectionCreatorTransitGatewayReference. + */ +public class VPNGatewayServiceConnectionCreatorTransitGatewayReference extends VPNGatewayServiceConnectionCreator { + + /** + * The resource type. + */ + public interface ResourceType { + /** transit_gateway. */ + String TRANSIT_GATEWAY = "transit_gateway"; + } + + + protected VPNGatewayServiceConnectionCreatorTransitGatewayReference() { } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionLifecycleReason.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionLifecycleReason.java new file mode 100644 index 0000000000..f866dd7f18 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionLifecycleReason.java @@ -0,0 +1,86 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayServiceConnectionLifecycleReason. + */ +public class VPNGatewayServiceConnectionLifecycleReason extends GenericModel { + + /** + * A reason code for this lifecycle state: + * - `internal_error`: internal error (contact IBM support) + * - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + * support) + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + */ + public interface Code { + /** internal_error. */ + String INTERNAL_ERROR = "internal_error"; + /** resource_suspended_by_provider. */ + String RESOURCE_SUSPENDED_BY_PROVIDER = "resource_suspended_by_provider"; + } + + protected String code; + protected String message; + @SerializedName("more_info") + protected String moreInfo; + + protected VPNGatewayServiceConnectionLifecycleReason() { } + + /** + * Gets the code. + * + * A reason code for this lifecycle state: + * - `internal_error`: internal error (contact IBM support) + * - `resource_suspended_by_provider`: The resource has been suspended (contact IBM + * support) + * + * The enumerated values for this property may + * [expand](https://cloud.ibm.com/apidocs/vpc#property-value-expansion) in the future. + * + * @return the code + */ + public String getCode() { + return code; + } + + /** + * Gets the message. + * + * An explanation of the reason for this lifecycle state. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Gets the moreInfo. + * + * A link to documentation about the reason for this lifecycle state. + * + * @return the moreInfo + */ + public String getMoreInfo() { + return moreInfo; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionStatusReason.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionStatusReason.java new file mode 100644 index 0000000000..2a2a655a27 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionStatusReason.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VPNGatewayServiceConnectionStatusReason. + */ +public class VPNGatewayServiceConnectionStatusReason extends GenericModel { + + /** + * The reasons for the current VPN gateway service connection status (if any). + * - `internal_error` + * - `peer_not_responding`. + */ + public interface Code { + /** internal_error. */ + String INTERNAL_ERROR = "internal_error"; + /** peer_not_responding. */ + String PEER_NOT_RESPONDING = "peer_not_responding"; + } + + protected String code; + protected String message; + @SerializedName("more_info") + protected String moreInfo; + + protected VPNGatewayServiceConnectionStatusReason() { } + + /** + * Gets the code. + * + * The reasons for the current VPN gateway service connection status (if any). + * - `internal_error` + * - `peer_not_responding`. + * + * @return the code + */ + public String getCode() { + return code; + } + + /** + * Gets the message. + * + * An explanation of the reason for this VPN gateway service connection's status. + * + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * Gets the moreInfo. + * + * A link to documentation about this status reason. + * + * @return the moreInfo + */ + public String getMoreInfo() { + return moreInfo; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototype.java index 8d27f0edab..c7446d45df 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototype.java @@ -25,8 +25,6 @@ */ public class VirtualNetworkInterfaceIPPrototype extends GenericModel { - protected String id; - protected String href; protected String address; @SerializedName("auto_delete") protected Boolean autoDelete; @@ -34,28 +32,6 @@ public class VirtualNetworkInterfaceIPPrototype extends GenericModel { protected VirtualNetworkInterfaceIPPrototype() { } - /** - * Gets the id. - * - * The unique identifier for this reserved IP. - * - * @return the id - */ - public String id() { - return id; - } - - /** - * Gets the href. - * - * The URL for this reserved IP. - * - * @return the href - */ - public String href() { - return href; - } - /** * Gets the address. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext.java index e4294be223..ff59bc9a37 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext.java @@ -22,7 +22,8 @@ * - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref */ public class VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext extends VirtualNetworkInterfaceIPPrototype { - + protected String id; + protected String href; protected VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContext() { } } diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Volume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Volume.java index a2f5478bdb..e4ed2b5aa4 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Volume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/Volume.java @@ -133,6 +133,8 @@ public interface Status { protected List adjustableCapacityStates; @SerializedName("adjustable_iops_states") protected List adjustableIopsStates; + @SerializedName("allowed_use") + protected VolumeAllowedUse allowedUse; @SerializedName("attachment_state") protected String attachmentState; protected Long bandwidth; @@ -211,6 +213,20 @@ public List getAdjustableIopsStates() { return adjustableIopsStates; } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against the requested instance or bare metal server + * properties to determine compatibility. + * + * Only present for boot volumes. + * + * @return the allowedUse + */ + public VolumeAllowedUse getAllowedUse() { + return allowedUse; + } + /** * Gets the attachmentState. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUse.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUse.java new file mode 100644 index 0000000000..968f92687a --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUse.java @@ -0,0 +1,80 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VolumeAllowedUse. + */ +public class VolumeAllowedUse extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + protected VolumeAllowedUse() { } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * @return the apiVersion + */ + public String getApiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using the image data in + * this volume. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String getBareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this volume. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String getInstance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePatch.java new file mode 100644 index 0000000000..46dd7fd63d --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePatch.java @@ -0,0 +1,165 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VolumeAllowedUsePatch. + */ +public class VolumeAllowedUsePatch extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + /** + * Builder. + */ + public static class Builder { + private String apiVersion; + private String bareMetalServer; + private String instance; + + /** + * Instantiates a new Builder from an existing VolumeAllowedUsePatch instance. + * + * @param volumeAllowedUsePatch the instance to initialize the Builder with + */ + private Builder(VolumeAllowedUsePatch volumeAllowedUsePatch) { + this.apiVersion = volumeAllowedUsePatch.apiVersion; + this.bareMetalServer = volumeAllowedUsePatch.bareMetalServer; + this.instance = volumeAllowedUsePatch.instance; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a VolumeAllowedUsePatch. + * + * @return the new VolumeAllowedUsePatch instance + */ + public VolumeAllowedUsePatch build() { + return new VolumeAllowedUsePatch(this); + } + + /** + * Set the apiVersion. + * + * @param apiVersion the apiVersion + * @return the VolumeAllowedUsePatch builder + */ + public Builder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Set the bareMetalServer. + * + * @param bareMetalServer the bareMetalServer + * @return the VolumeAllowedUsePatch builder + */ + public Builder bareMetalServer(String bareMetalServer) { + this.bareMetalServer = bareMetalServer; + return this; + } + + /** + * Set the instance. + * + * @param instance the instance + * @return the VolumeAllowedUsePatch builder + */ + public Builder instance(String instance) { + this.instance = instance; + return this; + } + } + + protected VolumeAllowedUsePatch() { } + + protected VolumeAllowedUsePatch(Builder builder) { + apiVersion = builder.apiVersion; + bareMetalServer = builder.bareMetalServer; + instance = builder.instance; + } + + /** + * New builder. + * + * @return a VolumeAllowedUsePatch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * If specified, the value must be between `2019-01-01` and today's date (in UTC). + * + * @return the apiVersion + */ + public String apiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using the image data in + * this volume. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String bareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this volume + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String instance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePrototype.java new file mode 100644 index 0000000000..206cf12323 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePrototype.java @@ -0,0 +1,170 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VolumeAllowedUsePrototype. + */ +public class VolumeAllowedUsePrototype extends GenericModel { + + @SerializedName("api_version") + protected String apiVersion; + @SerializedName("bare_metal_server") + protected String bareMetalServer; + protected String instance; + + /** + * Builder. + */ + public static class Builder { + private String apiVersion; + private String bareMetalServer; + private String instance; + + /** + * Instantiates a new Builder from an existing VolumeAllowedUsePrototype instance. + * + * @param volumeAllowedUsePrototype the instance to initialize the Builder with + */ + private Builder(VolumeAllowedUsePrototype volumeAllowedUsePrototype) { + this.apiVersion = volumeAllowedUsePrototype.apiVersion; + this.bareMetalServer = volumeAllowedUsePrototype.bareMetalServer; + this.instance = volumeAllowedUsePrototype.instance; + } + + /** + * Instantiates a new builder. + */ + public Builder() { + } + + /** + * Builds a VolumeAllowedUsePrototype. + * + * @return the new VolumeAllowedUsePrototype instance + */ + public VolumeAllowedUsePrototype build() { + return new VolumeAllowedUsePrototype(this); + } + + /** + * Set the apiVersion. + * + * @param apiVersion the apiVersion + * @return the VolumeAllowedUsePrototype builder + */ + public Builder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Set the bareMetalServer. + * + * @param bareMetalServer the bareMetalServer + * @return the VolumeAllowedUsePrototype builder + */ + public Builder bareMetalServer(String bareMetalServer) { + this.bareMetalServer = bareMetalServer; + return this; + } + + /** + * Set the instance. + * + * @param instance the instance + * @return the VolumeAllowedUsePrototype builder + */ + public Builder instance(String instance) { + this.instance = instance; + return this; + } + } + + protected VolumeAllowedUsePrototype() { } + + protected VolumeAllowedUsePrototype(Builder builder) { + apiVersion = builder.apiVersion; + bareMetalServer = builder.bareMetalServer; + instance = builder.instance; + } + + /** + * New builder. + * + * @return a VolumeAllowedUsePrototype builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the apiVersion. + * + * The API version with which to evaluate the expressions. + * + * If specified, the value must be between `2019-01-01` and today's date (in UTC). If unspecified, the `version` query + * parameter value will be used. + * + * @return the apiVersion + */ + public String apiVersion() { + return apiVersion; + } + + /** + * Gets the bareMetalServer. + * + * The expression that must be satisfied by the properties of a bare metal server provisioned using the image data in + * this volume. + * + * If unspecified, the expression will be set to `true`. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variable is supported, corresponding + * to the `BareMetalServer` property: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled. + * + * @return the bareMetalServer + */ + public String bareMetalServer() { + return bareMetalServer; + } + + /** + * Gets the instance. + * + * The expression that must be satisfied by the properties of a virtual server instance provisioned using this volume. + * + * If unspecified, the expression will be set to `true`. + * + * The expression follows [Common Expression Language](https://github.com/google/cel-spec/blob/master/doc/langdef.md), + * but does not support built-in functions and macros. In addition, the following variables are supported, + * corresponding to `Instance` properties: + * - `enable_secure_boot` (boolean): Indicates whether secure boot is enabled + * - `gpu.count` (integer): The number of GPUs + * - `gpu.manufacturer` (string): The GPU manufacturer + * - `gpu.memory` (integer): The overall amount of GPU memory in GiB (gibibytes) + * - `gpu.model` (string): The GPU model. + * + * @return the instance + */ + public String instance() { + return instance; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolume.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolume.java index d59959ffe3..8457b957ba 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolume.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolume.java @@ -42,6 +42,8 @@ public class VolumeAttachmentPrototypeVolume extends GenericModel { protected Long capacity; @SerializedName("encryption_key") protected EncryptionKeyIdentity encryptionKey; + @SerializedName("allowed_use") + protected VolumeAllowedUsePrototype allowedUse; @SerializedName("source_snapshot") protected SnapshotIdentity sourceSnapshot; @@ -186,6 +188,21 @@ public EncryptionKeyIdentity encryptionKey() { return encryptionKey; } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against requested instance or bare metal server + * properties to determine compatibility. + * + * Can only be specified if `source_snapshot` is bootable. If not specified, the value of + * this property will be inherited from the `source_snapshot`. + * + * @return the allowedUse + */ + public VolumeAllowedUsePrototype allowedUse() { + return allowedUse; + } + /** * Gets the sourceSnapshot. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java index 425dd6ab5c..52f2dc58c5 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.java @@ -32,6 +32,7 @@ public static class Builder { private VolumeProfileIdentity profile; private ResourceGroupIdentity resourceGroup; private List userTags; + private VolumeAllowedUsePrototype allowedUse; private Long capacity; private EncryptionKeyIdentity encryptionKey; private SnapshotIdentity sourceSnapshot; @@ -48,6 +49,7 @@ public Builder(VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext vol this.profile = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.profile; this.resourceGroup = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.resourceGroup; this.userTags = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.userTags; + this.allowedUse = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.allowedUse; this.capacity = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.capacity; this.encryptionKey = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.encryptionKey; this.sourceSnapshot = volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot.sourceSnapshot; @@ -162,6 +164,17 @@ public Builder userTags(List userTags) { return this; } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot builder + */ + public Builder allowedUse(VolumeAllowedUsePrototype allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the capacity. * @@ -209,6 +222,7 @@ protected VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePro profile = builder.profile; resourceGroup = builder.resourceGroup; userTags = builder.userTags; + allowedUse = builder.allowedUse; capacity = builder.capacity; encryptionKey = builder.encryptionKey; sourceSnapshot = builder.sourceSnapshot; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfileCollection.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfileCollection.java new file mode 100644 index 0000000000..4bbc3f6511 --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfileCollection.java @@ -0,0 +1,92 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import java.util.List; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * VolumeInstanceProfileCollection. + */ +public class VolumeInstanceProfileCollection extends GenericModel { + + protected PageLink first; + @SerializedName("instance_profiles") + protected List instanceProfiles; + protected Long limit; + protected PageLink next; + @SerializedName("total_count") + protected Long totalCount; + + protected VolumeInstanceProfileCollection() { } + + /** + * Gets the first. + * + * A link to the first page of resources. + * + * @return the first + */ + public PageLink getFirst() { + return first; + } + + /** + * Gets the instanceProfiles. + * + * A page of instance profiles compatible with the volume. + * + * @return the instanceProfiles + */ + public List getInstanceProfiles() { + return instanceProfiles; + } + + /** + * Gets the limit. + * + * The maximum number of resources that can be returned by the request. + * + * @return the limit + */ + public Long getLimit() { + return limit; + } + + /** + * Gets the next. + * + * A link to the next page of resources. This property is present for all pages + * except the last page. + * + * @return the next + */ + public PageLink getNext() { + return next; + } + + /** + * Gets the totalCount. + * + * The total number of resources across all pages. + * + * @return the totalCount + */ + public Long getTotalCount() { + return totalCount; + } +} + diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfilesPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfilesPager.java new file mode 100644 index 0000000000..f87b3d427b --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfilesPager.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VolumeInstanceProfilesPager can be used to simplify the use of the "listVolumeInstanceProfiles" method. + */ +public class VolumeInstanceProfilesPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVolumeInstanceProfilesOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VolumeInstanceProfilesPager() { } + + /** + * Constructs a new VolumeInstanceProfilesPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVolumeInstanceProfiles" method + * @param options the ListVolumeInstanceProfilesOptions instance to be used to invoke the "listVolumeInstanceProfiles" method + */ + public VolumeInstanceProfilesPager(Vpc client, ListVolumeInstanceProfilesOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<InstanceProfileReference> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVolumeInstanceProfilesOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VolumeInstanceProfileCollection result = client.listVolumeInstanceProfiles(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getInstanceProfiles(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<InstanceProfileReference> containing all results returned by the "listVolumeInstanceProfiles" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePatch.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePatch.java index a10e8f1a66..18ab81b127 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePatch.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePatch.java @@ -26,6 +26,8 @@ */ public class VolumePatch extends GenericModel { + @SerializedName("allowed_use") + protected VolumeAllowedUsePatch allowedUse; protected Long bandwidth; protected Long capacity; protected Long iops; @@ -38,6 +40,7 @@ public class VolumePatch extends GenericModel { * Builder. */ public static class Builder { + private VolumeAllowedUsePatch allowedUse; private Long bandwidth; private Long capacity; private Long iops; @@ -51,6 +54,7 @@ public static class Builder { * @param volumePatch the instance to initialize the Builder with */ private Builder(VolumePatch volumePatch) { + this.allowedUse = volumePatch.allowedUse; this.bandwidth = volumePatch.bandwidth; this.capacity = volumePatch.capacity; this.iops = volumePatch.iops; @@ -90,6 +94,17 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the VolumePatch builder + */ + public Builder allowedUse(VolumeAllowedUsePatch allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the bandwidth. * @@ -161,6 +176,7 @@ public Builder userTags(List userTags) { protected VolumePatch() { } protected VolumePatch(Builder builder) { + allowedUse = builder.allowedUse; bandwidth = builder.bandwidth; capacity = builder.capacity; iops = builder.iops; @@ -178,6 +194,20 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against the requested instance or bare metal server + * properties to determine compatibility. + * + * Can only be specified for boot volumes with an `attachment_state` of `unattached`. + * + * @return the allowedUse + */ + public VolumeAllowedUsePatch allowedUse() { + return allowedUse; + } + /** * Gets the bandwidth. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototype.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototype.java index 44997f5bbd..e4aec6cd08 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototype.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototype.java @@ -39,6 +39,8 @@ public class VolumePrototype extends GenericModel { protected Long capacity; @SerializedName("encryption_key") protected EncryptionKeyIdentity encryptionKey; + @SerializedName("allowed_use") + protected VolumeAllowedUsePrototype allowedUse; @SerializedName("source_snapshot") protected SnapshotIdentity sourceSnapshot; @@ -161,6 +163,21 @@ public EncryptionKeyIdentity encryptionKey() { return encryptionKey; } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against requested instance or bare metal server + * properties to determine compatibility. + * + * Can only be specified if `source_snapshot` is bootable. If not specified, the value of + * this property will be inherited from the `source_snapshot`. + * + * @return the allowedUse + */ + public VolumeAllowedUsePrototype allowedUse() { + return allowedUse; + } + /** * Gets the sourceSnapshot. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstance.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstance.java index 9f2e2e63ab..7bb4b01683 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstance.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstance.java @@ -6,6 +6,8 @@ import com.ibm.cloud.sdk.core.service.model.GenericModel; public class VolumePrototypeInstance extends GenericModel { + @SerializedName("allowed_use") + protected VolumeAllowedUsePrototype allowedUse; protected Long bandwidth; protected Long capacity; @SerializedName("encryption_key") diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContext.java index 4fa53f86ac..c00300d0df 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContext.java @@ -25,6 +25,7 @@ public class VolumePrototypeInstanceByImageContext extends VolumePrototypeInstan * Builder. */ public static class Builder { + private VolumeAllowedUsePrototype allowedUse; private Long bandwidth; private Long capacity; private EncryptionKeyIdentity encryptionKey; @@ -40,6 +41,7 @@ public static class Builder { * @param volumePrototypeInstanceByImageContext the instance to initialize the Builder with */ private Builder(VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContext) { + this.allowedUse = volumePrototypeInstanceByImageContext.allowedUse; this.bandwidth = volumePrototypeInstanceByImageContext.bandwidth; this.capacity = volumePrototypeInstanceByImageContext.capacity; this.encryptionKey = volumePrototypeInstanceByImageContext.encryptionKey; @@ -90,6 +92,17 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the VolumePrototypeInstanceByImageContext builder + */ + public Builder allowedUse(VolumeAllowedUsePrototype allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the bandwidth. * @@ -185,6 +198,7 @@ protected VolumePrototypeInstanceByImageContext() { } protected VolumePrototypeInstanceByImageContext(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notNull(builder.profile, "profile cannot be null"); + allowedUse = builder.allowedUse; bandwidth = builder.bandwidth; capacity = builder.capacity; encryptionKey = builder.encryptionKey; @@ -204,6 +218,21 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against requested instance or bare metal server + * properties to determine compatibility. + * + * Can only be specified if `source_snapshot` is bootable. If not specified, the value of + * this property will be inherited from the `source_image`. + * + * @return the allowedUse + */ + public VolumeAllowedUsePrototype allowedUse() { + return allowedUse; + } + /** * Gets the bandwidth. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContext.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContext.java index 6fee2b86fc..9eb02cd55a 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContext.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContext.java @@ -25,6 +25,7 @@ public class VolumePrototypeInstanceBySourceSnapshotContext extends VolumeProtot * Builder. */ public static class Builder { + private VolumeAllowedUsePrototype allowedUse; private Long bandwidth; private Long capacity; private EncryptionKeyIdentity encryptionKey; @@ -41,6 +42,7 @@ public static class Builder { * @param volumePrototypeInstanceBySourceSnapshotContext the instance to initialize the Builder with */ private Builder(VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContext) { + this.allowedUse = volumePrototypeInstanceBySourceSnapshotContext.allowedUse; this.bandwidth = volumePrototypeInstanceBySourceSnapshotContext.bandwidth; this.capacity = volumePrototypeInstanceBySourceSnapshotContext.capacity; this.encryptionKey = volumePrototypeInstanceBySourceSnapshotContext.encryptionKey; @@ -94,6 +96,17 @@ public Builder addUserTags(String userTags) { return this; } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the VolumePrototypeInstanceBySourceSnapshotContext builder + */ + public Builder allowedUse(VolumeAllowedUsePrototype allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the bandwidth. * @@ -202,6 +215,7 @@ protected VolumePrototypeInstanceBySourceSnapshotContext(Builder builder) { "profile cannot be null"); com.ibm.cloud.sdk.core.util.Validator.notNull(builder.sourceSnapshot, "sourceSnapshot cannot be null"); + allowedUse = builder.allowedUse; bandwidth = builder.bandwidth; capacity = builder.capacity; encryptionKey = builder.encryptionKey; @@ -222,6 +236,21 @@ public Builder newBuilder() { return new Builder(this); } + /** + * Gets the allowedUse. + * + * The usage constraints to be matched against requested instance or bare metal server + * properties to determine compatibility. + * + * Can only be specified if `source_snapshot` is bootable. If not specified, the value of + * this property will be inherited from the `source_snapshot`. + * + * @return the allowedUse + */ + public VolumeAllowedUsePrototype allowedUse() { + return allowedUse; + } + /** * Gets the bandwidth. * diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshot.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshot.java index c0e708bf9e..2247a99270 100644 --- a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshot.java +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshot.java @@ -33,6 +33,7 @@ public static class Builder { private ResourceGroupIdentity resourceGroup; private List userTags; private ZoneIdentity zone; + private VolumeAllowedUsePrototype allowedUse; private Long capacity; private EncryptionKeyIdentity encryptionKey; private SnapshotIdentity sourceSnapshot; @@ -50,6 +51,7 @@ public Builder(VolumePrototype volumePrototypeVolumeBySourceSnapshot) { this.resourceGroup = volumePrototypeVolumeBySourceSnapshot.resourceGroup; this.userTags = volumePrototypeVolumeBySourceSnapshot.userTags; this.zone = volumePrototypeVolumeBySourceSnapshot.zone; + this.allowedUse = volumePrototypeVolumeBySourceSnapshot.allowedUse; this.capacity = volumePrototypeVolumeBySourceSnapshot.capacity; this.encryptionKey = volumePrototypeVolumeBySourceSnapshot.encryptionKey; this.sourceSnapshot = volumePrototypeVolumeBySourceSnapshot.sourceSnapshot; @@ -177,6 +179,17 @@ public Builder zone(ZoneIdentity zone) { return this; } + /** + * Set the allowedUse. + * + * @param allowedUse the allowedUse + * @return the VolumePrototypeVolumeBySourceSnapshot builder + */ + public Builder allowedUse(VolumeAllowedUsePrototype allowedUse) { + this.allowedUse = allowedUse; + return this; + } + /** * Set the capacity. * @@ -227,6 +240,7 @@ protected VolumePrototypeVolumeBySourceSnapshot(Builder builder) { resourceGroup = builder.resourceGroup; userTags = builder.userTags; zone = builder.zone; + allowedUse = builder.allowedUse; capacity = builder.capacity; encryptionKey = builder.encryptionKey; sourceSnapshot = builder.sourceSnapshot; diff --git a/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnGatewayServiceConnectionsPager.java b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnGatewayServiceConnectionsPager.java new file mode 100644 index 0000000000..dbe92b623c --- /dev/null +++ b/modules/vpc/src/main/java/com/ibm/cloud/is/vpc/v1/model/VpnGatewayServiceConnectionsPager.java @@ -0,0 +1,112 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.Vpc; +import com.ibm.cloud.sdk.core.util.UrlHelper; +import java.util.ArrayList; +import java.util.List; +import java.util.NoSuchElementException; + +/** + * VpnGatewayServiceConnectionsPager can be used to simplify the use of the "listVpnGatewayServiceConnections" method. + */ +public class VpnGatewayServiceConnectionsPager { + private static class PageContext { + private String next; + public String getNext() { + return next; + } + public void setNext(String next) { + this.next = next; + } + } + + protected boolean hasNext; + protected ListVpnGatewayServiceConnectionsOptions options; + protected Vpc client; + protected PageContext pageContext; + + // Hide the default ctor. + protected VpnGatewayServiceConnectionsPager() { } + + /** + * Constructs a new VpnGatewayServiceConnectionsPager instance with the specified client and options model instance. + * @param client the Vpc instance to be used to invoke the "listVpnGatewayServiceConnections" method + * @param options the ListVpnGatewayServiceConnectionsOptions instance to be used to invoke the "listVpnGatewayServiceConnections" method + */ + public VpnGatewayServiceConnectionsPager(Vpc client, ListVpnGatewayServiceConnectionsOptions options) { + if (options.start() != null) { + throw new IllegalArgumentException("The options 'start' field should not be set"); + } + + this.hasNext = true; + this.client = client; + this.options = options.newBuilder().build(); + this.pageContext = new PageContext(); + } + + /** + * Returns true if there are more results to be retrieved. + * @return boolean + */ + public boolean hasNext() { + return hasNext; + } + + /** + * Returns the next page of results. + * @return a List<VPNGatewayServiceConnection> that contains the next page of results + */ + public List getNext() { + if (!hasNext()) { + throw new NoSuchElementException("No more results available"); + } + + ListVpnGatewayServiceConnectionsOptions.Builder builder = this.options.newBuilder(); + if (this.pageContext.getNext() != null) { + builder.start(this.pageContext.getNext()); + } + this.options = builder.build(); + + VPNGatewayServiceConnectionCollection result = client.listVpnGatewayServiceConnections(options).execute().getResult(); + + String next = null; + if (result.getNext() != null) { + String queryParam = UrlHelper.getQueryParam(result.getNext().getHref(), "start"); + if (queryParam != null) { + next = queryParam; + } + } + this.pageContext.setNext(next); + if (next == null) { + this.hasNext = false; + } + + return result.getServiceConnections(); + } + + /** + * Returns all results by invoking getNext() repeatedly until all pages of results have been retrieved. + * @return a List<VPNGatewayServiceConnection> containing all results returned by the "listVpnGatewayServiceConnections" method + */ + public List getAll() { + List results = new ArrayList<>(); + while (hasNext()) { + List nextPage = getNext(); + results.addAll(nextPage); + } + return results; + } +} diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcIT.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcIT.java index 79d03779ba..e53a3c0731 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcIT.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcIT.java @@ -23,6 +23,7 @@ import com.ibm.cloud.is.vpc.v1.model.AddInstanceNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddVirtualNetworkInterfaceIpOptions; +import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddressPrefix; @@ -78,15 +79,21 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerCollection; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerConsoleAccessToken; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDisk; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskAllowedUse; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskCollection; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskPatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerFirmware; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerHealthReason; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitialization; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfile; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccount; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataService; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePatch; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachment; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentByPCI; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentByVLAN; @@ -191,6 +198,7 @@ import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentity; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceReference; +import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.CloudObjectStorageBucketIdentity; @@ -260,6 +268,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.CreateDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.CreateEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.CreateEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.CreateFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.CreateFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.CreateIkePolicyOptions; @@ -390,6 +399,7 @@ import com.ibm.cloud.is.vpc.v1.model.DeleteDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.DeleteEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteIkePolicyOptions; @@ -470,6 +480,15 @@ import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReservedIPReservedIPIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReservedIPReservedIPIdentityById; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReservedIPReservedIPPrototypeTargetContext; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBinding; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingCollection; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingPatch; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTarget; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetCRN; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetPrototype; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingsPager; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTarget; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetPrivatePathServiceGatewayReference; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetPrototype; @@ -573,6 +592,7 @@ import com.ibm.cloud.is.vpc.v1.model.GetDedicatedHostProfileOptions; import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.GetFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.GetIkePolicyOptions; @@ -649,6 +669,7 @@ import com.ibm.cloud.is.vpc.v1.model.GetVpcRoutingTableRouteOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayConnectionOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayServiceConnectionOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerClientConfigurationOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerClientOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerOptions; @@ -667,6 +688,11 @@ import com.ibm.cloud.is.vpc.v1.model.IkePoliciesPager; import com.ibm.cloud.is.vpc.v1.model.IkePolicyConnectionsPager; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUse; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePrototype; +import com.ibm.cloud.is.vpc.v1.model.ImageBareMetalServerProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.ImageBareMetalServerProfilesPager; import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.ImageCollection; import com.ibm.cloud.is.vpc.v1.model.ImageExportJob; @@ -680,6 +706,8 @@ import com.ibm.cloud.is.vpc.v1.model.ImageIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ImageIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.ImageIdentityById; +import com.ibm.cloud.is.vpc.v1.model.ImageInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.ImageInstanceProfilesPager; import com.ibm.cloud.is.vpc.v1.model.ImagePatch; import com.ibm.cloud.is.vpc.v1.model.ImagePrototype; import com.ibm.cloud.is.vpc.v1.model.ImagePrototypeImageByFile; @@ -732,12 +760,10 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototype; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionReference; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionScheduledAction; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionScheduledActionGroupTarget; @@ -772,6 +798,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembership; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipReferenceInstanceContext; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReference; @@ -888,17 +915,23 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileSupportedSecureBootModes; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPU; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUArchitecture; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUBurstLimit; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUBurstLimitFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUDependent; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUEnum; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUManufacturer; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUManufacturerDependent; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUManufacturerFixed; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUPercentage; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPURange; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidth; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthDependent; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthEnum; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthFixed; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModes; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModesDependent; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModesEnum; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthRange; import com.ibm.cloud.is.vpc.v1.model.InstancePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByCatalogOffering; @@ -948,6 +981,9 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceTemplate; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateReference; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUBurst; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.InstancesPager; import com.ibm.cloud.is.vpc.v1.model.IpsecPoliciesPager; import com.ibm.cloud.is.vpc.v1.model.IpsecPolicyConnectionsPager; @@ -984,12 +1020,15 @@ import com.ibm.cloud.is.vpc.v1.model.ListDedicatedHostProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListDedicatedHostsOptions; import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewayIpsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewayResourceBindingsOptions; import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewaysOptions; import com.ibm.cloud.is.vpc.v1.model.ListFloatingIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListFlowLogCollectorsOptions; import com.ibm.cloud.is.vpc.v1.model.ListIkePoliciesOptions; import com.ibm.cloud.is.vpc.v1.model.ListIkePolicyConnectionsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListImageBareMetalServerProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListImageExportJobsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListImageInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListImagesOptions; import com.ibm.cloud.is.vpc.v1.model.ListInstanceClusterNetworkAttachmentsOptions; import com.ibm.cloud.is.vpc.v1.model.ListInstanceDisksOptions; @@ -1039,11 +1078,13 @@ import com.ibm.cloud.is.vpc.v1.model.ListSharesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotClonesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotConsistencyGroupsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListSnapshotInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotsOptions; import com.ibm.cloud.is.vpc.v1.model.ListSubnetReservedIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListSubnetsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVirtualNetworkInterfaceIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVirtualNetworkInterfacesOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVolumeInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVolumeProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVolumesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcAddressPrefixesOptions; @@ -1052,9 +1093,11 @@ import com.ibm.cloud.is.vpc.v1.model.ListVpcRoutingTableRoutesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcRoutingTablesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayAdvertisedCidrsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsLocalCidrsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsPeerCidrsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayServiceConnectionsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewaysOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnServerClientsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnServerRoutesOptions; @@ -1147,7 +1190,8 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberPrototype; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberReference; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTarget; -import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetIP; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetByReservedIp; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetIPNotReservedIP; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetInstanceReference; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetLoadBalancerReference; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototype; @@ -1160,6 +1204,9 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityById; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolPatch; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolPrototypeLoadBalancerContext; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolReference; @@ -1192,6 +1239,7 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSourceIPSessionPersistenceSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSourceIPSessionPersistenceSupportedDependent; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSourceIPSessionPersistenceSupportedFixed; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileTargetableResourceTypes; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedDependent; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedFixed; @@ -1219,20 +1267,28 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleCollection; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItem; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolIndividual; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolIndividual; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePatch; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContext; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.NetworkAclRulesPager; @@ -1311,6 +1367,7 @@ import com.ibm.cloud.is.vpc.v1.model.RemoveInstanceNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVirtualNetworkInterfaceIpOptions; +import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.ReplaceBareMetalServerInitializationOptions; @@ -1424,9 +1481,14 @@ import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeCIDR; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeIP; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePatch; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolAny; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolIndividual; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototype; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemote; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemoteCIDR; @@ -1446,7 +1508,6 @@ import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemoteSecurityGroupReference; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleSecurityGroupRuleProtocolAll; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleSecurityGroupRuleProtocolICMP; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetCollection; @@ -1494,6 +1555,19 @@ import com.ibm.cloud.is.vpc.v1.model.ShareMountTargetsPager; import com.ibm.cloud.is.vpc.v1.model.SharePatch; import com.ibm.cloud.is.vpc.v1.model.ShareProfile; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedAccessProtocols; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedAccessProtocolsSubset; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedTransitEncryptionModes; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedTransitEncryptionModesSubset; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModes; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModesEnum; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModesFixed; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidth; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthDependent; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthDependentRange; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthEnum; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthFixed; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthRange; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCapacity; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCapacityDependentRange; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCapacityEnum; @@ -1510,6 +1584,8 @@ import com.ibm.cloud.is.vpc.v1.model.ShareProfileIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.ShareProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.ShareProfileReference; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileStorageGeneration; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileStorageGenerationFixed; import com.ibm.cloud.is.vpc.v1.model.ShareProfilesPager; import com.ibm.cloud.is.vpc.v1.model.SharePrototype; import com.ibm.cloud.is.vpc.v1.model.SharePrototypeShareByOriginShare; @@ -1535,6 +1611,9 @@ import com.ibm.cloud.is.vpc.v1.model.ShareSourceSnapshotShareSnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SharesPager; import com.ibm.cloud.is.vpc.v1.model.Snapshot; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUse; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.SnapshotClone; import com.ibm.cloud.is.vpc.v1.model.SnapshotCloneCollection; @@ -1552,6 +1631,8 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SnapshotInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.SnapshotInstanceProfilesPager; import com.ibm.cloud.is.vpc.v1.model.SnapshotPatch; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceSnapshot; @@ -1600,6 +1681,7 @@ import com.ibm.cloud.is.vpc.v1.model.UpdateDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.UpdateEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFirmwareForBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFlowLogCollectorOptions; @@ -1689,6 +1771,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCReferenceRemote; import com.ibm.cloud.is.vpc.v1.model.VPCRemote; import com.ibm.cloud.is.vpc.v1.model.VPNGateway; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayAdvertisedCIDRCollection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayCollection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionCIDRs; @@ -1696,6 +1779,15 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPD; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPDPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPDPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeLocal; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeLocalPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeer; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeTunnel; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentity; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN; @@ -1720,6 +1812,9 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatch; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFQDNPatch; @@ -1736,10 +1831,12 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPolicyModePeerVPNGatewayConnectionPeerByAddress; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPolicyModePeerVPNGatewayConnectionPeerByFQDN; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionReference; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionRouteMode; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStaticRouteModeLocal; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStaticRouteModeLocalPrototype; @@ -1751,6 +1848,8 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStaticRouteModePeerVPNGatewayConnectionPeerByFQDN; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStaticRouteModeTunnel; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStatusReason; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnel; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnelPrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnelStatusReason; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayHealthReason; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayLifecycleReason; @@ -1763,6 +1862,12 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayPrototypeVPNGatewayPolicyModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayPrototypeVPNGatewayRouteModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayRouteMode; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCollection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCreator; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCreatorTransitGatewayReference; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionStatusReason; import com.ibm.cloud.is.vpc.v1.model.VPNServer; import com.ibm.cloud.is.vpc.v1.model.VPNServerAuthentication; import com.ibm.cloud.is.vpc.v1.model.VPNServerAuthenticationByCertificate; @@ -1804,6 +1909,9 @@ import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceTargetShareMountTargetReference; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacesPager; import com.ibm.cloud.is.vpc.v1.model.Volume; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUse; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachment; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentCollection; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentDevice; @@ -1829,6 +1937,8 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.VolumeInstanceProfilesPager; import com.ibm.cloud.is.vpc.v1.model.VolumePatch; import com.ibm.cloud.is.vpc.v1.model.VolumeProfile; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileAdjustableCapacityStates; @@ -1878,6 +1988,7 @@ import com.ibm.cloud.is.vpc.v1.model.VpcRoutingTablesPager; import com.ibm.cloud.is.vpc.v1.model.VpcsPager; import com.ibm.cloud.is.vpc.v1.model.VpnGatewayConnectionsPager; +import com.ibm.cloud.is.vpc.v1.model.VpnGatewayServiceConnectionsPager; import com.ibm.cloud.is.vpc.v1.model.VpnGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.VpnServerClientsPager; import com.ibm.cloud.is.vpc.v1.model.VpnServerRoutesPager; @@ -1913,7 +2024,6 @@ public class VpcIT extends SdkIntegrationTestBase { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - String version = "2024-06-23"; /** * This method provides our config filename to the base class. */ @@ -1929,7 +2039,7 @@ public void constructService() { return; } - service = Vpc.newInstance(version); + service = Vpc.newInstance(); assertNotNull(service); assertNotNull(service.getServiceUrl()); @@ -1945,23 +2055,24 @@ public void constructService() { } @Test - public void testListVpcs() throws Exception { + public void testListBackupPolicies() throws Exception { try { - ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() + ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .classicAccess(true) + .name("my-name") + .tag("testString") .build(); // Invoke operation - Response response = service.listVpcs(listVpcsOptions).execute(); + Response response = service.listBackupPolicies(listBackupPoliciesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPCCollection vpcCollectionResult = response.getResult(); - assertNotNull(vpcCollectionResult); + BackupPolicyCollection backupPolicyCollectionResult = response.getResult(); + assertNotNull(backupPolicyCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -1969,28 +2080,29 @@ public void testListVpcs() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcs" }) - public void testListVpcsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListBackupPolicies" }) + public void testListBackupPoliciesWithPager() throws Exception { try { - ListVpcsOptions options = new ListVpcsOptions.Builder() + ListBackupPoliciesOptions options = new ListBackupPoliciesOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .classicAccess(true) + .name("my-name") + .tag("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpcsPager pager = new VpcsPager(service, options); + List allResults = new ArrayList<>(); + BackupPoliciesPager pager = new BackupPoliciesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpcsPager(service, options); - List allItems = pager.getAll(); + pager = new BackupPoliciesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -2002,124 +2114,77 @@ public void testListVpcsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcs" }) - public void testCreateVpc() throws Exception { + @Test(dependsOnMethods = { "testListBackupPolicies" }) + public void testCreateBackupPolicy() throws Exception { try { ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); - DNSServerPrototype dnsServerPrototypeModel = new DNSServerPrototype.Builder() - .address("192.168.3.4") - .zoneAffinity(zoneIdentityModel) - .build(); - - VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype vpcdnsResolverPrototypeModel = new VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype.Builder() - .manualServers(java.util.Arrays.asList(dnsServerPrototypeModel)) - .type("manual") - .build(); - - VPCDNSPrototype vpcdnsPrototypeModel = new VPCDNSPrototype.Builder() - .enableHub(false) - .resolver(vpcdnsResolverPrototypeModel) - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + BackupPolicyPlanClonePolicyPrototype backupPolicyPlanClonePolicyPrototypeModel = new BackupPolicyPlanClonePolicyPrototype.Builder() + .maxSnapshots(Long.valueOf("5")) + .zones(java.util.Arrays.asList(zoneIdentityModel)) .build(); - CreateVpcOptions createVpcOptions = new CreateVpcOptions.Builder() - .addressPrefixManagement("auto") - .classicAccess(false) - .dns(vpcdnsPrototypeModel) - .name("my-vpc") - .resourceGroup(resourceGroupIdentityModel) + BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("20")) .build(); - // Invoke operation - Response response = service.createVpc(createVpcOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - VPC vpcResult = response.getResult(); - assertNotNull(vpcResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateVpc" }) - public void testGetVpc() throws Exception { - try { - GetVpcOptions getVpcOptions = new GetVpcOptions.Builder() - .id("testString") + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); - // Invoke operation - Response response = service.getVpc(getVpcOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - VPC vpcResult = response.getResult(); - assertNotNull(vpcResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testGetVpc" }) - public void testUpdateVpc() throws Exception { - try { - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") .build(); - DNSServerPrototype dnsServerPrototypeModel = new DNSServerPrototype.Builder() - .address("192.168.3.4") - .zoneAffinity(zoneIdentityModel) + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("5")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) .build(); - VPCDNSResolverVPCPatchVPCIdentityById vpcdnsResolverVpcPatchModel = new VPCDNSResolverVPCPatchVPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .clonePolicy(backupPolicyPlanClonePolicyPrototypeModel) + .copyUserTags(true) + .cronSpec("30 */2 * * 1-5") + .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) + .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); - VPCDNSResolverPatch vpcdnsResolverPatchModel = new VPCDNSResolverPatch.Builder() - .manualServers(java.util.Arrays.asList(dnsServerPrototypeModel)) - .type("delegated") - .vpc(vpcdnsResolverVpcPatchModel) + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - VPCDNSPatch vpcdnsPatchModel = new VPCDNSPatch.Builder() - .enableHub(true) - .resolver(vpcdnsResolverPatchModel) + BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN backupPolicyScopePrototypeModel = new BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce") .build(); - VPCPatch vpcPatchModel = new VPCPatch.Builder() - .dns(vpcdnsPatchModel) - .name("my-vpc") + BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype backupPolicyPrototypeModel = new BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.Builder() + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) + .name("my-backup-policy") + .plans(java.util.Arrays.asList(backupPolicyPlanPrototypeModel)) + .resourceGroup(resourceGroupIdentityModel) + .scope(backupPolicyScopePrototypeModel) + .matchResourceType("volume") .build(); - Map vpcPatchModelAsPatch = vpcPatchModel.asPatch(); - UpdateVpcOptions updateVpcOptions = new UpdateVpcOptions.Builder() - .id("testString") - .vpcPatch(vpcPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + CreateBackupPolicyOptions createBackupPolicyOptions = new CreateBackupPolicyOptions.Builder() + .backupPolicyPrototype(backupPolicyPrototypeModel) .build(); // Invoke operation - Response response = service.updateVpc(updateVpcOptions).execute(); + Response response = service.createBackupPolicy(createBackupPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - VPC vpcResult = response.getResult(); - assertNotNull(vpcResult); + BackupPolicy backupPolicyResult = response.getResult(); + assertNotNull(backupPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2127,21 +2192,29 @@ public void testUpdateVpc() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpc" }) - public void testGetVpcDefaultNetworkAcl() throws Exception { + @Test(dependsOnMethods = { "testCreateBackupPolicy" }) + public void testListBackupPolicyJobs() throws Exception { try { - GetVpcDefaultNetworkAclOptions getVpcDefaultNetworkAclOptions = new GetVpcDefaultNetworkAclOptions.Builder() - .id("testString") + ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() + .backupPolicyId("testString") + .status("failed") + .backupPolicyPlanId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .sort("name") + .sourceId("testString") + .targetSnapshotsId("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); // Invoke operation - Response response = service.getVpcDefaultNetworkAcl(getVpcDefaultNetworkAclOptions).execute(); + Response response = service.listBackupPolicyJobs(listBackupPolicyJobsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DefaultNetworkACL defaultNetworkAclResult = response.getResult(); - assertNotNull(defaultNetworkAclResult); + BackupPolicyJobCollection backupPolicyJobCollectionResult = response.getResult(); + assertNotNull(backupPolicyJobCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2149,43 +2222,60 @@ public void testGetVpcDefaultNetworkAcl() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpcDefaultNetworkAcl" }) - public void testGetVpcDefaultRoutingTable() throws Exception { + @Test(dependsOnMethods = { "testListBackupPolicyJobs" }) + public void testListBackupPolicyJobsWithPager() throws Exception { try { - GetVpcDefaultRoutingTableOptions getVpcDefaultRoutingTableOptions = new GetVpcDefaultRoutingTableOptions.Builder() - .id("testString") + ListBackupPolicyJobsOptions options = new ListBackupPolicyJobsOptions.Builder() + .backupPolicyId("testString") + .status("failed") + .backupPolicyPlanId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .sourceId("testString") + .targetSnapshotsId("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); - // Invoke operation - Response response = service.getVpcDefaultRoutingTable(getVpcDefaultRoutingTableOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + BackupPolicyJobsPager pager = new BackupPolicyJobsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - DefaultRoutingTable defaultRoutingTableResult = response.getResult(); - assertNotNull(defaultRoutingTableResult); + // Test getAll(); + pager = new BackupPolicyJobsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetVpcDefaultRoutingTable" }) - public void testGetVpcDefaultSecurityGroup() throws Exception { + @Test(dependsOnMethods = { "testListBackupPolicyJobs" }) + public void testGetBackupPolicyJob() throws Exception { try { - GetVpcDefaultSecurityGroupOptions getVpcDefaultSecurityGroupOptions = new GetVpcDefaultSecurityGroupOptions.Builder() + GetBackupPolicyJobOptions getBackupPolicyJobOptions = new GetBackupPolicyJobOptions.Builder() + .backupPolicyId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getVpcDefaultSecurityGroup(getVpcDefaultSecurityGroupOptions).execute(); + Response response = service.getBackupPolicyJob(getBackupPolicyJobOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DefaultSecurityGroup defaultSecurityGroupResult = response.getResult(); - assertNotNull(defaultSecurityGroupResult); + BackupPolicyJob backupPolicyJobResult = response.getResult(); + assertNotNull(backupPolicyJobResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2193,23 +2283,22 @@ public void testGetVpcDefaultSecurityGroup() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpcDefaultSecurityGroup" }) - public void testListVpcAddressPrefixes() throws Exception { + @Test(dependsOnMethods = { "testGetBackupPolicyJob" }) + public void testListBackupPolicyPlans() throws Exception { try { - ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() - .vpcId("testString") - .start("testString") - .limit(Long.valueOf("10")) + ListBackupPolicyPlansOptions listBackupPolicyPlansOptions = new ListBackupPolicyPlansOptions.Builder() + .backupPolicyId("testString") + .name("my-name") .build(); // Invoke operation - Response response = service.listVpcAddressPrefixes(listVpcAddressPrefixesOptions).execute(); + Response response = service.listBackupPolicyPlans(listBackupPolicyPlansOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - AddressPrefixCollection addressPrefixCollectionResult = response.getResult(); - assertNotNull(addressPrefixCollectionResult); + BackupPolicyPlanCollection backupPolicyPlanCollectionResult = response.getResult(); + assertNotNull(backupPolicyPlanCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2217,61 +2306,145 @@ public void testListVpcAddressPrefixes() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcAddressPrefixes" }) - public void testListVpcAddressPrefixesWithPager() throws Exception { - try { - ListVpcAddressPrefixesOptions options = new ListVpcAddressPrefixesOptions.Builder() - .vpcId("testString") - .limit(Long.valueOf("10")) + @Test(dependsOnMethods = { "testListBackupPolicyPlans" }) + public void testCreateBackupPolicyPlan() throws Exception { + try { + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + BackupPolicyPlanClonePolicyPrototype backupPolicyPlanClonePolicyPrototypeModel = new BackupPolicyPlanClonePolicyPrototype.Builder() + .maxSnapshots(Long.valueOf("5")) + .zones(java.util.Arrays.asList(zoneIdentityModel)) + .build(); - // Test getAll(); - pager = new VpcAddressPrefixesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("20")) + .build(); + + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("5")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + + CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions = new CreateBackupPolicyPlanOptions.Builder() + .backupPolicyId("testString") + .cronSpec("30 */2 * * 1-5") + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .clonePolicy(backupPolicyPlanClonePolicyPrototypeModel) + .copyUserTags(true) + .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) + .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) + .build(); + + // Invoke operation + Response response = service.createBackupPolicyPlan(createBackupPolicyPlanOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + BackupPolicyPlan backupPolicyPlanResult = response.getResult(); + assertNotNull(backupPolicyPlanResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListVpcAddressPrefixes" }) - public void testCreateVpcAddressPrefix() throws Exception { + @Test(dependsOnMethods = { "testCreateBackupPolicyPlan" }) + public void testGetBackupPolicyPlan() throws Exception { + try { + GetBackupPolicyPlanOptions getBackupPolicyPlanOptions = new GetBackupPolicyPlanOptions.Builder() + .backupPolicyId("testString") + .id("testString") + .build(); + + // Invoke operation + Response response = service.getBackupPolicyPlan(getBackupPolicyPlanOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + BackupPolicyPlan backupPolicyPlanResult = response.getResult(); + assertNotNull(backupPolicyPlanResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetBackupPolicyPlan" }) + public void testUpdateBackupPolicyPlan() throws Exception { try { ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); - CreateVpcAddressPrefixOptions createVpcAddressPrefixOptions = new CreateVpcAddressPrefixOptions.Builder() - .vpcId("testString") - .cidr("10.240.0.0/18") - .zone(zoneIdentityModel) - .isDefault(true) - .name("my-vpc-address-prefix-zone-1") + BackupPolicyPlanClonePolicyPatch backupPolicyPlanClonePolicyPatchModel = new BackupPolicyPlanClonePolicyPatch.Builder() + .maxSnapshots(Long.valueOf("1")) + .zones(java.util.Arrays.asList(zoneIdentityModel)) + .build(); + + BackupPolicyPlanDeletionTriggerPatch backupPolicyPlanDeletionTriggerPatchModel = new BackupPolicyPlanDeletionTriggerPatch.Builder() + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("1")) + .build(); + + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("5")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + + BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .clonePolicy(backupPolicyPlanClonePolicyPatchModel) + .copyUserTags(false) + .cronSpec("30 */2 * * 1-5") + .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) + .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) + .build(); + Map backupPolicyPlanPatchModelAsPatch = backupPolicyPlanPatchModel.asPatch(); + + UpdateBackupPolicyPlanOptions updateBackupPolicyPlanOptions = new UpdateBackupPolicyPlanOptions.Builder() + .backupPolicyId("testString") + .id("testString") + .backupPolicyPlanPatch(backupPolicyPlanPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.createVpcAddressPrefix(createVpcAddressPrefixOptions).execute(); + Response response = service.updateBackupPolicyPlan(updateBackupPolicyPlanOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - AddressPrefix addressPrefixResult = response.getResult(); - assertNotNull(addressPrefixResult); + BackupPolicyPlan backupPolicyPlanResult = response.getResult(); + assertNotNull(backupPolicyPlanResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2279,22 +2452,21 @@ public void testCreateVpcAddressPrefix() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVpcAddressPrefix" }) - public void testGetVpcAddressPrefix() throws Exception { + @Test(dependsOnMethods = { "testUpdateBackupPolicyPlan" }) + public void testGetBackupPolicy() throws Exception { try { - GetVpcAddressPrefixOptions getVpcAddressPrefixOptions = new GetVpcAddressPrefixOptions.Builder() - .vpcId("testString") + GetBackupPolicyOptions getBackupPolicyOptions = new GetBackupPolicyOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getVpcAddressPrefix(getVpcAddressPrefixOptions).execute(); + Response response = service.getBackupPolicy(getBackupPolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - AddressPrefix addressPrefixResult = response.getResult(); - assertNotNull(addressPrefixResult); + BackupPolicy backupPolicyResult = response.getResult(); + assertNotNull(backupPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2302,29 +2474,30 @@ public void testGetVpcAddressPrefix() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpcAddressPrefix" }) - public void testUpdateVpcAddressPrefix() throws Exception { + @Test(dependsOnMethods = { "testGetBackupPolicy" }) + public void testUpdateBackupPolicy() throws Exception { try { - AddressPrefixPatch addressPrefixPatchModel = new AddressPrefixPatch.Builder() - .isDefault(false) - .name("my-vpc-address-prefix-updated") + BackupPolicyPatch backupPolicyPatchModel = new BackupPolicyPatch.Builder() + .includedContent(java.util.Arrays.asList("data_volumes")) + .matchUserTags(java.util.Arrays.asList("my-tag-1", "my-tag-2", "my-tag-3")) + .name("my-backup-policy") .build(); - Map addressPrefixPatchModelAsPatch = addressPrefixPatchModel.asPatch(); + Map backupPolicyPatchModelAsPatch = backupPolicyPatchModel.asPatch(); - UpdateVpcAddressPrefixOptions updateVpcAddressPrefixOptions = new UpdateVpcAddressPrefixOptions.Builder() - .vpcId("testString") + UpdateBackupPolicyOptions updateBackupPolicyOptions = new UpdateBackupPolicyOptions.Builder() .id("testString") - .addressPrefixPatch(addressPrefixPatchModelAsPatch) + .backupPolicyPatch(backupPolicyPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updateVpcAddressPrefix(updateVpcAddressPrefixOptions).execute(); + Response response = service.updateBackupPolicy(updateBackupPolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - AddressPrefix addressPrefixResult = response.getResult(); - assertNotNull(addressPrefixResult); + BackupPolicy backupPolicyResult = response.getResult(); + assertNotNull(backupPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2332,28 +2505,22 @@ public void testUpdateVpcAddressPrefix() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpcAddressPrefix" }) - public void testListVpcDnsResolutionBindings() throws Exception { + @Test(dependsOnMethods = { "testUpdateBackupPolicy" }) + public void testListBareMetalServerProfiles() throws Exception { try { - ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptions = new ListVpcDnsResolutionBindingsOptions.Builder() - .vpcId("testString") - .sort("name") + ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .name("my-name") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .accountId("bb1b52262f7441a586f49068482f1e60") .build(); // Invoke operation - Response response = service.listVpcDnsResolutionBindings(listVpcDnsResolutionBindingsOptions).execute(); + Response response = service.listBareMetalServerProfiles(listBareMetalServerProfilesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPCDNSResolutionBindingCollection vpcdnsResolutionBindingCollectionResult = response.getResult(); - assertNotNull(vpcdnsResolutionBindingCollectionResult); + BareMetalServerProfileCollection bareMetalServerProfileCollectionResult = response.getResult(); + assertNotNull(bareMetalServerProfileCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2361,32 +2528,26 @@ public void testListVpcDnsResolutionBindings() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcDnsResolutionBindings" }) - public void testListVpcDnsResolutionBindingsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServerProfiles" }) + public void testListBareMetalServerProfilesWithPager() throws Exception { try { - ListVpcDnsResolutionBindingsOptions options = new ListVpcDnsResolutionBindingsOptions.Builder() - .vpcId("testString") - .sort("name") + ListBareMetalServerProfilesOptions options = new ListBareMetalServerProfilesOptions.Builder() .limit(Long.valueOf("10")) - .name("my-name") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .accountId("bb1b52262f7441a586f49068482f1e60") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpcDnsResolutionBindingsPager pager = new VpcDnsResolutionBindingsPager(service, options); + List allResults = new ArrayList<>(); + BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpcDnsResolutionBindingsPager(service, options); - List allItems = pager.getAll(); + pager = new BareMetalServerProfilesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -2398,27 +2559,21 @@ public void testListVpcDnsResolutionBindingsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcDnsResolutionBindings" }) - public void testCreateVpcDnsResolutionBinding() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServerProfiles" }) + public void testGetBareMetalServerProfile() throws Exception { try { - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - CreateVpcDnsResolutionBindingOptions createVpcDnsResolutionBindingOptions = new CreateVpcDnsResolutionBindingOptions.Builder() - .vpcId("testString") - .vpc(vpcIdentityModel) - .name("my-dns-resolution-binding") + GetBareMetalServerProfileOptions getBareMetalServerProfileOptions = new GetBareMetalServerProfileOptions.Builder() + .name("bx2-metal-192x768") .build(); // Invoke operation - Response response = service.createVpcDnsResolutionBinding(createVpcDnsResolutionBindingOptions).execute(); + Response response = service.getBareMetalServerProfile(getBareMetalServerProfileOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - VPCDNSResolutionBinding vpcdnsResolutionBindingResult = response.getResult(); - assertNotNull(vpcdnsResolutionBindingResult); + BareMetalServerProfile bareMetalServerProfileResult = response.getResult(); + assertNotNull(bareMetalServerProfileResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2426,76 +2581,30 @@ public void testCreateVpcDnsResolutionBinding() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVpcDnsResolutionBinding" }) - public void testGetVpcDnsResolutionBinding() throws Exception { + @Test(dependsOnMethods = { "testGetBareMetalServerProfile" }) + public void testListBareMetalServers() throws Exception { try { - GetVpcDnsResolutionBindingOptions getVpcDnsResolutionBindingOptions = new GetVpcDnsResolutionBindingOptions.Builder() - .vpcId("testString") - .id("testString") - .build(); - - // Invoke operation - Response response = service.getVpcDnsResolutionBinding(getVpcDnsResolutionBindingOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - VPCDNSResolutionBinding vpcdnsResolutionBindingResult = response.getResult(); - assertNotNull(vpcdnsResolutionBindingResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testGetVpcDnsResolutionBinding" }) - public void testUpdateVpcDnsResolutionBinding() throws Exception { - try { - VPCDNSResolutionBindingPatch vpcdnsResolutionBindingPatchModel = new VPCDNSResolutionBindingPatch.Builder() - .name("my-dns-resolution-binding-updated") - .build(); - Map vpcdnsResolutionBindingPatchModelAsPatch = vpcdnsResolutionBindingPatchModel.asPatch(); - - UpdateVpcDnsResolutionBindingOptions updateVpcDnsResolutionBindingOptions = new UpdateVpcDnsResolutionBindingOptions.Builder() - .vpcId("testString") - .id("testString") - .vpcdnsResolutionBindingPatch(vpcdnsResolutionBindingPatchModelAsPatch) - .build(); - - // Invoke operation - Response response = service.updateVpcDnsResolutionBinding(updateVpcDnsResolutionBindingOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - VPCDNSResolutionBinding vpcdnsResolutionBindingResult = response.getResult(); - assertNotNull(vpcdnsResolutionBindingResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testUpdateVpcDnsResolutionBinding" }) - public void testListVpcRoutes() throws Exception { - try { - ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() - .vpcId("testString") - .zoneName("us-south-1") + ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .reservationId("testString") + .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .reservationName("my-reservation") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); // Invoke operation - Response response = service.listVpcRoutes(listVpcRoutesOptions).execute(); + Response response = service.listBareMetalServers(listBareMetalServersOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - RouteCollectionVPCContext routeCollectionVpcContextResult = response.getResult(); - assertNotNull(routeCollectionVpcContextResult); + BareMetalServerCollection bareMetalServerCollectionResult = response.getResult(); + assertNotNull(bareMetalServerCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2503,28 +2612,34 @@ public void testListVpcRoutes() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcRoutes" }) - public void testListVpcRoutesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServers" }) + public void testListBareMetalServersWithPager() throws Exception { try { - ListVpcRoutesOptions options = new ListVpcRoutesOptions.Builder() - .vpcId("testString") - .zoneName("us-south-1") + ListBareMetalServersOptions options = new ListBareMetalServersOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .reservationId("testString") + .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .reservationName("my-reservation") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpcRoutesPager pager = new VpcRoutesPager(service, options); + List allResults = new ArrayList<>(); + BareMetalServersPager pager = new BareMetalServersPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpcRoutesPager(service, options); - List allItems = pager.getAll(); + pager = new BareMetalServersPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -2536,36 +2651,142 @@ public void testListVpcRoutesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcRoutes" }) - public void testCreateVpcRoute() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServers" }) + public void testCreateBareMetalServer() throws Exception { try { + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() + .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .build(); + + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") + .build(); + + BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) + .image(imageIdentityModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .userData("testString") + .build(); + + BareMetalServerMetadataServicePrototype bareMetalServerMetadataServicePrototypeModel = new BareMetalServerMetadataServicePrototype.Builder() + .enabled(true) + .protocol("https") + .build(); + + BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() + .name("bx2-metal-192x768") + .build(); + + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .build(); + + BareMetalServerReservationAffinityPrototype bareMetalServerReservationAffinityPrototypeModel = new BareMetalServerReservationAffinityPrototype.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) + .build(); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + BareMetalServerTrustedPlatformModulePrototype bareMetalServerTrustedPlatformModulePrototypeModel = new BareMetalServerTrustedPlatformModulePrototype.Builder() + .mode("disabled") + .build(); + + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); - RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("0.0.0.0") + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") .build(); - CreateVpcRouteOptions createVpcRouteOptions = new CreateVpcRouteOptions.Builder() - .vpcId("testString") - .destination("192.168.3.0/24") + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype bareMetalServerNetworkAttachmentPrototypeModel = new BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.Builder() + .name("my-bare-metal-server-network-attachment") + .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .allowedVlans(java.util.Arrays.asList(Long.valueOf(""))) + .interfaceType("pci") + .build(); + + BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype bareMetalServerPrimaryNetworkAttachmentPrototypeModel = new BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype.Builder() + .name("my-bare-metal-server-network-attachment") + .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .allowedVlans(java.util.Arrays.asList(Long.valueOf(""))) + .interfaceType("pci") + .build(); + + BareMetalServerPrototypeBareMetalServerByNetworkAttachment bareMetalServerPrototypeModel = new BareMetalServerPrototypeBareMetalServerByNetworkAttachment.Builder() + .bandwidth(Long.valueOf("20000")) + .enableSecureBoot(false) + .initialization(bareMetalServerInitializationPrototypeModel) + .metadataService(bareMetalServerMetadataServicePrototypeModel) + .name("my-bare-metal-server") + .profile(bareMetalServerProfileIdentityModel) + .reservationAffinity(bareMetalServerReservationAffinityPrototypeModel) + .resourceGroup(resourceGroupIdentityModel) + .trustedPlatformModule(bareMetalServerTrustedPlatformModulePrototypeModel) + .vpc(vpcIdentityModel) .zone(zoneIdentityModel) - .action("deliver") - .advertise(false) - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPrototypeModel) - .priority(Long.valueOf("1")) + .networkAttachments(java.util.Arrays.asList(bareMetalServerNetworkAttachmentPrototypeModel)) + .primaryNetworkAttachment(bareMetalServerPrimaryNetworkAttachmentPrototypeModel) + .build(); + + CreateBareMetalServerOptions createBareMetalServerOptions = new CreateBareMetalServerOptions.Builder() + .bareMetalServerPrototype(bareMetalServerPrototypeModel) .build(); // Invoke operation - Response response = service.createVpcRoute(createVpcRouteOptions).execute(); + Response response = service.createBareMetalServer(createBareMetalServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - Route routeResult = response.getResult(); - assertNotNull(routeResult); + BareMetalServer bareMetalServerResult = response.getResult(); + assertNotNull(bareMetalServerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2573,22 +2794,23 @@ public void testCreateVpcRoute() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVpcRoute" }) - public void testGetVpcRoute() throws Exception { + @Test(dependsOnMethods = { "testCreateBareMetalServer" }) + public void testCreateBareMetalServerConsoleAccessToken() throws Exception { try { - GetVpcRouteOptions getVpcRouteOptions = new GetVpcRouteOptions.Builder() - .vpcId("testString") - .id("testString") + CreateBareMetalServerConsoleAccessTokenOptions createBareMetalServerConsoleAccessTokenOptions = new CreateBareMetalServerConsoleAccessTokenOptions.Builder() + .bareMetalServerId("testString") + .consoleType("serial") + .force(false) .build(); // Invoke operation - Response response = service.getVpcRoute(getVpcRouteOptions).execute(); + Response response = service.createBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Route routeResult = response.getResult(); - assertNotNull(routeResult); + BareMetalServerConsoleAccessToken bareMetalServerConsoleAccessTokenResult = response.getResult(); + assertNotNull(bareMetalServerConsoleAccessTokenResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2596,35 +2818,44 @@ public void testGetVpcRoute() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpcRoute" }) - public void testUpdateVpcRoute() throws Exception { + @Test(dependsOnMethods = { "testCreateBareMetalServerConsoleAccessToken" }) + public void testListBareMetalServerDisks() throws Exception { try { - RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPatchModel = new RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("10.240.0.12") + ListBareMetalServerDisksOptions listBareMetalServerDisksOptions = new ListBareMetalServerDisksOptions.Builder() + .bareMetalServerId("testString") .build(); - RoutePatch routePatchModel = new RoutePatch.Builder() - .advertise(true) - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPatchModel) - .priority(Long.valueOf("1")) - .build(); - Map routePatchModelAsPatch = routePatchModel.asPatch(); + // Invoke operation + Response response = service.listBareMetalServerDisks(listBareMetalServerDisksOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - UpdateVpcRouteOptions updateVpcRouteOptions = new UpdateVpcRouteOptions.Builder() - .vpcId("testString") + BareMetalServerDiskCollection bareMetalServerDiskCollectionResult = response.getResult(); + assertNotNull(bareMetalServerDiskCollectionResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListBareMetalServerDisks" }) + public void testGetBareMetalServerDisk() throws Exception { + try { + GetBareMetalServerDiskOptions getBareMetalServerDiskOptions = new GetBareMetalServerDiskOptions.Builder() + .bareMetalServerId("testString") .id("testString") - .routePatch(routePatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateVpcRoute(updateVpcRouteOptions).execute(); + Response response = service.getBareMetalServerDisk(getBareMetalServerDiskOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Route routeResult = response.getResult(); - assertNotNull(routeResult); + BareMetalServerDisk bareMetalServerDiskResult = response.getResult(); + assertNotNull(bareMetalServerDiskResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2632,24 +2863,52 @@ public void testUpdateVpcRoute() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpcRoute" }) - public void testListVpcRoutingTables() throws Exception { + @Test(dependsOnMethods = { "testGetBareMetalServerDisk" }) + public void testUpdateBareMetalServerDisk() throws Exception { try { - ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() - .vpcId("testString") + BareMetalServerDiskPatch bareMetalServerDiskPatchModel = new BareMetalServerDiskPatch.Builder() + .name("my-bare-metal-server-disk-updated") + .build(); + Map bareMetalServerDiskPatchModelAsPatch = bareMetalServerDiskPatchModel.asPatch(); + + UpdateBareMetalServerDiskOptions updateBareMetalServerDiskOptions = new UpdateBareMetalServerDiskOptions.Builder() + .bareMetalServerId("testString") + .id("testString") + .bareMetalServerDiskPatch(bareMetalServerDiskPatchModelAsPatch) + .build(); + + // Invoke operation + Response response = service.updateBareMetalServerDisk(updateBareMetalServerDiskOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + BareMetalServerDisk bareMetalServerDiskResult = response.getResult(); + assertNotNull(bareMetalServerDiskResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testUpdateBareMetalServerDisk" }) + public void testListBareMetalServerNetworkAttachments() throws Exception { + try { + ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptions = new ListBareMetalServerNetworkAttachmentsOptions.Builder() + .bareMetalServerId("testString") .start("testString") .limit(Long.valueOf("10")) - .isDefault(true) .build(); // Invoke operation - Response response = service.listVpcRoutingTables(listVpcRoutingTablesOptions).execute(); + Response response = service.listBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - RoutingTableCollection routingTableCollectionResult = response.getResult(); - assertNotNull(routingTableCollectionResult); + BareMetalServerNetworkAttachmentCollection bareMetalServerNetworkAttachmentCollectionResult = response.getResult(); + assertNotNull(bareMetalServerNetworkAttachmentCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2657,28 +2916,27 @@ public void testListVpcRoutingTables() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcRoutingTables" }) - public void testListVpcRoutingTablesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServerNetworkAttachments" }) + public void testListBareMetalServerNetworkAttachmentsWithPager() throws Exception { try { - ListVpcRoutingTablesOptions options = new ListVpcRoutingTablesOptions.Builder() - .vpcId("testString") + ListBareMetalServerNetworkAttachmentsOptions options = new ListBareMetalServerNetworkAttachmentsOptions.Builder() + .bareMetalServerId("testString") .limit(Long.valueOf("10")) - .isDefault(true) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpcRoutingTablesPager pager = new VpcRoutingTablesPager(service, options); + List allResults = new ArrayList<>(); + BareMetalServerNetworkAttachmentsPager pager = new BareMetalServerNetworkAttachmentsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpcRoutingTablesPager(service, options); - List allItems = pager.getAll(); + pager = new BareMetalServerNetworkAttachmentsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -2690,51 +2948,66 @@ public void testListVpcRoutingTablesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcRoutingTables" }) - public void testCreateVpcRoutingTable() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServerNetworkAttachments" }) + public void testCreateBareMetalServerNetworkAttachment() throws Exception { try { - ResourceFilter resourceFilterModel = new ResourceFilter.Builder() - .resourceType("vpn_server") + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") .build(); - RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("0.0.0.0") + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") .build(); - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - RoutePrototype routePrototypeModel = new RoutePrototype.Builder() - .action("deliver") - .advertise(false) - .destination("192.168.3.0/24") - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPrototypeModel) - .priority(Long.valueOf("1")) - .zone(zoneIdentityModel) + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") .build(); - CreateVpcRoutingTableOptions createVpcRoutingTableOptions = new CreateVpcRoutingTableOptions.Builder() - .vpcId("testString") - .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) - .advertiseRoutesTo(java.util.Arrays.asList()) - .name("my-routing-table-1") - .routeDirectLinkIngress(false) - .routeInternetIngress(false) - .routeTransitGatewayIngress(false) - .routeVpcZoneIngress(false) - .routes(java.util.Arrays.asList(routePrototypeModel)) + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype bareMetalServerNetworkAttachmentPrototypeModel = new BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.Builder() + .name("my-bare-metal-server-network-attachment") + .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .allowedVlans(java.util.Arrays.asList(Long.valueOf(""))) + .interfaceType("pci") + .build(); + + CreateBareMetalServerNetworkAttachmentOptions createBareMetalServerNetworkAttachmentOptions = new CreateBareMetalServerNetworkAttachmentOptions.Builder() + .bareMetalServerId("testString") + .bareMetalServerNetworkAttachmentPrototype(bareMetalServerNetworkAttachmentPrototypeModel) .build(); // Invoke operation - Response response = service.createVpcRoutingTable(createVpcRoutingTableOptions).execute(); + Response response = service.createBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - RoutingTable routingTableResult = response.getResult(); - assertNotNull(routingTableResult); + BareMetalServerNetworkAttachment bareMetalServerNetworkAttachmentResult = response.getResult(); + assertNotNull(bareMetalServerNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2742,22 +3015,22 @@ public void testCreateVpcRoutingTable() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVpcRoutingTable" }) - public void testGetVpcRoutingTable() throws Exception { + @Test(dependsOnMethods = { "testCreateBareMetalServerNetworkAttachment" }) + public void testGetBareMetalServerNetworkAttachment() throws Exception { try { - GetVpcRoutingTableOptions getVpcRoutingTableOptions = new GetVpcRoutingTableOptions.Builder() - .vpcId("testString") + GetBareMetalServerNetworkAttachmentOptions getBareMetalServerNetworkAttachmentOptions = new GetBareMetalServerNetworkAttachmentOptions.Builder() + .bareMetalServerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getVpcRoutingTable(getVpcRoutingTableOptions).execute(); + Response response = service.getBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - RoutingTable routingTableResult = response.getResult(); - assertNotNull(routingTableResult); + BareMetalServerNetworkAttachment bareMetalServerNetworkAttachmentResult = response.getResult(); + assertNotNull(bareMetalServerNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2765,39 +3038,29 @@ public void testGetVpcRoutingTable() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpcRoutingTable" }) - public void testUpdateVpcRoutingTable() throws Exception { + @Test(dependsOnMethods = { "testGetBareMetalServerNetworkAttachment" }) + public void testUpdateBareMetalServerNetworkAttachment() throws Exception { try { - ResourceFilter resourceFilterModel = new ResourceFilter.Builder() - .resourceType("vpn_server") - .build(); - - RoutingTablePatch routingTablePatchModel = new RoutingTablePatch.Builder() - .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) - .advertiseRoutesTo(java.util.Arrays.asList("transit_gateway")) - .name("my-routing-table-2") - .routeDirectLinkIngress(true) - .routeInternetIngress(true) - .routeTransitGatewayIngress(true) - .routeVpcZoneIngress(true) + BareMetalServerNetworkAttachmentPatch bareMetalServerNetworkAttachmentPatchModel = new BareMetalServerNetworkAttachmentPatch.Builder() + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .name("my-bare-metal-server-network-attachment-updated") .build(); - Map routingTablePatchModelAsPatch = routingTablePatchModel.asPatch(); + Map bareMetalServerNetworkAttachmentPatchModelAsPatch = bareMetalServerNetworkAttachmentPatchModel.asPatch(); - UpdateVpcRoutingTableOptions updateVpcRoutingTableOptions = new UpdateVpcRoutingTableOptions.Builder() - .vpcId("testString") + UpdateBareMetalServerNetworkAttachmentOptions updateBareMetalServerNetworkAttachmentOptions = new UpdateBareMetalServerNetworkAttachmentOptions.Builder() + .bareMetalServerId("testString") .id("testString") - .routingTablePatch(routingTablePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .bareMetalServerNetworkAttachmentPatch(bareMetalServerNetworkAttachmentPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateVpcRoutingTable(updateVpcRoutingTableOptions).execute(); + Response response = service.updateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - RoutingTable routingTableResult = response.getResult(); - assertNotNull(routingTableResult); + BareMetalServerNetworkAttachment bareMetalServerNetworkAttachmentResult = response.getResult(); + assertNotNull(bareMetalServerNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2805,24 +3068,23 @@ public void testUpdateVpcRoutingTable() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpcRoutingTable" }) - public void testListVpcRoutingTableRoutes() throws Exception { + @Test(dependsOnMethods = { "testUpdateBareMetalServerNetworkAttachment" }) + public void testListBareMetalServerNetworkInterfaces() throws Exception { try { - ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() - .vpcId("testString") - .routingTableId("testString") + ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() + .bareMetalServerId("testString") .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listVpcRoutingTableRoutes(listVpcRoutingTableRoutesOptions).execute(); + Response response = service.listBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - RouteCollection routeCollectionResult = response.getResult(); - assertNotNull(routeCollectionResult); + BareMetalServerNetworkInterfaceCollection bareMetalServerNetworkInterfaceCollectionResult = response.getResult(); + assertNotNull(bareMetalServerNetworkInterfaceCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2830,28 +3092,27 @@ public void testListVpcRoutingTableRoutes() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcRoutingTableRoutes" }) - public void testListVpcRoutingTableRoutesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaces" }) + public void testListBareMetalServerNetworkInterfacesWithPager() throws Exception { try { - ListVpcRoutingTableRoutesOptions options = new ListVpcRoutingTableRoutesOptions.Builder() - .vpcId("testString") - .routingTableId("testString") + ListBareMetalServerNetworkInterfacesOptions options = new ListBareMetalServerNetworkInterfacesOptions.Builder() + .bareMetalServerId("testString") .limit(Long.valueOf("10")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(service, options); + List allResults = new ArrayList<>(); + BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpcRoutingTableRoutesPager(service, options); - List allItems = pager.getAll(); + pager = new BareMetalServerNetworkInterfacesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -2863,37 +3124,46 @@ public void testListVpcRoutingTableRoutesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVpcRoutingTableRoutes" }) - public void testCreateVpcRoutingTableRoute() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaces" }) + public void testCreateBareMetalServerNetworkInterface() throws Exception { try { - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("0.0.0.0") + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") .build(); - CreateVpcRoutingTableRouteOptions createVpcRoutingTableRouteOptions = new CreateVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .destination("192.168.3.0/24") - .zone(zoneIdentityModel) - .action("deliver") - .advertise(false) - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPrototypeModel) - .priority(Long.valueOf("1")) + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() + .allowIpSpoofing(true) + .enableInfrastructureNat(true) + .name("my-bare-metal-server-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .interfaceType("hipersocket") + .build(); + + CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptions = new CreateBareMetalServerNetworkInterfaceOptions.Builder() + .bareMetalServerId("testString") + .bareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototypeModel) .build(); // Invoke operation - Response response = service.createVpcRoutingTableRoute(createVpcRoutingTableRouteOptions).execute(); + Response response = service.createBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - Route routeResult = response.getResult(); - assertNotNull(routeResult); + BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); + assertNotNull(bareMetalServerNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2901,23 +3171,22 @@ public void testCreateVpcRoutingTableRoute() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVpcRoutingTableRoute" }) - public void testGetVpcRoutingTableRoute() throws Exception { + @Test(dependsOnMethods = { "testCreateBareMetalServerNetworkInterface" }) + public void testGetBareMetalServerNetworkInterface() throws Exception { try { - GetVpcRoutingTableRouteOptions getVpcRoutingTableRouteOptions = new GetVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") + GetBareMetalServerNetworkInterfaceOptions getBareMetalServerNetworkInterfaceOptions = new GetBareMetalServerNetworkInterfaceOptions.Builder() + .bareMetalServerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getVpcRoutingTableRoute(getVpcRoutingTableRouteOptions).execute(); + Response response = service.getBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Route routeResult = response.getResult(); - assertNotNull(routeResult); + BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); + assertNotNull(bareMetalServerNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2925,36 +3194,31 @@ public void testGetVpcRoutingTableRoute() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpcRoutingTableRoute" }) - public void testUpdateVpcRoutingTableRoute() throws Exception { + @Test(dependsOnMethods = { "testGetBareMetalServerNetworkInterface" }) + public void testUpdateBareMetalServerNetworkInterface() throws Exception { try { - RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPatchModel = new RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("0.0.0.0") - .build(); - - RoutePatch routePatchModel = new RoutePatch.Builder() - .advertise(false) - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPatchModel) - .priority(Long.valueOf("1")) + BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatchModel = new BareMetalServerNetworkInterfacePatch.Builder() + .allowIpSpoofing(true) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .enableInfrastructureNat(true) + .name("my-bare-metal-server-network-interface") .build(); - Map routePatchModelAsPatch = routePatchModel.asPatch(); + Map bareMetalServerNetworkInterfacePatchModelAsPatch = bareMetalServerNetworkInterfacePatchModel.asPatch(); - UpdateVpcRoutingTableRouteOptions updateVpcRoutingTableRouteOptions = new UpdateVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") + UpdateBareMetalServerNetworkInterfaceOptions updateBareMetalServerNetworkInterfaceOptions = new UpdateBareMetalServerNetworkInterfaceOptions.Builder() + .bareMetalServerId("testString") .id("testString") - .routePatch(routePatchModelAsPatch) + .bareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateVpcRoutingTableRoute(updateVpcRoutingTableRouteOptions).execute(); + Response response = service.updateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Route routeResult = response.getResult(); - assertNotNull(routeResult); + BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); + assertNotNull(bareMetalServerNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2962,29 +3226,22 @@ public void testUpdateVpcRoutingTableRoute() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpcRoutingTableRoute" }) - public void testListSubnets() throws Exception { + @Test(dependsOnMethods = { "testUpdateBareMetalServerNetworkInterface" }) + public void testListBareMetalServerNetworkInterfaceFloatingIps() throws Exception { try { - ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .routingTableId("testString") - .routingTableName("my-routing-table") + ListBareMetalServerNetworkInterfaceFloatingIpsOptions listBareMetalServerNetworkInterfaceFloatingIpsOptions = new ListBareMetalServerNetworkInterfaceFloatingIpsOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") .build(); // Invoke operation - Response response = service.listSubnets(listSubnetsOptions).execute(); + Response response = service.listBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SubnetCollection subnetCollectionResult = response.getResult(); - assertNotNull(subnetCollectionResult); + FloatingIPUnpaginatedCollection floatingIpUnpaginatedCollectionResult = response.getResult(); + assertNotNull(floatingIpUnpaginatedCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -2992,95 +3249,47 @@ public void testListSubnets() throws Exception { } } - @Test(dependsOnMethods = { "testListSubnets" }) - public void testListSubnetsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaceFloatingIps" }) + public void testGetBareMetalServerNetworkInterfaceFloatingIp() throws Exception { try { - ListSubnetsOptions options = new ListSubnetsOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .routingTableId("testString") - .routingTableName("my-routing-table") + GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptions = new GetBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - SubnetsPager pager = new SubnetsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + // Invoke operation + Response response = service.getBareMetalServerNetworkInterfaceFloatingIp(getBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - // Test getAll(); - pager = new SubnetsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + FloatingIP floatingIpResult = response.getResult(); + assertNotNull(floatingIpResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListSubnets" }) - public void testCreateSubnet() throws Exception { + @Test(dependsOnMethods = { "testGetBareMetalServerNetworkInterfaceFloatingIp" }) + public void testAddBareMetalServerNetworkInterfaceFloatingIp() throws Exception { try { - NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") - .build(); - - PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() - .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") - .build(); - - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - SubnetPrototypeSubnetByTotalCount subnetPrototypeModel = new SubnetPrototypeSubnetByTotalCount.Builder() - .ipVersion("ipv4") - .name("my-subnet") - .networkAcl(networkAclIdentityModel) - .publicGateway(publicGatewayIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .routingTable(routingTableIdentityModel) - .vpc(vpcIdentityModel) - .totalIpv4AddressCount(Long.valueOf("256")) - .zone(zoneIdentityModel) - .build(); - - CreateSubnetOptions createSubnetOptions = new CreateSubnetOptions.Builder() - .subnetPrototype(subnetPrototypeModel) + AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptions = new AddBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.createSubnet(createSubnetOptions).execute(); + Response response = service.addBareMetalServerNetworkInterfaceFloatingIp(addBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - Subnet subnetResult = response.getResult(); - assertNotNull(subnetResult); + FloatingIP floatingIpResult = response.getResult(); + assertNotNull(floatingIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3088,21 +3297,22 @@ public void testCreateSubnet() throws Exception { } } - @Test(dependsOnMethods = { "testCreateSubnet" }) - public void testGetSubnet() throws Exception { + @Test(dependsOnMethods = { "testAddBareMetalServerNetworkInterfaceFloatingIp" }) + public void testListBareMetalServerNetworkInterfaceIps() throws Exception { try { - GetSubnetOptions getSubnetOptions = new GetSubnetOptions.Builder() - .id("testString") + ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptions = new ListBareMetalServerNetworkInterfaceIpsOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") .build(); // Invoke operation - Response response = service.getSubnet(getSubnetOptions).execute(); + Response response = service.listBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Subnet subnetResult = response.getResult(); - assertNotNull(subnetResult); + ReservedIPCollectionBareMetalServerNetworkInterfaceContext reservedIpCollectionBareMetalServerNetworkInterfaceContextResult = response.getResult(); + assertNotNull(reservedIpCollectionBareMetalServerNetworkInterfaceContextResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3110,42 +3320,23 @@ public void testGetSubnet() throws Exception { } } - @Test(dependsOnMethods = { "testGetSubnet" }) - public void testUpdateSubnet() throws Exception { + @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaceIps" }) + public void testGetBareMetalServerNetworkInterfaceIp() throws Exception { try { - NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") - .build(); - - SubnetPublicGatewayPatchPublicGatewayIdentityById subnetPublicGatewayPatchModel = new SubnetPublicGatewayPatchPublicGatewayIdentityById.Builder() - .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") - .build(); - - RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") - .build(); - - SubnetPatch subnetPatchModel = new SubnetPatch.Builder() - .name("my-subnet") - .networkAcl(networkAclIdentityModel) - .publicGateway(subnetPublicGatewayPatchModel) - .routingTable(routingTableIdentityModel) - .build(); - Map subnetPatchModelAsPatch = subnetPatchModel.asPatch(); - - UpdateSubnetOptions updateSubnetOptions = new UpdateSubnetOptions.Builder() + GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptions = new GetBareMetalServerNetworkInterfaceIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") .id("testString") - .subnetPatch(subnetPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateSubnet(updateSubnetOptions).execute(); + Response response = service.getBareMetalServerNetworkInterfaceIp(getBareMetalServerNetworkInterfaceIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Subnet subnetResult = response.getResult(); - assertNotNull(subnetResult); + ReservedIP reservedIpResult = response.getResult(); + assertNotNull(reservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3153,21 +3344,21 @@ public void testUpdateSubnet() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateSubnet" }) - public void testGetSubnetNetworkAcl() throws Exception { + @Test(dependsOnMethods = { "testGetBareMetalServerNetworkInterfaceIp" }) + public void testGetBareMetalServer() throws Exception { try { - GetSubnetNetworkAclOptions getSubnetNetworkAclOptions = new GetSubnetNetworkAclOptions.Builder() + GetBareMetalServerOptions getBareMetalServerOptions = new GetBareMetalServerOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getSubnetNetworkAcl(getSubnetNetworkAclOptions).execute(); + Response response = service.getBareMetalServer(getBareMetalServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - NetworkACL networkAclResult = response.getResult(); - assertNotNull(networkAclResult); + BareMetalServer bareMetalServerResult = response.getResult(); + assertNotNull(bareMetalServerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3175,26 +3366,50 @@ public void testGetSubnetNetworkAcl() throws Exception { } } - @Test(dependsOnMethods = { "testGetSubnetNetworkAcl" }) - public void testReplaceSubnetNetworkAcl() throws Exception { + @Test(dependsOnMethods = { "testGetBareMetalServer" }) + public void testUpdateBareMetalServer() throws Exception { try { - NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") + BareMetalServerMetadataServicePatch bareMetalServerMetadataServicePatchModel = new BareMetalServerMetadataServicePatch.Builder() + .enabled(true) + .protocol("http") .build(); - ReplaceSubnetNetworkAclOptions replaceSubnetNetworkAclOptions = new ReplaceSubnetNetworkAclOptions.Builder() + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .build(); + + BareMetalServerReservationAffinityPatch bareMetalServerReservationAffinityPatchModel = new BareMetalServerReservationAffinityPatch.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) + .build(); + + BareMetalServerTrustedPlatformModulePatch bareMetalServerTrustedPlatformModulePatchModel = new BareMetalServerTrustedPlatformModulePatch.Builder() + .mode("disabled") + .build(); + + BareMetalServerPatch bareMetalServerPatchModel = new BareMetalServerPatch.Builder() + .bandwidth(Long.valueOf("20000")) + .enableSecureBoot(false) + .metadataService(bareMetalServerMetadataServicePatchModel) + .name("my-bare-metal-server") + .reservationAffinity(bareMetalServerReservationAffinityPatchModel) + .trustedPlatformModule(bareMetalServerTrustedPlatformModulePatchModel) + .build(); + Map bareMetalServerPatchModelAsPatch = bareMetalServerPatchModel.asPatch(); + + UpdateBareMetalServerOptions updateBareMetalServerOptions = new UpdateBareMetalServerOptions.Builder() .id("testString") - .networkAclIdentity(networkAclIdentityModel) + .bareMetalServerPatch(bareMetalServerPatchModelAsPatch) .build(); // Invoke operation - Response response = service.replaceSubnetNetworkAcl(replaceSubnetNetworkAclOptions).execute(); + Response response = service.updateBareMetalServer(updateBareMetalServerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - NetworkACL networkAclResult = response.getResult(); - assertNotNull(networkAclResult); + BareMetalServer bareMetalServerResult = response.getResult(); + assertNotNull(bareMetalServerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3202,48 +3417,40 @@ public void testReplaceSubnetNetworkAcl() throws Exception { } } - @Test(dependsOnMethods = { "testReplaceSubnetNetworkAcl" }) - public void testGetSubnetPublicGateway() throws Exception { + @Test(dependsOnMethods = { "testUpdateBareMetalServer" }) + public void testUpdateFirmwareForBareMetalServer() throws Exception { try { - GetSubnetPublicGatewayOptions getSubnetPublicGatewayOptions = new GetSubnetPublicGatewayOptions.Builder() + UpdateFirmwareForBareMetalServerOptions updateFirmwareForBareMetalServerOptions = new UpdateFirmwareForBareMetalServerOptions.Builder() .id("testString") + .autoStart(true) .build(); // Invoke operation - Response response = service.getSubnetPublicGateway(getSubnetPublicGatewayOptions).execute(); + Response response = service.updateFirmwareForBareMetalServer(updateFirmwareForBareMetalServerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - PublicGateway publicGatewayResult = response.getResult(); - assertNotNull(publicGatewayResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetSubnetPublicGateway" }) - public void testSetSubnetPublicGateway() throws Exception { + @Test(dependsOnMethods = { "testUpdateFirmwareForBareMetalServer" }) + public void testGetBareMetalServerInitialization() throws Exception { try { - PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() - .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") - .build(); - - SetSubnetPublicGatewayOptions setSubnetPublicGatewayOptions = new SetSubnetPublicGatewayOptions.Builder() + GetBareMetalServerInitializationOptions getBareMetalServerInitializationOptions = new GetBareMetalServerInitializationOptions.Builder() .id("testString") - .publicGatewayIdentity(publicGatewayIdentityModel) .build(); // Invoke operation - Response response = service.setSubnetPublicGateway(setSubnetPublicGatewayOptions).execute(); + Response response = service.getBareMetalServerInitialization(getBareMetalServerInitializationOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - PublicGateway publicGatewayResult = response.getResult(); - assertNotNull(publicGatewayResult); + BareMetalServerInitialization bareMetalServerInitializationResult = response.getResult(); + assertNotNull(bareMetalServerInitializationResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3251,21 +3458,42 @@ public void testSetSubnetPublicGateway() throws Exception { } } - @Test(dependsOnMethods = { "testSetSubnetPublicGateway" }) - public void testGetSubnetRoutingTable() throws Exception { + @Test(dependsOnMethods = { "testGetBareMetalServerInitialization" }) + public void testReplaceBareMetalServerInitialization() throws Exception { try { - GetSubnetRoutingTableOptions getSubnetRoutingTableOptions = new GetSubnetRoutingTableOptions.Builder() + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() + .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .build(); + + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") + .build(); + + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + + ReplaceBareMetalServerInitializationOptions replaceBareMetalServerInitializationOptions = new ReplaceBareMetalServerInitializationOptions.Builder() .id("testString") + .image(imageIdentityModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) + .userData("testString") .build(); // Invoke operation - Response response = service.getSubnetRoutingTable(getSubnetRoutingTableOptions).execute(); + Response response = service.replaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - RoutingTable routingTableResult = response.getResult(); - assertNotNull(routingTableResult); + BareMetalServerInitialization bareMetalServerInitializationResult = response.getResult(); + assertNotNull(bareMetalServerInitializationResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3273,55 +3501,77 @@ public void testGetSubnetRoutingTable() throws Exception { } } - @Test(dependsOnMethods = { "testGetSubnetRoutingTable" }) - public void testReplaceSubnetRoutingTable() throws Exception { + @Test(dependsOnMethods = { "testReplaceBareMetalServerInitialization" }) + public void testRestartBareMetalServer() throws Exception { try { - RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") + RestartBareMetalServerOptions restartBareMetalServerOptions = new RestartBareMetalServerOptions.Builder() + .id("testString") .build(); - ReplaceSubnetRoutingTableOptions replaceSubnetRoutingTableOptions = new ReplaceSubnetRoutingTableOptions.Builder() + // Invoke operation + Response response = service.restartBareMetalServer(restartBareMetalServerOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testRestartBareMetalServer" }) + public void testStartBareMetalServer() throws Exception { + try { + StartBareMetalServerOptions startBareMetalServerOptions = new StartBareMetalServerOptions.Builder() .id("testString") - .routingTableIdentity(routingTableIdentityModel) .build(); // Invoke operation - Response response = service.replaceSubnetRoutingTable(replaceSubnetRoutingTableOptions).execute(); + Response response = service.startBareMetalServer(startBareMetalServerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - RoutingTable routingTableResult = response.getResult(); - assertNotNull(routingTableResult); + @Test(dependsOnMethods = { "testStartBareMetalServer" }) + public void testStopBareMetalServer() throws Exception { + try { + StopBareMetalServerOptions stopBareMetalServerOptions = new StopBareMetalServerOptions.Builder() + .id("testString") + .type("hard") + .build(); + // Invoke operation + Response response = service.stopBareMetalServer(stopBareMetalServerOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testReplaceSubnetRoutingTable" }) - public void testListSubnetReservedIps() throws Exception { + @Test(dependsOnMethods = { "testStopBareMetalServer" }) + public void testListClusterNetworkProfiles() throws Exception { try { - ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() - .subnetId("testString") + ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptions = new ListClusterNetworkProfilesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); // Invoke operation - Response response = service.listSubnetReservedIps(listSubnetReservedIpsOptions).execute(); + Response response = service.listClusterNetworkProfiles(listClusterNetworkProfilesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ReservedIPCollection reservedIpCollectionResult = response.getResult(); - assertNotNull(reservedIpCollectionResult); + ClusterNetworkProfileCollection clusterNetworkProfileCollectionResult = response.getResult(); + assertNotNull(clusterNetworkProfileCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3329,32 +3579,26 @@ public void testListSubnetReservedIps() throws Exception { } } - @Test(dependsOnMethods = { "testListSubnetReservedIps" }) - public void testListSubnetReservedIpsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworkProfiles" }) + public void testListClusterNetworkProfilesWithPager() throws Exception { try { - ListSubnetReservedIpsOptions options = new ListSubnetReservedIpsOptions.Builder() - .subnetId("testString") + ListClusterNetworkProfilesOptions options = new ListClusterNetworkProfilesOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - SubnetReservedIpsPager pager = new SubnetReservedIpsPager(service, options); + List allResults = new ArrayList<>(); + ClusterNetworkProfilesPager pager = new ClusterNetworkProfilesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new SubnetReservedIpsPager(service, options); - List allItems = pager.getAll(); + pager = new ClusterNetworkProfilesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -3366,29 +3610,21 @@ public void testListSubnetReservedIpsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListSubnetReservedIps" }) - public void testCreateSubnetReservedIp() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworkProfiles" }) + public void testGetClusterNetworkProfile() throws Exception { try { - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById reservedIpTargetPrototypeModel = new ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.Builder() - .id("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0") - .build(); - - CreateSubnetReservedIpOptions createSubnetReservedIpOptions = new CreateSubnetReservedIpOptions.Builder() - .subnetId("testString") - .address("192.168.3.4") - .autoDelete(false) - .name("my-reserved-ip") - .target(reservedIpTargetPrototypeModel) + GetClusterNetworkProfileOptions getClusterNetworkProfileOptions = new GetClusterNetworkProfileOptions.Builder() + .name("h100") .build(); // Invoke operation - Response response = service.createSubnetReservedIp(createSubnetReservedIpOptions).execute(); + Response response = service.getClusterNetworkProfile(getClusterNetworkProfileOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - ReservedIP reservedIpResult = response.getResult(); - assertNotNull(reservedIpResult); + ClusterNetworkProfile clusterNetworkProfileResult = response.getResult(); + assertNotNull(clusterNetworkProfileResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3396,22 +3632,28 @@ public void testCreateSubnetReservedIp() throws Exception { } } - @Test(dependsOnMethods = { "testCreateSubnetReservedIp" }) - public void testGetSubnetReservedIp() throws Exception { + @Test(dependsOnMethods = { "testGetClusterNetworkProfile" }) + public void testListClusterNetworks() throws Exception { try { - GetSubnetReservedIpOptions getSubnetReservedIpOptions = new GetSubnetReservedIpOptions.Builder() - .subnetId("testString") - .id("testString") + ListClusterNetworksOptions listClusterNetworksOptions = new ListClusterNetworksOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .sort("name") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); // Invoke operation - Response response = service.getSubnetReservedIp(getSubnetReservedIpOptions).execute(); + Response response = service.listClusterNetworks(listClusterNetworksOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ReservedIP reservedIpResult = response.getResult(); - assertNotNull(reservedIpResult); + ClusterNetworkCollection clusterNetworkCollectionResult = response.getResult(); + assertNotNull(clusterNetworkCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3419,29 +3661,83 @@ public void testGetSubnetReservedIp() throws Exception { } } - @Test(dependsOnMethods = { "testGetSubnetReservedIp" }) - public void testUpdateSubnetReservedIp() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworks" }) + public void testListClusterNetworksWithPager() throws Exception { try { - ReservedIPPatch reservedIpPatchModel = new ReservedIPPatch.Builder() - .autoDelete(false) - .name("my-reserved-ip-updated") + ListClusterNetworksOptions options = new ListClusterNetworksOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .sort("name") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); - Map reservedIpPatchModelAsPatch = reservedIpPatchModel.asPatch(); - UpdateSubnetReservedIpOptions updateSubnetReservedIpOptions = new UpdateSubnetReservedIpOptions.Builder() - .subnetId("testString") - .id("testString") - .reservedIpPatch(reservedIpPatchModelAsPatch) + // Test getNext(). + List allResults = new ArrayList<>(); + ClusterNetworksPager pager = new ClusterNetworksPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new ClusterNetworksPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListClusterNetworks" }) + public void testCreateClusterNetwork() throws Exception { + try { + ClusterNetworkProfileIdentityByName clusterNetworkProfileIdentityModel = new ClusterNetworkProfileIdentityByName.Builder() + .name("h100") + .build(); + + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + ClusterNetworkSubnetPrefixPrototype clusterNetworkSubnetPrefixPrototypeModel = new ClusterNetworkSubnetPrefixPrototype.Builder() + .cidr("10.0.0.0/24") + .build(); + + CreateClusterNetworkOptions createClusterNetworkOptions = new CreateClusterNetworkOptions.Builder() + .profile(clusterNetworkProfileIdentityModel) + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .name("my-cluster-network") + .resourceGroup(resourceGroupIdentityModel) + .subnetPrefixes(java.util.Arrays.asList(clusterNetworkSubnetPrefixPrototypeModel)) .build(); // Invoke operation - Response response = service.updateSubnetReservedIp(updateSubnetReservedIpOptions).execute(); + Response response = service.createClusterNetwork(createClusterNetworkOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - ReservedIP reservedIpResult = response.getResult(); - assertNotNull(reservedIpResult); + ClusterNetwork clusterNetworkResult = response.getResult(); + assertNotNull(clusterNetworkResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3449,28 +3745,25 @@ public void testUpdateSubnetReservedIp() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateSubnetReservedIp" }) - public void testListImages() throws Exception { + @Test(dependsOnMethods = { "testCreateClusterNetwork" }) + public void testListClusterNetworkInterfaces() throws Exception { try { - ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() + ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptions = new ListClusterNetworkInterfacesOptions.Builder() + .clusterNetworkId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .name("my-name") - .status(java.util.Arrays.asList("available")) - .visibility("private") - .userDataFormat(java.util.Arrays.asList("cloud_init")) - .remoteAccountId("bb1b52262f7441a586f49068482f1e60") + .sort("name") .build(); // Invoke operation - Response response = service.listImages(listImagesOptions).execute(); + Response response = service.listClusterNetworkInterfaces(listClusterNetworkInterfacesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ImageCollection imageCollectionResult = response.getResult(); - assertNotNull(imageCollectionResult); + ClusterNetworkInterfaceCollection clusterNetworkInterfaceCollectionResult = response.getResult(); + assertNotNull(clusterNetworkInterfaceCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3478,32 +3771,29 @@ public void testListImages() throws Exception { } } - @Test(dependsOnMethods = { "testListImages" }) - public void testListImagesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworkInterfaces" }) + public void testListClusterNetworkInterfacesWithPager() throws Exception { try { - ListImagesOptions options = new ListImagesOptions.Builder() + ListClusterNetworkInterfacesOptions options = new ListClusterNetworkInterfacesOptions.Builder() + .clusterNetworkId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .name("my-name") - .status(java.util.Arrays.asList("available")) - .visibility("private") - .userDataFormat(java.util.Arrays.asList("cloud_init")) - .remoteAccountId("bb1b52262f7441a586f49068482f1e60") + .sort("name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - ImagesPager pager = new ImagesPager(service, options); + List allResults = new ArrayList<>(); + ClusterNetworkInterfacesPager pager = new ClusterNetworkInterfacesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new ImagesPager(service, options); - List allItems = pager.getAll(); + pager = new ClusterNetworkInterfacesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -3515,48 +3805,34 @@ public void testListImagesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListImages" }) - public void testCreateImage() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworkInterfaces" }) + public void testCreateClusterNetworkInterface() throws Exception { try { - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - ImageFilePrototype imageFilePrototypeModel = new ImageFilePrototype.Builder() - .href("cos://us-south/my-bucket/my-image.qcow2") - .build(); - - OperatingSystemIdentityByName operatingSystemIdentityModel = new OperatingSystemIdentityByName.Builder() - .name("debian-9-amd64") + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") .build(); - ImagePrototypeImageByFile imagePrototypeModel = new ImagePrototypeImageByFile.Builder() - .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .name("my-image") - .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resourceGroup(resourceGroupIdentityModel) - .encryptedDataKey("testString") - .encryptionKey(encryptionKeyIdentityModel) - .file(imageFilePrototypeModel) - .operatingSystem(operatingSystemIdentityModel) + ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() + .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") .build(); - CreateImageOptions createImageOptions = new CreateImageOptions.Builder() - .imagePrototype(imagePrototypeModel) + CreateClusterNetworkInterfaceOptions createClusterNetworkInterfaceOptions = new CreateClusterNetworkInterfaceOptions.Builder() + .clusterNetworkId("testString") + .name("my-cluster-network-interface") + .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) + .subnet(clusterNetworkSubnetIdentityModel) .build(); // Invoke operation - Response response = service.createImage(createImageOptions).execute(); + Response response = service.createClusterNetworkInterface(createClusterNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - Image imageResult = response.getResult(); - assertNotNull(imageResult); + ClusterNetworkInterface clusterNetworkInterfaceResult = response.getResult(); + assertNotNull(clusterNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3564,21 +3840,22 @@ public void testCreateImage() throws Exception { } } - @Test(dependsOnMethods = { "testCreateImage" }) - public void testGetImage() throws Exception { + @Test(dependsOnMethods = { "testCreateClusterNetworkInterface" }) + public void testGetClusterNetworkInterface() throws Exception { try { - GetImageOptions getImageOptions = new GetImageOptions.Builder() + GetClusterNetworkInterfaceOptions getClusterNetworkInterfaceOptions = new GetClusterNetworkInterfaceOptions.Builder() + .clusterNetworkId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getImage(getImageOptions).execute(); + Response response = service.getClusterNetworkInterface(getClusterNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Image imageResult = response.getResult(); - assertNotNull(imageResult); + ClusterNetworkInterface clusterNetworkInterfaceResult = response.getResult(); + assertNotNull(clusterNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3586,29 +3863,30 @@ public void testGetImage() throws Exception { } } - @Test(dependsOnMethods = { "testGetImage" }) - public void testUpdateImage() throws Exception { + @Test(dependsOnMethods = { "testGetClusterNetworkInterface" }) + public void testUpdateClusterNetworkInterface() throws Exception { try { - ImagePatch imagePatchModel = new ImagePatch.Builder() - .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .name("my-image") - .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + ClusterNetworkInterfacePatch clusterNetworkInterfacePatchModel = new ClusterNetworkInterfacePatch.Builder() + .autoDelete(false) + .name("my-cluster-network-interface") .build(); - Map imagePatchModelAsPatch = imagePatchModel.asPatch(); + Map clusterNetworkInterfacePatchModelAsPatch = clusterNetworkInterfacePatchModel.asPatch(); - UpdateImageOptions updateImageOptions = new UpdateImageOptions.Builder() + UpdateClusterNetworkInterfaceOptions updateClusterNetworkInterfaceOptions = new UpdateClusterNetworkInterfaceOptions.Builder() + .clusterNetworkId("testString") .id("testString") - .imagePatch(imagePatchModelAsPatch) + .clusterNetworkInterfacePatch(clusterNetworkInterfacePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updateImage(updateImageOptions).execute(); + Response response = service.updateClusterNetworkInterface(updateClusterNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Image imageResult = response.getResult(); - assertNotNull(imageResult); + ClusterNetworkInterface clusterNetworkInterfaceResult = response.getResult(); + assertNotNull(clusterNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3616,139 +3894,88 @@ public void testUpdateImage() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateImage" }) - public void testDeprecateImage() throws Exception { + @Test(dependsOnMethods = { "testUpdateClusterNetworkInterface" }) + public void testListClusterNetworkSubnets() throws Exception { try { - DeprecateImageOptions deprecateImageOptions = new DeprecateImageOptions.Builder() - .id("testString") + ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptions = new ListClusterNetworkSubnetsOptions.Builder() + .clusterNetworkId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") .build(); // Invoke operation - Response response = service.deprecateImage(deprecateImageOptions).execute(); + Response response = service.listClusterNetworkSubnets(listClusterNetworkSubnetsOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + assertEquals(response.getStatusCode(), 200); - @Test(dependsOnMethods = { "testDeprecateImage" }) - public void testObsoleteImage() throws Exception { - try { - ObsoleteImageOptions obsoleteImageOptions = new ObsoleteImageOptions.Builder() - .id("testString") - .build(); + ClusterNetworkSubnetCollection clusterNetworkSubnetCollectionResult = response.getResult(); + assertNotNull(clusterNetworkSubnetCollectionResult); - // Invoke operation - Response response = service.obsoleteImage(obsoleteImageOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testObsoleteImage" }) - public void testListImageExportJobs() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworkSubnets" }) + public void testListClusterNetworkSubnetsWithPager() throws Exception { try { - ListImageExportJobsOptions listImageExportJobsOptions = new ListImageExportJobsOptions.Builder() - .imageId("testString") + ListClusterNetworkSubnetsOptions options = new ListClusterNetworkSubnetsOptions.Builder() + .clusterNetworkId("testString") + .limit(Long.valueOf("10")) .name("my-name") + .sort("name") .build(); - // Invoke operation - Response response = service.listImageExportJobs(listImageExportJobsOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - ImageExportJobUnpaginatedCollection imageExportJobUnpaginatedCollectionResult = response.getResult(); - assertNotNull(imageExportJobUnpaginatedCollectionResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListImageExportJobs" }) - public void testCreateImageExportJob() throws Exception { - try { - CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName cloudObjectStorageBucketIdentityModel = new CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() - .name("bucket-27200-lwx4cfvcue") - .build(); - - CreateImageExportJobOptions createImageExportJobOptions = new CreateImageExportJobOptions.Builder() - .imageId("testString") - .storageBucket(cloudObjectStorageBucketIdentityModel) - .format("qcow2") - .name("my-image-export") - .build(); - - // Invoke operation - Response response = service.createImageExportJob(createImageExportJobOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - ImageExportJob imageExportJobResult = response.getResult(); - assertNotNull(imageExportJobResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateImageExportJob" }) - public void testGetImageExportJob() throws Exception { - try { - GetImageExportJobOptions getImageExportJobOptions = new GetImageExportJobOptions.Builder() - .imageId("testString") - .id("testString") - .build(); - - // Invoke operation - Response response = service.getImageExportJob(getImageExportJobOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + ClusterNetworkSubnetsPager pager = new ClusterNetworkSubnetsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - ImageExportJob imageExportJobResult = response.getResult(); - assertNotNull(imageExportJobResult); + // Test getAll(); + pager = new ClusterNetworkSubnetsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetImageExportJob" }) - public void testUpdateImageExportJob() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworkSubnets" }) + public void testCreateClusterNetworkSubnet() throws Exception { try { - ImageExportJobPatch imageExportJobPatchModel = new ImageExportJobPatch.Builder() - .name("my-image-export-job-updated") + ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype clusterNetworkSubnetPrototypeModel = new ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype.Builder() + .ipVersion("ipv4") + .name("my-cluster-network-subnet") + .totalIpv4AddressCount(Long.valueOf("256")) .build(); - Map imageExportJobPatchModelAsPatch = imageExportJobPatchModel.asPatch(); - UpdateImageExportJobOptions updateImageExportJobOptions = new UpdateImageExportJobOptions.Builder() - .imageId("testString") - .id("testString") - .imageExportJobPatch(imageExportJobPatchModelAsPatch) + CreateClusterNetworkSubnetOptions createClusterNetworkSubnetOptions = new CreateClusterNetworkSubnetOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetPrototype(clusterNetworkSubnetPrototypeModel) .build(); // Invoke operation - Response response = service.updateImageExportJob(updateImageExportJobOptions).execute(); + Response response = service.createClusterNetworkSubnet(createClusterNetworkSubnetOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - ImageExportJob imageExportJobResult = response.getResult(); - assertNotNull(imageExportJobResult); + ClusterNetworkSubnet clusterNetworkSubnetResult = response.getResult(); + assertNotNull(clusterNetworkSubnetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3756,22 +3983,26 @@ public void testUpdateImageExportJob() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateImageExportJob" }) - public void testListOperatingSystems() throws Exception { + @Test(dependsOnMethods = { "testCreateClusterNetworkSubnet" }) + public void testListClusterNetworkSubnetReservedIps() throws Exception { try { - ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() + ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptions = new ListClusterNetworkSubnetReservedIpsOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .start("testString") .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") .build(); // Invoke operation - Response response = service.listOperatingSystems(listOperatingSystemsOptions).execute(); + Response response = service.listClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - OperatingSystemCollection operatingSystemCollectionResult = response.getResult(); - assertNotNull(operatingSystemCollectionResult); + ClusterNetworkSubnetReservedIPCollection clusterNetworkSubnetReservedIpCollectionResult = response.getResult(); + assertNotNull(clusterNetworkSubnetReservedIpCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3779,26 +4010,30 @@ public void testListOperatingSystems() throws Exception { } } - @Test(dependsOnMethods = { "testListOperatingSystems" }) - public void testListOperatingSystemsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworkSubnetReservedIps" }) + public void testListClusterNetworkSubnetReservedIpsWithPager() throws Exception { try { - ListOperatingSystemsOptions options = new ListOperatingSystemsOptions.Builder() + ListClusterNetworkSubnetReservedIpsOptions options = new ListClusterNetworkSubnetReservedIpsOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - OperatingSystemsPager pager = new OperatingSystemsPager(service, options); + List allResults = new ArrayList<>(); + ClusterNetworkSubnetReservedIpsPager pager = new ClusterNetworkSubnetReservedIpsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new OperatingSystemsPager(service, options); - List allItems = pager.getAll(); + pager = new ClusterNetworkSubnetReservedIpsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -3810,21 +4045,24 @@ public void testListOperatingSystemsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListOperatingSystems" }) - public void testGetOperatingSystem() throws Exception { + @Test(dependsOnMethods = { "testListClusterNetworkSubnetReservedIps" }) + public void testCreateClusterNetworkSubnetReservedIp() throws Exception { try { - GetOperatingSystemOptions getOperatingSystemOptions = new GetOperatingSystemOptions.Builder() - .name("red-7-amd64") + CreateClusterNetworkSubnetReservedIpOptions createClusterNetworkSubnetReservedIpOptions = new CreateClusterNetworkSubnetReservedIpOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") + .address("192.168.3.4") + .name("my-cluster-network-subnet-reserved-ip") .build(); // Invoke operation - Response response = service.getOperatingSystem(getOperatingSystemOptions).execute(); + Response response = service.createClusterNetworkSubnetReservedIp(createClusterNetworkSubnetReservedIpOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - OperatingSystem operatingSystemResult = response.getResult(); - assertNotNull(operatingSystemResult); + ClusterNetworkSubnetReservedIP clusterNetworkSubnetReservedIpResult = response.getResult(); + assertNotNull(clusterNetworkSubnetReservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3832,23 +4070,23 @@ public void testGetOperatingSystem() throws Exception { } } - @Test(dependsOnMethods = { "testGetOperatingSystem" }) - public void testListKeys() throws Exception { + @Test(dependsOnMethods = { "testCreateClusterNetworkSubnetReservedIp" }) + public void testGetClusterNetworkSubnetReservedIp() throws Exception { try { - ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") + GetClusterNetworkSubnetReservedIpOptions getClusterNetworkSubnetReservedIpOptions = new GetClusterNetworkSubnetReservedIpOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.listKeys(listKeysOptions).execute(); + Response response = service.getClusterNetworkSubnetReservedIp(getClusterNetworkSubnetReservedIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - KeyCollection keyCollectionResult = response.getResult(); - assertNotNull(keyCollectionResult); + ClusterNetworkSubnetReservedIP clusterNetworkSubnetReservedIpResult = response.getResult(); + assertNotNull(clusterNetworkSubnetReservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3856,60 +4094,54 @@ public void testListKeys() throws Exception { } } - @Test(dependsOnMethods = { "testListKeys" }) - public void testListKeysWithPager() throws Exception { + @Test(dependsOnMethods = { "testGetClusterNetworkSubnetReservedIp" }) + public void testUpdateClusterNetworkSubnetReservedIp() throws Exception { try { - ListKeysOptions options = new ListKeysOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") + ClusterNetworkSubnetReservedIPPatch clusterNetworkSubnetReservedIpPatchModel = new ClusterNetworkSubnetReservedIPPatch.Builder() + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") .build(); + Map clusterNetworkSubnetReservedIpPatchModelAsPatch = clusterNetworkSubnetReservedIpPatchModel.asPatch(); - // Test getNext(). - List allResults = new ArrayList<>(); - KeysPager pager = new KeysPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + UpdateClusterNetworkSubnetReservedIpOptions updateClusterNetworkSubnetReservedIpOptions = new UpdateClusterNetworkSubnetReservedIpOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") + .id("testString") + .clusterNetworkSubnetReservedIpPatch(clusterNetworkSubnetReservedIpPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); - // Test getAll(); - pager = new KeysPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + // Invoke operation + Response response = service.updateClusterNetworkSubnetReservedIp(updateClusterNetworkSubnetReservedIpOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + ClusterNetworkSubnetReservedIP clusterNetworkSubnetReservedIpResult = response.getResult(); + assertNotNull(clusterNetworkSubnetReservedIpResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListKeys" }) - public void testCreateKey() throws Exception { + @Test(dependsOnMethods = { "testUpdateClusterNetworkSubnetReservedIp" }) + public void testGetClusterNetworkSubnet() throws Exception { try { - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - CreateKeyOptions createKeyOptions = new CreateKeyOptions.Builder() - .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En") - .name("my-key-1") - .resourceGroup(resourceGroupIdentityModel) - .type("rsa") + GetClusterNetworkSubnetOptions getClusterNetworkSubnetOptions = new GetClusterNetworkSubnetOptions.Builder() + .clusterNetworkId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.createKey(createKeyOptions).execute(); + Response response = service.getClusterNetworkSubnet(getClusterNetworkSubnetOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - Key keyResult = response.getResult(); - assertNotNull(keyResult); + ClusterNetworkSubnet clusterNetworkSubnetResult = response.getResult(); + assertNotNull(clusterNetworkSubnetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3917,21 +4149,29 @@ public void testCreateKey() throws Exception { } } - @Test(dependsOnMethods = { "testCreateKey" }) - public void testGetKey() throws Exception { + @Test(dependsOnMethods = { "testGetClusterNetworkSubnet" }) + public void testUpdateClusterNetworkSubnet() throws Exception { try { - GetKeyOptions getKeyOptions = new GetKeyOptions.Builder() + ClusterNetworkSubnetPatch clusterNetworkSubnetPatchModel = new ClusterNetworkSubnetPatch.Builder() + .name("my-cluster-network-subnet") + .build(); + Map clusterNetworkSubnetPatchModelAsPatch = clusterNetworkSubnetPatchModel.asPatch(); + + UpdateClusterNetworkSubnetOptions updateClusterNetworkSubnetOptions = new UpdateClusterNetworkSubnetOptions.Builder() + .clusterNetworkId("testString") .id("testString") + .clusterNetworkSubnetPatch(clusterNetworkSubnetPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.getKey(getKeyOptions).execute(); + Response response = service.updateClusterNetworkSubnet(updateClusterNetworkSubnetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Key keyResult = response.getResult(); - assertNotNull(keyResult); + ClusterNetworkSubnet clusterNetworkSubnetResult = response.getResult(); + assertNotNull(clusterNetworkSubnetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3939,27 +4179,21 @@ public void testGetKey() throws Exception { } } - @Test(dependsOnMethods = { "testGetKey" }) - public void testUpdateKey() throws Exception { + @Test(dependsOnMethods = { "testUpdateClusterNetworkSubnet" }) + public void testGetClusterNetwork() throws Exception { try { - KeyPatch keyPatchModel = new KeyPatch.Builder() - .name("my-key-1") - .build(); - Map keyPatchModelAsPatch = keyPatchModel.asPatch(); - - UpdateKeyOptions updateKeyOptions = new UpdateKeyOptions.Builder() + GetClusterNetworkOptions getClusterNetworkOptions = new GetClusterNetworkOptions.Builder() .id("testString") - .keyPatch(keyPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateKey(updateKeyOptions).execute(); + Response response = service.getClusterNetwork(getClusterNetworkOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Key keyResult = response.getResult(); - assertNotNull(keyResult); + ClusterNetwork clusterNetworkResult = response.getResult(); + assertNotNull(clusterNetworkResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3967,19 +4201,28 @@ public void testUpdateKey() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateKey" }) - public void testListInstanceProfiles() throws Exception { + @Test(dependsOnMethods = { "testGetClusterNetwork" }) + public void testUpdateClusterNetwork() throws Exception { try { - ListInstanceProfilesOptions listInstanceProfilesOptions = new ListInstanceProfilesOptions(); + ClusterNetworkPatch clusterNetworkPatchModel = new ClusterNetworkPatch.Builder() + .name("my-cluster-network") + .build(); + Map clusterNetworkPatchModelAsPatch = clusterNetworkPatchModel.asPatch(); + + UpdateClusterNetworkOptions updateClusterNetworkOptions = new UpdateClusterNetworkOptions.Builder() + .id("testString") + .clusterNetworkPatch(clusterNetworkPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); // Invoke operation - Response response = service.listInstanceProfiles(listInstanceProfilesOptions).execute(); + Response response = service.updateClusterNetwork(updateClusterNetworkOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceProfileCollection instanceProfileCollectionResult = response.getResult(); - assertNotNull(instanceProfileCollectionResult); + ClusterNetwork clusterNetworkResult = response.getResult(); + assertNotNull(clusterNetworkResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -3987,21 +4230,25 @@ public void testListInstanceProfiles() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceProfiles" }) - public void testGetInstanceProfile() throws Exception { + @Test(dependsOnMethods = { "testUpdateClusterNetwork" }) + public void testListDedicatedHostGroups() throws Exception { try { - GetInstanceProfileOptions getInstanceProfileOptions = new GetInstanceProfileOptions.Builder() - .name("mx2-host-152x1216") + ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("us-south-1") + .name("my-name") .build(); // Invoke operation - Response response = service.getInstanceProfile(getInstanceProfileOptions).execute(); + Response response = service.listDedicatedHostGroups(listDedicatedHostGroupsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceProfile instanceProfileResult = response.getResult(); - assertNotNull(instanceProfileResult); + DedicatedHostGroupCollection dedicatedHostGroupCollectionResult = response.getResult(); + assertNotNull(dedicatedHostGroupCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4009,266 +4256,193 @@ public void testGetInstanceProfile() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceProfile" }) - public void testListInstanceTemplates() throws Exception { + @Test(dependsOnMethods = { "testListDedicatedHostGroups" }) + public void testListDedicatedHostGroupsWithPager() throws Exception { try { - ListInstanceTemplatesOptions listInstanceTemplatesOptions = new ListInstanceTemplatesOptions(); + ListDedicatedHostGroupsOptions options = new ListDedicatedHostGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("us-south-1") + .name("my-name") + .build(); - // Invoke operation - Response response = service.listInstanceTemplates(listInstanceTemplatesOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - InstanceTemplateCollection instanceTemplateCollectionResult = response.getResult(); - assertNotNull(instanceTemplateCollectionResult); + // Test getAll(); + pager = new DedicatedHostGroupsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListInstanceTemplates" }) - public void testCreateInstanceTemplate() throws Exception { + @Test(dependsOnMethods = { "testListDedicatedHostGroups" }) + public void testCreateDedicatedHostGroup() throws Exception { try { - InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() - .hostFailure("restart") - .build(); - - ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") - .build(); - - ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() - .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() - .autoDelete(false) - .name("my-cluster-network-interface") - .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) - .subnet(clusterNetworkSubnetIdentityModel) + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - InstanceClusterNetworkAttachmentPrototypeInstanceContext instanceClusterNetworkAttachmentPrototypeInstanceContextModel = new InstanceClusterNetworkAttachmentPrototypeInstanceContext.Builder() - .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) - .name("my-instance-network-attachment") + CreateDedicatedHostGroupOptions createDedicatedHostGroupOptions = new CreateDedicatedHostGroupOptions.Builder() + .xClass("mx2") + .family("balanced") + .zone(zoneIdentityModel) + .name("testString") + .resourceGroup(resourceGroupIdentityModel) .build(); - TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() - .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") - .build(); + // Invoke operation + Response response = service.createDedicatedHostGroup(createDedicatedHostGroupOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); - InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() - .autoLink(false) - .target(trustedProfileIdentityModel) - .build(); + DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); + assertNotNull(dedicatedHostGroupResult); - KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") - .build(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() - .enabled(false) - .protocol("https") - .responseHopLimit(Long.valueOf("2")) + @Test(dependsOnMethods = { "testCreateDedicatedHostGroup" }) + public void testGetDedicatedHostGroup() throws Exception { + try { + GetDedicatedHostGroupOptions getDedicatedHostGroupOptions = new GetDedicatedHostGroupOptions.Builder() + .id("testString") .build(); - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + // Invoke operation + Response response = service.getDedicatedHostGroup(getDedicatedHostGroupOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() - .name("bx2-4x16") - .build(); + DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); + assertNotNull(dedicatedHostGroupResult); - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .build(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - InstanceReservationAffinityPrototype instanceReservationAffinityPrototypeModel = new InstanceReservationAffinityPrototype.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) + @Test(dependsOnMethods = { "testGetDedicatedHostGroup" }) + public void testUpdateDedicatedHostGroup() throws Exception { + try { + DedicatedHostGroupPatch dedicatedHostGroupPatchModel = new DedicatedHostGroupPatch.Builder() + .name("my-dedicated-host-group-updated") .build(); + Map dedicatedHostGroupPatchModelAsPatch = dedicatedHostGroupPatchModel.asPatch(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + UpdateDedicatedHostGroupOptions updateDedicatedHostGroupOptions = new UpdateDedicatedHostGroupOptions.Builder() + .id("testString") + .dedicatedHostGroupPatch(dedicatedHostGroupPatchModelAsPatch) .build(); - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() - .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .build(); + // Invoke operation + Response response = service.updateDedicatedHostGroup(updateDedicatedHostGroupOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype.Builder() - .deleteVolumeOnInstanceDelete(false) - .name("my-volume-attachment") - .volume(volumeAttachmentPrototypeVolumeModel) - .build(); + DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); + assertNotNull(dedicatedHostGroupResult); - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + @Test(dependsOnMethods = { "testUpdateDedicatedHostGroup" }) + public void testListDedicatedHostProfiles() throws Exception { + try { + ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); - VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("general-purpose") - .build(); + // Invoke operation + Response response = service.listDedicatedHostProfiles(listDedicatedHostProfilesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() - .bandwidth(Long.valueOf("1000")) - .capacity(Long.valueOf("100")) - .encryptionKey(encryptionKeyIdentityModel) - .iops(Long.valueOf("10000")) - .name("my-boot-volume") - .profile(volumeProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .build(); + DedicatedHostProfileCollection dedicatedHostProfileCollectionResult = response.getResult(); + assertNotNull(dedicatedHostProfileCollectionResult); - VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .volume(volumePrototypeInstanceByImageContextModel) - .build(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + @Test(dependsOnMethods = { "testListDedicatedHostProfiles" }) + public void testListDedicatedHostProfilesWithPager() throws Exception { + try { + ListDedicatedHostProfilesOptions options = new ListDedicatedHostProfilesOptions.Builder() + .limit(Long.valueOf("10")) .build(); - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); - - InstanceNetworkAttachmentPrototype instanceNetworkAttachmentPrototypeModel = new InstanceNetworkAttachmentPrototype.Builder() - .name("my-instance-network-attachment") - .virtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .build(); - - InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.Builder() - .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) - .clusterNetworkAttachments(java.util.Arrays.asList(instanceClusterNetworkAttachmentPrototypeInstanceContextModel)) - .confidentialComputeMode("disabled") - .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .enableSecureBoot(true) - .keys(java.util.Arrays.asList(keyIdentityModel)) - .metadataService(instanceMetadataServicePrototypeModel) - .name("my-instance") - .placementTarget(instancePlacementTargetPrototypeModel) - .profile(instanceProfileIdentityModel) - .reservationAffinity(instanceReservationAffinityPrototypeModel) - .resourceGroup(resourceGroupIdentityModel) - .totalVolumeBandwidth(Long.valueOf("500")) - .userData("testString") - .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) - .vpc(vpcIdentityModel) - .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) - .image(imageIdentityModel) - .zone(zoneIdentityModel) - .networkAttachments(java.util.Arrays.asList(instanceNetworkAttachmentPrototypeModel)) - .primaryNetworkAttachment(instanceNetworkAttachmentPrototypeModel) - .build(); - - CreateInstanceTemplateOptions createInstanceTemplateOptions = new CreateInstanceTemplateOptions.Builder() - .instanceTemplatePrototype(instanceTemplatePrototypeModel) - .build(); - - // Invoke operation - Response response = service.createInstanceTemplate(createInstanceTemplateOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - InstanceTemplate instanceTemplateResult = response.getResult(); - assertNotNull(instanceTemplateResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateInstanceTemplate" }) - public void testGetInstanceTemplate() throws Exception { - try { - GetInstanceTemplateOptions getInstanceTemplateOptions = new GetInstanceTemplateOptions.Builder() - .id("testString") - .build(); - - // Invoke operation - Response response = service.getInstanceTemplate(getInstanceTemplateOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - InstanceTemplate instanceTemplateResult = response.getResult(); - assertNotNull(instanceTemplateResult); + // Test getAll(); + pager = new DedicatedHostProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetInstanceTemplate" }) - public void testUpdateInstanceTemplate() throws Exception { + @Test(dependsOnMethods = { "testListDedicatedHostProfiles" }) + public void testGetDedicatedHostProfile() throws Exception { try { - InstanceTemplatePatch instanceTemplatePatchModel = new InstanceTemplatePatch.Builder() - .name("my-instance-template-updated") - .build(); - Map instanceTemplatePatchModelAsPatch = instanceTemplatePatchModel.asPatch(); - - UpdateInstanceTemplateOptions updateInstanceTemplateOptions = new UpdateInstanceTemplateOptions.Builder() - .id("testString") - .instanceTemplatePatch(instanceTemplatePatchModelAsPatch) + GetDedicatedHostProfileOptions getDedicatedHostProfileOptions = new GetDedicatedHostProfileOptions.Builder() + .name("mx2-host-152x1216") .build(); // Invoke operation - Response response = service.updateInstanceTemplate(updateInstanceTemplateOptions).execute(); + Response response = service.getDedicatedHostProfile(getDedicatedHostProfileOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceTemplate instanceTemplateResult = response.getResult(); - assertNotNull(instanceTemplateResult); + DedicatedHostProfile dedicatedHostProfileResult = response.getResult(); + assertNotNull(dedicatedHostProfileResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4276,40 +4450,26 @@ public void testUpdateInstanceTemplate() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceTemplate" }) - public void testListInstances() throws Exception { + @Test(dependsOnMethods = { "testGetDedicatedHostProfile" }) + public void testListDedicatedHosts() throws Exception { try { - ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() + ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() + .dedicatedHostGroupId("testString") .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") .name("my-name") - .clusterNetworkId("testString") - .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") - .clusterNetworkName("my-cluster-network") - .dedicatedHostId("testString") - .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .dedicatedHostName("my-dedicated-host") - .placementGroupId("testString") - .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") - .placementGroupName("my-placement-group") - .reservationAffinityPolicy("automatic") - .reservationId("testString") - .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .reservationName("my-reservation") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") .build(); // Invoke operation - Response response = service.listInstances(listInstancesOptions).execute(); + Response response = service.listDedicatedHosts(listDedicatedHostsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceCollection instanceCollectionResult = response.getResult(); - assertNotNull(instanceCollectionResult); + DedicatedHostCollection dedicatedHostCollectionResult = response.getResult(); + assertNotNull(dedicatedHostCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4317,44 +4477,30 @@ public void testListInstances() throws Exception { } } - @Test(dependsOnMethods = { "testListInstances" }) - public void testListInstancesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListDedicatedHosts" }) + public void testListDedicatedHostsWithPager() throws Exception { try { - ListInstancesOptions options = new ListInstancesOptions.Builder() + ListDedicatedHostsOptions options = new ListDedicatedHostsOptions.Builder() + .dedicatedHostGroupId("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") .name("my-name") - .clusterNetworkId("testString") - .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") - .clusterNetworkName("my-cluster-network") - .dedicatedHostId("testString") - .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .dedicatedHostName("my-dedicated-host") - .placementGroupId("testString") - .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") - .placementGroupName("my-placement-group") - .reservationAffinityPolicy("automatic") - .reservationId("testString") - .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .reservationName("my-reservation") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - InstancesPager pager = new InstancesPager(service, options); + List allResults = new ArrayList<>(); + DedicatedHostsPager pager = new DedicatedHostsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new InstancesPager(service, options); - List allItems = pager.getAll(); + pager = new DedicatedHostsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -4366,187 +4512,63 @@ public void testListInstancesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListInstances" }) - public void testCreateInstance() throws Exception { + @Test(dependsOnMethods = { "testListDedicatedHosts" }) + public void testCreateDedicatedHost() throws Exception { try { - InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() - .hostFailure("restart") + DedicatedHostProfileIdentityByName dedicatedHostProfileIdentityModel = new DedicatedHostProfileIdentityByName.Builder() + .name("mx2-host-152x1216") .build(); - ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() - .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") + DedicatedHostGroupIdentityById dedicatedHostGroupIdentityModel = new DedicatedHostGroupIdentityById.Builder() + .id("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0") .build(); - InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() - .autoDelete(false) - .name("my-cluster-network-interface") - .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) - .subnet(clusterNetworkSubnetIdentityModel) + DedicatedHostPrototypeDedicatedHostByGroup dedicatedHostPrototypeModel = new DedicatedHostPrototypeDedicatedHostByGroup.Builder() + .instancePlacementEnabled(true) + .name("my-host") + .profile(dedicatedHostProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .group(dedicatedHostGroupIdentityModel) .build(); - InstanceClusterNetworkAttachmentPrototypeInstanceContext instanceClusterNetworkAttachmentPrototypeInstanceContextModel = new InstanceClusterNetworkAttachmentPrototypeInstanceContext.Builder() - .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) - .name("my-instance-network-attachment") + CreateDedicatedHostOptions createDedicatedHostOptions = new CreateDedicatedHostOptions.Builder() + .dedicatedHostPrototype(dedicatedHostPrototypeModel) .build(); - TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() - .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") - .build(); + // Invoke operation + Response response = service.createDedicatedHost(createDedicatedHostOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); - InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() - .autoLink(false) - .target(trustedProfileIdentityModel) - .build(); + DedicatedHost dedicatedHostResult = response.getResult(); + assertNotNull(dedicatedHostResult); - KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") - .build(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() - .enabled(false) - .protocol("https") - .responseHopLimit(Long.valueOf("2")) - .build(); - - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("r006-418fe842-a3e9-47b9-a938-1aa5bd632871") - .build(); - - InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() - .name("bx2-2x8") - .build(); - - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .build(); - - InstanceReservationAffinityPrototype instanceReservationAffinityPrototypeModel = new InstanceReservationAffinityPrototype.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("5iops-tier") - .build(); - - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.Builder() - .bandwidth(Long.valueOf("1000")) - .iops(Long.valueOf("10000")) - .name("my-data-volume") - .profile(volumeProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .capacity(Long.valueOf("1000")) - .encryptionKey(encryptionKeyIdentityModel) - .build(); - - VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype.Builder() - .deleteVolumeOnInstanceDelete(false) - .name("my-volume-attachment") - .volume(volumeAttachmentPrototypeVolumeModel) - .build(); - - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() - .bandwidth(Long.valueOf("1000")) - .capacity(Long.valueOf("100")) - .encryptionKey(encryptionKeyIdentityModel) - .iops(Long.valueOf("10000")) - .name("my-boot-volume") - .profile(volumeProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .build(); - - VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .volume(volumePrototypeInstanceByImageContextModel) - .build(); - - ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .build(); - - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() - .allowIpSpoofing(true) - .name("my-instance-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); - - InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface instancePrototypeModel = new InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.Builder() - .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) - .clusterNetworkAttachments(java.util.Arrays.asList(instanceClusterNetworkAttachmentPrototypeInstanceContextModel)) - .confidentialComputeMode("disabled") - .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .enableSecureBoot(true) - .keys(java.util.Arrays.asList(keyIdentityModel)) - .metadataService(instanceMetadataServicePrototypeModel) - .name("my-instance") - .placementTarget(instancePlacementTargetPrototypeModel) - .profile(instanceProfileIdentityModel) - .reservationAffinity(instanceReservationAffinityPrototypeModel) - .resourceGroup(resourceGroupIdentityModel) - .totalVolumeBandwidth(Long.valueOf("500")) - .userData("testString") - .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) - .vpc(vpcIdentityModel) - .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) - .image(imageIdentityModel) - .zone(zoneIdentityModel) - .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) - .primaryNetworkInterface(networkInterfacePrototypeModel) - .build(); - - CreateInstanceOptions createInstanceOptions = new CreateInstanceOptions.Builder() - .instancePrototype(instancePrototypeModel) + @Test(dependsOnMethods = { "testCreateDedicatedHost" }) + public void testListDedicatedHostDisks() throws Exception { + try { + ListDedicatedHostDisksOptions listDedicatedHostDisksOptions = new ListDedicatedHostDisksOptions.Builder() + .dedicatedHostId("testString") .build(); // Invoke operation - Response response = service.createInstance(createInstanceOptions).execute(); + Response response = service.listDedicatedHostDisks(listDedicatedHostDisksOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - Instance instanceResult = response.getResult(); - assertNotNull(instanceResult); + DedicatedHostDiskCollection dedicatedHostDiskCollectionResult = response.getResult(); + assertNotNull(dedicatedHostDiskCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4554,21 +4576,22 @@ public void testCreateInstance() throws Exception { } } - @Test(dependsOnMethods = { "testCreateInstance" }) - public void testGetInstance() throws Exception { + @Test(dependsOnMethods = { "testListDedicatedHostDisks" }) + public void testGetDedicatedHostDisk() throws Exception { try { - GetInstanceOptions getInstanceOptions = new GetInstanceOptions.Builder() + GetDedicatedHostDiskOptions getDedicatedHostDiskOptions = new GetDedicatedHostDiskOptions.Builder() + .dedicatedHostId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getInstance(getInstanceOptions).execute(); + Response response = service.getDedicatedHostDisk(getDedicatedHostDiskOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Instance instanceResult = response.getResult(); - assertNotNull(instanceResult); + DedicatedHostDisk dedicatedHostDiskResult = response.getResult(); + assertNotNull(dedicatedHostDiskResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4576,63 +4599,28 @@ public void testGetInstance() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstance" }) - public void testUpdateInstance() throws Exception { + @Test(dependsOnMethods = { "testGetDedicatedHostDisk" }) + public void testUpdateDedicatedHostDisk() throws Exception { try { - InstanceAvailabilityPolicyPatch instanceAvailabilityPolicyPatchModel = new InstanceAvailabilityPolicyPatch.Builder() - .hostFailure("restart") - .build(); - - InstanceMetadataServicePatch instanceMetadataServicePatchModel = new InstanceMetadataServicePatch.Builder() - .enabled(true) - .protocol("http") - .responseHopLimit(Long.valueOf("1")) - .build(); - - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPatchModel = new InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); - - InstancePatchProfileInstanceProfileIdentityByName instancePatchProfileModel = new InstancePatchProfileInstanceProfileIdentityByName.Builder() - .name("bx2-4x16") - .build(); - - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .build(); - - InstanceReservationAffinityPatch instanceReservationAffinityPatchModel = new InstanceReservationAffinityPatch.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) - .build(); - - InstancePatch instancePatchModel = new InstancePatch.Builder() - .availabilityPolicy(instanceAvailabilityPolicyPatchModel) - .confidentialComputeMode("disabled") - .enableSecureBoot(true) - .metadataService(instanceMetadataServicePatchModel) - .name("my-instance") - .placementTarget(instancePlacementTargetPatchModel) - .profile(instancePatchProfileModel) - .reservationAffinity(instanceReservationAffinityPatchModel) - .totalVolumeBandwidth(Long.valueOf("500")) + DedicatedHostDiskPatch dedicatedHostDiskPatchModel = new DedicatedHostDiskPatch.Builder() + .name("my-dedicated-host-disk-updated") .build(); - Map instancePatchModelAsPatch = instancePatchModel.asPatch(); + Map dedicatedHostDiskPatchModelAsPatch = dedicatedHostDiskPatchModel.asPatch(); - UpdateInstanceOptions updateInstanceOptions = new UpdateInstanceOptions.Builder() + UpdateDedicatedHostDiskOptions updateDedicatedHostDiskOptions = new UpdateDedicatedHostDiskOptions.Builder() + .dedicatedHostId("testString") .id("testString") - .instancePatch(instancePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .dedicatedHostDiskPatch(dedicatedHostDiskPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateInstance(updateInstanceOptions).execute(); + Response response = service.updateDedicatedHostDisk(updateDedicatedHostDiskOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Instance instanceResult = response.getResult(); - assertNotNull(instanceResult); + DedicatedHostDisk dedicatedHostDiskResult = response.getResult(); + assertNotNull(dedicatedHostDiskResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4640,21 +4628,21 @@ public void testUpdateInstance() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstance" }) - public void testGetInstanceInitialization() throws Exception { + @Test(dependsOnMethods = { "testUpdateDedicatedHostDisk" }) + public void testGetDedicatedHost() throws Exception { try { - GetInstanceInitializationOptions getInstanceInitializationOptions = new GetInstanceInitializationOptions.Builder() + GetDedicatedHostOptions getDedicatedHostOptions = new GetDedicatedHostOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getInstanceInitialization(getInstanceInitializationOptions).execute(); + Response response = service.getDedicatedHost(getDedicatedHostOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceInitialization instanceInitializationResult = response.getResult(); - assertNotNull(instanceInitializationResult); + DedicatedHost dedicatedHostResult = response.getResult(); + assertNotNull(dedicatedHostResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4662,23 +4650,28 @@ public void testGetInstanceInitialization() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceInitialization" }) - public void testCreateInstanceAction() throws Exception { + @Test(dependsOnMethods = { "testGetDedicatedHost" }) + public void testUpdateDedicatedHost() throws Exception { try { - CreateInstanceActionOptions createInstanceActionOptions = new CreateInstanceActionOptions.Builder() - .instanceId("testString") - .type("reboot") - .force(true) + DedicatedHostPatch dedicatedHostPatchModel = new DedicatedHostPatch.Builder() + .instancePlacementEnabled(false) + .name("my-host") + .build(); + Map dedicatedHostPatchModelAsPatch = dedicatedHostPatchModel.asPatch(); + + UpdateDedicatedHostOptions updateDedicatedHostOptions = new UpdateDedicatedHostOptions.Builder() + .id("testString") + .dedicatedHostPatch(dedicatedHostPatchModelAsPatch) .build(); // Invoke operation - Response response = service.createInstanceAction(createInstanceActionOptions).execute(); + Response response = service.updateDedicatedHost(updateDedicatedHostOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - InstanceAction instanceActionResult = response.getResult(); - assertNotNull(instanceActionResult); + DedicatedHost dedicatedHostResult = response.getResult(); + assertNotNull(dedicatedHostResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4686,23 +4679,29 @@ public void testCreateInstanceAction() throws Exception { } } - @Test(dependsOnMethods = { "testCreateInstanceAction" }) - public void testListInstanceClusterNetworkAttachments() throws Exception { + @Test(dependsOnMethods = { "testUpdateDedicatedHost" }) + public void testListEndpointGateways() throws Exception { try { - ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptions = new ListInstanceClusterNetworkAttachmentsOptions.Builder() - .instanceId("testString") + ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() + .name("my-name") .start("testString") .limit(Long.valueOf("10")) - .build(); + .resourceGroupId("testString") + .lifecycleState(java.util.Arrays.asList("stable")) + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .dnsResolutionBindingMode(java.util.Arrays.asList("disabled")) + .build(); // Invoke operation - Response response = service.listInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptions).execute(); + Response response = service.listEndpointGateways(listEndpointGatewaysOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceClusterNetworkAttachmentCollection instanceClusterNetworkAttachmentCollectionResult = response.getResult(); - assertNotNull(instanceClusterNetworkAttachmentCollectionResult); + EndpointGatewayCollection endpointGatewayCollectionResult = response.getResult(); + assertNotNull(endpointGatewayCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4710,27 +4709,33 @@ public void testListInstanceClusterNetworkAttachments() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceClusterNetworkAttachments" }) - public void testListInstanceClusterNetworkAttachmentsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListEndpointGateways" }) + public void testListEndpointGatewaysWithPager() throws Exception { try { - ListInstanceClusterNetworkAttachmentsOptions options = new ListInstanceClusterNetworkAttachmentsOptions.Builder() - .instanceId("testString") + ListEndpointGatewaysOptions options = new ListEndpointGatewaysOptions.Builder() + .name("my-name") .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .lifecycleState(java.util.Arrays.asList("stable")) + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .dnsResolutionBindingMode(java.util.Arrays.asList("disabled")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - InstanceClusterNetworkAttachmentsPager pager = new InstanceClusterNetworkAttachmentsPager(service, options); + List allResults = new ArrayList<>(); + EndpointGatewaysPager pager = new EndpointGatewaysPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new InstanceClusterNetworkAttachmentsPager(service, options); - List allItems = pager.getAll(); + pager = new EndpointGatewaysPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -4742,45 +4747,48 @@ public void testListInstanceClusterNetworkAttachmentsWithPager() throws Exceptio } } - @Test(dependsOnMethods = { "testListInstanceClusterNetworkAttachments" }) - public void testCreateClusterNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testListEndpointGateways" }) + public void testCreateEndpointGateway() throws Exception { try { - ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") + EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype endpointGatewayTargetPrototypeModel = new EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype.Builder() + .name("ibm-ntp-server") + .resourceType("provider_infrastructure_service") .build(); - ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() - .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() - .autoDelete(false) - .name("my-cluster-network-interface") - .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) - .subnet(clusterNetworkSubnetIdentityModel) + EndpointGatewayReservedIPReservedIPIdentityById endpointGatewayReservedIpModel = new EndpointGatewayReservedIPReservedIPIdentityById.Builder() + .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") .build(); - InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById instanceClusterNetworkAttachmentBeforePrototypeModel = new InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById.Builder() - .id("0717-fb880975-db45-4459-8548-64e3995ac213") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - CreateClusterNetworkAttachmentOptions createClusterNetworkAttachmentOptions = new CreateClusterNetworkAttachmentOptions.Builder() - .instanceId("testString") - .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) - .before(instanceClusterNetworkAttachmentBeforePrototypeModel) - .name("my-instance-network-attachment") + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + CreateEndpointGatewayOptions createEndpointGatewayOptions = new CreateEndpointGatewayOptions.Builder() + .target(endpointGatewayTargetPrototypeModel) + .vpc(vpcIdentityModel) + .dnsResolutionBindingMode("primary") + .ips(java.util.Arrays.asList(endpointGatewayReservedIpModel)) + .name("testString") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke operation - Response response = service.createClusterNetworkAttachment(createClusterNetworkAttachmentOptions).execute(); + Response response = service.createEndpointGateway(createEndpointGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - InstanceClusterNetworkAttachment instanceClusterNetworkAttachmentResult = response.getResult(); - assertNotNull(instanceClusterNetworkAttachmentResult); + EndpointGateway endpointGatewayResult = response.getResult(); + assertNotNull(endpointGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4788,22 +4796,24 @@ public void testCreateClusterNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testCreateClusterNetworkAttachment" }) - public void testGetInstanceClusterNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testCreateEndpointGateway" }) + public void testListEndpointGatewayIps() throws Exception { try { - GetInstanceClusterNetworkAttachmentOptions getInstanceClusterNetworkAttachmentOptions = new GetInstanceClusterNetworkAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") + ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() + .endpointGatewayId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .sort("name") .build(); // Invoke operation - Response response = service.getInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptions).execute(); + Response response = service.listEndpointGatewayIps(listEndpointGatewayIpsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceClusterNetworkAttachment instanceClusterNetworkAttachmentResult = response.getResult(); - assertNotNull(instanceClusterNetworkAttachmentResult); + ReservedIPCollectionEndpointGatewayContext reservedIpCollectionEndpointGatewayContextResult = response.getResult(); + assertNotNull(reservedIpCollectionEndpointGatewayContextResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4811,28 +4821,55 @@ public void testGetInstanceClusterNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceClusterNetworkAttachment" }) - public void testUpdateInstanceClusterNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testListEndpointGatewayIps" }) + public void testListEndpointGatewayIpsWithPager() throws Exception { try { - InstanceClusterNetworkAttachmentPatch instanceClusterNetworkAttachmentPatchModel = new InstanceClusterNetworkAttachmentPatch.Builder() - .name("my-instance-network-attachment-updated") + ListEndpointGatewayIpsOptions options = new ListEndpointGatewayIpsOptions.Builder() + .endpointGatewayId("testString") + .limit(Long.valueOf("10")) + .sort("name") .build(); - Map instanceClusterNetworkAttachmentPatchModelAsPatch = instanceClusterNetworkAttachmentPatchModel.asPatch(); - UpdateInstanceClusterNetworkAttachmentOptions updateInstanceClusterNetworkAttachmentOptions = new UpdateInstanceClusterNetworkAttachmentOptions.Builder() - .instanceId("testString") + // Test getNext(). + List allResults = new ArrayList<>(); + EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new EndpointGatewayIpsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListEndpointGatewayIps" }) + public void testGetEndpointGatewayIp() throws Exception { + try { + GetEndpointGatewayIpOptions getEndpointGatewayIpOptions = new GetEndpointGatewayIpOptions.Builder() + .endpointGatewayId("testString") .id("testString") - .instanceClusterNetworkAttachmentPatch(instanceClusterNetworkAttachmentPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptions).execute(); + Response response = service.getEndpointGatewayIp(getEndpointGatewayIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceClusterNetworkAttachment instanceClusterNetworkAttachmentResult = response.getResult(); - assertNotNull(instanceClusterNetworkAttachmentResult); + ReservedIP reservedIpResult = response.getResult(); + assertNotNull(reservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4840,23 +4877,22 @@ public void testUpdateInstanceClusterNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceClusterNetworkAttachment" }) - public void testCreateInstanceConsoleAccessToken() throws Exception { + @Test(dependsOnMethods = { "testGetEndpointGatewayIp" }) + public void testAddEndpointGatewayIp() throws Exception { try { - CreateInstanceConsoleAccessTokenOptions createInstanceConsoleAccessTokenOptions = new CreateInstanceConsoleAccessTokenOptions.Builder() - .instanceId("testString") - .consoleType("serial") - .force(false) + AddEndpointGatewayIpOptions addEndpointGatewayIpOptions = new AddEndpointGatewayIpOptions.Builder() + .endpointGatewayId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.createInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptions).execute(); + Response response = service.addEndpointGatewayIp(addEndpointGatewayIpOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - InstanceConsoleAccessToken instanceConsoleAccessTokenResult = response.getResult(); - assertNotNull(instanceConsoleAccessTokenResult); + ReservedIP reservedIpResult = response.getResult(); + assertNotNull(reservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4864,21 +4900,23 @@ public void testCreateInstanceConsoleAccessToken() throws Exception { } } - @Test(dependsOnMethods = { "testCreateInstanceConsoleAccessToken" }) - public void testListInstanceDisks() throws Exception { + @Test(dependsOnMethods = { "testAddEndpointGatewayIp" }) + public void testListEndpointGatewayResourceBindings() throws Exception { try { - ListInstanceDisksOptions listInstanceDisksOptions = new ListInstanceDisksOptions.Builder() - .instanceId("testString") + ListEndpointGatewayResourceBindingsOptions listEndpointGatewayResourceBindingsOptions = new ListEndpointGatewayResourceBindingsOptions.Builder() + .endpointGatewayId("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listInstanceDisks(listInstanceDisksOptions).execute(); + Response response = service.listEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceDiskCollection instanceDiskCollectionResult = response.getResult(); - assertNotNull(instanceDiskCollectionResult); + EndpointGatewayResourceBindingCollection endpointGatewayResourceBindingCollectionResult = response.getResult(); + assertNotNull(endpointGatewayResourceBindingCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4886,51 +4924,59 @@ public void testListInstanceDisks() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceDisks" }) - public void testGetInstanceDisk() throws Exception { + @Test(dependsOnMethods = { "testListEndpointGatewayResourceBindings" }) + public void testListEndpointGatewayResourceBindingsWithPager() throws Exception { try { - GetInstanceDiskOptions getInstanceDiskOptions = new GetInstanceDiskOptions.Builder() - .instanceId("testString") - .id("testString") + ListEndpointGatewayResourceBindingsOptions options = new ListEndpointGatewayResourceBindingsOptions.Builder() + .endpointGatewayId("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.getInstanceDisk(getInstanceDiskOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + EndpointGatewayResourceBindingsPager pager = new EndpointGatewayResourceBindingsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - InstanceDisk instanceDiskResult = response.getResult(); - assertNotNull(instanceDiskResult); + // Test getAll(); + pager = new EndpointGatewayResourceBindingsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetInstanceDisk" }) - public void testUpdateInstanceDisk() throws Exception { + @Test(dependsOnMethods = { "testListEndpointGatewayResourceBindings" }) + public void testCreateEndpointGatewayResourceBinding() throws Exception { try { - InstanceDiskPatch instanceDiskPatchModel = new InstanceDiskPatch.Builder() - .name("my-instance-disk-updated") + EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN endpointGatewayResourceBindingTargetPrototypeModel = new EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.Builder() + .crn("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue") .build(); - Map instanceDiskPatchModelAsPatch = instanceDiskPatchModel.asPatch(); - UpdateInstanceDiskOptions updateInstanceDiskOptions = new UpdateInstanceDiskOptions.Builder() - .instanceId("testString") - .id("testString") - .instanceDiskPatch(instanceDiskPatchModelAsPatch) + CreateEndpointGatewayResourceBindingOptions createEndpointGatewayResourceBindingOptions = new CreateEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .target(endpointGatewayResourceBindingTargetPrototypeModel) + .name("my-resource-binding") .build(); // Invoke operation - Response response = service.updateInstanceDisk(updateInstanceDiskOptions).execute(); + Response response = service.createEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - InstanceDisk instanceDiskResult = response.getResult(); - assertNotNull(instanceDiskResult); + EndpointGatewayResourceBinding endpointGatewayResourceBindingResult = response.getResult(); + assertNotNull(endpointGatewayResourceBindingResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4938,21 +4984,22 @@ public void testUpdateInstanceDisk() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceDisk" }) - public void testListInstanceNetworkAttachments() throws Exception { + @Test(dependsOnMethods = { "testCreateEndpointGatewayResourceBinding" }) + public void testGetEndpointGatewayResourceBinding() throws Exception { try { - ListInstanceNetworkAttachmentsOptions listInstanceNetworkAttachmentsOptions = new ListInstanceNetworkAttachmentsOptions.Builder() - .instanceId("testString") + GetEndpointGatewayResourceBindingOptions getEndpointGatewayResourceBindingOptions = new GetEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.listInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptions).execute(); + Response response = service.getEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceNetworkAttachmentCollection instanceNetworkAttachmentCollectionResult = response.getResult(); - assertNotNull(instanceNetworkAttachmentCollectionResult); + EndpointGatewayResourceBinding endpointGatewayResourceBindingResult = response.getResult(); + assertNotNull(endpointGatewayResourceBindingResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -4960,60 +5007,50 @@ public void testListInstanceNetworkAttachments() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceNetworkAttachments" }) - public void testCreateInstanceNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testGetEndpointGatewayResourceBinding" }) + public void testUpdateEndpointGatewayResourceBinding() throws Exception { try { - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.7") - .autoDelete(false) - .name("my-reserved-ip") + EndpointGatewayResourceBindingPatch endpointGatewayResourceBindingPatchModel = new EndpointGatewayResourceBindingPatch.Builder() + .name("my-resource-binding-updated") .build(); + Map endpointGatewayResourceBindingPatchModelAsPatch = endpointGatewayResourceBindingPatchModel.asPatch(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + UpdateEndpointGatewayResourceBindingOptions updateEndpointGatewayResourceBindingOptions = new UpdateEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .id("testString") + .endpointGatewayResourceBindingPatch(endpointGatewayResourceBindingPatchModelAsPatch) .build(); - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + // Invoke operation + Response response = service.updateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + EndpointGatewayResourceBinding endpointGatewayResourceBindingResult = response.getResult(); + assertNotNull(endpointGatewayResourceBindingResult); - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - CreateInstanceNetworkAttachmentOptions createInstanceNetworkAttachmentOptions = new CreateInstanceNetworkAttachmentOptions.Builder() - .instanceId("testString") - .virtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .name("testString") + @Test(dependsOnMethods = { "testUpdateEndpointGatewayResourceBinding" }) + public void testGetEndpointGateway() throws Exception { + try { + GetEndpointGatewayOptions getEndpointGatewayOptions = new GetEndpointGatewayOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.createInstanceNetworkAttachment(createInstanceNetworkAttachmentOptions).execute(); + Response response = service.getEndpointGateway(getEndpointGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - InstanceNetworkAttachment instanceNetworkAttachmentResult = response.getResult(); - assertNotNull(instanceNetworkAttachmentResult); + EndpointGateway endpointGatewayResult = response.getResult(); + assertNotNull(endpointGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5021,22 +5058,28 @@ public void testCreateInstanceNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testCreateInstanceNetworkAttachment" }) - public void testGetInstanceNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testGetEndpointGateway" }) + public void testUpdateEndpointGateway() throws Exception { try { - GetInstanceNetworkAttachmentOptions getInstanceNetworkAttachmentOptions = new GetInstanceNetworkAttachmentOptions.Builder() - .instanceId("testString") + EndpointGatewayPatch endpointGatewayPatchModel = new EndpointGatewayPatch.Builder() + .dnsResolutionBindingMode("disabled") + .name("my-endpoint-gateway") + .build(); + Map endpointGatewayPatchModelAsPatch = endpointGatewayPatchModel.asPatch(); + + UpdateEndpointGatewayOptions updateEndpointGatewayOptions = new UpdateEndpointGatewayOptions.Builder() .id("testString") + .endpointGatewayPatch(endpointGatewayPatchModelAsPatch) .build(); // Invoke operation - Response response = service.getInstanceNetworkAttachment(getInstanceNetworkAttachmentOptions).execute(); + Response response = service.updateEndpointGateway(updateEndpointGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceNetworkAttachment instanceNetworkAttachmentResult = response.getResult(); - assertNotNull(instanceNetworkAttachmentResult); + EndpointGateway endpointGatewayResult = response.getResult(); + assertNotNull(endpointGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5044,28 +5087,28 @@ public void testGetInstanceNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceNetworkAttachment" }) - public void testUpdateInstanceNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testUpdateEndpointGateway" }) + public void testListFloatingIps() throws Exception { try { - InstanceNetworkAttachmentPatch instanceNetworkAttachmentPatchModel = new InstanceNetworkAttachmentPatch.Builder() - .name("my-instance-network-attachment-updated") - .build(); - Map instanceNetworkAttachmentPatchModelAsPatch = instanceNetworkAttachmentPatchModel.asPatch(); - - UpdateInstanceNetworkAttachmentOptions updateInstanceNetworkAttachmentOptions = new UpdateInstanceNetworkAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") - .instanceNetworkAttachmentPatch(instanceNetworkAttachmentPatchModelAsPatch) + ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); // Invoke operation - Response response = service.updateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptions).execute(); + Response response = service.listFloatingIps(listFloatingIpsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceNetworkAttachment instanceNetworkAttachmentResult = response.getResult(); - assertNotNull(instanceNetworkAttachmentResult); + FloatingIPCollection floatingIpCollectionResult = response.getResult(); + assertNotNull(floatingIpCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5073,62 +5116,72 @@ public void testUpdateInstanceNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceNetworkAttachment" }) - public void testListInstanceNetworkInterfaces() throws Exception { + @Test(dependsOnMethods = { "testListFloatingIps" }) + public void testListFloatingIpsWithPager() throws Exception { try { - ListInstanceNetworkInterfacesOptions listInstanceNetworkInterfacesOptions = new ListInstanceNetworkInterfacesOptions.Builder() - .instanceId("testString") + ListFloatingIpsOptions options = new ListFloatingIpsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); - // Invoke operation - Response response = service.listInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + FloatingIpsPager pager = new FloatingIpsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - NetworkInterfaceUnpaginatedCollection networkInterfaceUnpaginatedCollectionResult = response.getResult(); - assertNotNull(networkInterfaceUnpaginatedCollectionResult); + // Test getAll(); + pager = new FloatingIpsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListInstanceNetworkInterfaces" }) - public void testCreateInstanceNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testListFloatingIps" }) + public void testCreateFloatingIp() throws Exception { try { - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") + FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById floatingIpTargetPrototypeModel = new FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.Builder() + .id("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef") .build(); - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + FloatingIPPrototypeFloatingIPByTarget floatingIpPrototypeModel = new FloatingIPPrototypeFloatingIPByTarget.Builder() + .name("my-floating-ip") + .resourceGroup(resourceGroupIdentityModel) + .target(floatingIpTargetPrototypeModel) .build(); - CreateInstanceNetworkInterfaceOptions createInstanceNetworkInterfaceOptions = new CreateInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") - .subnet(subnetIdentityModel) - .allowIpSpoofing(true) - .name("my-instance-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + CreateFloatingIpOptions createFloatingIpOptions = new CreateFloatingIpOptions.Builder() + .floatingIpPrototype(floatingIpPrototypeModel) .build(); // Invoke operation - Response response = service.createInstanceNetworkInterface(createInstanceNetworkInterfaceOptions).execute(); + Response response = service.createFloatingIp(createFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - NetworkInterface networkInterfaceResult = response.getResult(); - assertNotNull(networkInterfaceResult); + FloatingIP floatingIpResult = response.getResult(); + assertNotNull(floatingIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5136,22 +5189,21 @@ public void testCreateInstanceNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testCreateInstanceNetworkInterface" }) - public void testGetInstanceNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testCreateFloatingIp" }) + public void testGetFloatingIp() throws Exception { try { - GetInstanceNetworkInterfaceOptions getInstanceNetworkInterfaceOptions = new GetInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") + GetFloatingIpOptions getFloatingIpOptions = new GetFloatingIpOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getInstanceNetworkInterface(getInstanceNetworkInterfaceOptions).execute(); + Response response = service.getFloatingIp(getFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - NetworkInterface networkInterfaceResult = response.getResult(); - assertNotNull(networkInterfaceResult); + FloatingIP floatingIpResult = response.getResult(); + assertNotNull(floatingIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5159,29 +5211,32 @@ public void testGetInstanceNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceNetworkInterface" }) - public void testUpdateInstanceNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testGetFloatingIp" }) + public void testUpdateFloatingIp() throws Exception { try { - NetworkInterfacePatch networkInterfacePatchModel = new NetworkInterfacePatch.Builder() - .allowIpSpoofing(true) - .name("my-network-interface-updated") + FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById floatingIpTargetPatchModel = new FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.Builder() + .id("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6") .build(); - Map networkInterfacePatchModelAsPatch = networkInterfacePatchModel.asPatch(); - UpdateInstanceNetworkInterfaceOptions updateInstanceNetworkInterfaceOptions = new UpdateInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") + FloatingIPPatch floatingIpPatchModel = new FloatingIPPatch.Builder() + .name("my-floating-ip") + .target(floatingIpTargetPatchModel) + .build(); + Map floatingIpPatchModelAsPatch = floatingIpPatchModel.asPatch(); + + UpdateFloatingIpOptions updateFloatingIpOptions = new UpdateFloatingIpOptions.Builder() .id("testString") - .networkInterfacePatch(networkInterfacePatchModelAsPatch) + .floatingIpPatch(floatingIpPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions).execute(); + Response response = service.updateFloatingIp(updateFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - NetworkInterface networkInterfaceResult = response.getResult(); - assertNotNull(networkInterfaceResult); + FloatingIP floatingIpResult = response.getResult(); + assertNotNull(floatingIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5189,22 +5244,29 @@ public void testUpdateInstanceNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceNetworkInterface" }) - public void testListInstanceNetworkInterfaceFloatingIps() throws Exception { + @Test(dependsOnMethods = { "testUpdateFloatingIp" }) + public void testListFlowLogCollectors() throws Exception { try { - ListInstanceNetworkInterfaceFloatingIpsOptions listInstanceNetworkInterfaceFloatingIpsOptions = new ListInstanceNetworkInterfaceFloatingIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .targetId("testString") + .targetResourceType("testString") .build(); // Invoke operation - Response response = service.listInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptions).execute(); + Response response = service.listFlowLogCollectors(listFlowLogCollectorsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FloatingIPUnpaginatedCollection floatingIpUnpaginatedCollectionResult = response.getResult(); - assertNotNull(floatingIpUnpaginatedCollectionResult); + FlowLogCollectorCollection flowLogCollectorCollectionResult = response.getResult(); + assertNotNull(flowLogCollectorCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5212,47 +5274,75 @@ public void testListInstanceNetworkInterfaceFloatingIps() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceNetworkInterfaceFloatingIps" }) - public void testGetInstanceNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testListFlowLogCollectors" }) + public void testListFlowLogCollectorsWithPager() throws Exception { try { - GetInstanceNetworkInterfaceFloatingIpOptions getInstanceNetworkInterfaceFloatingIpOptions = new GetInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .id("testString") + ListFlowLogCollectorsOptions options = new ListFlowLogCollectorsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .targetId("testString") + .targetResourceType("testString") .build(); - // Invoke operation - Response response = service.getInstanceNetworkInterfaceFloatingIp(getInstanceNetworkInterfaceFloatingIpOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + FlowLogCollectorsPager pager = new FlowLogCollectorsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - FloatingIP floatingIpResult = response.getResult(); - assertNotNull(floatingIpResult); + // Test getAll(); + pager = new FlowLogCollectorsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetInstanceNetworkInterfaceFloatingIp" }) - public void testAddInstanceNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testListFlowLogCollectors" }) + public void testCreateFlowLogCollector() throws Exception { try { - AddInstanceNetworkInterfaceFloatingIpOptions addInstanceNetworkInterfaceFloatingIpOptions = new AddInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .id("testString") + LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName legacyCloudObjectStorageBucketIdentityModel = new LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() + .name("bucket-27200-lwx4cfvcue") + .build(); + + FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById flowLogCollectorTargetPrototypeModel = new FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.Builder() + .id("0717-d54eb633-98ea-459d-aa00-6a8e780175a7") + .build(); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + CreateFlowLogCollectorOptions createFlowLogCollectorOptions = new CreateFlowLogCollectorOptions.Builder() + .storageBucket(legacyCloudObjectStorageBucketIdentityModel) + .target(flowLogCollectorTargetPrototypeModel) + .active(false) + .name("my-flow-log-collector") + .resourceGroup(resourceGroupIdentityModel) .build(); // Invoke operation - Response response = service.addInstanceNetworkInterfaceFloatingIp(addInstanceNetworkInterfaceFloatingIpOptions).execute(); + Response response = service.createFlowLogCollector(createFlowLogCollectorOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - FloatingIP floatingIpResult = response.getResult(); - assertNotNull(floatingIpResult); + FlowLogCollector flowLogCollectorResult = response.getResult(); + assertNotNull(flowLogCollectorResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5260,24 +5350,21 @@ public void testAddInstanceNetworkInterfaceFloatingIp() throws Exception { } } - @Test(dependsOnMethods = { "testAddInstanceNetworkInterfaceFloatingIp" }) - public void testListInstanceNetworkInterfaceIps() throws Exception { + @Test(dependsOnMethods = { "testCreateFlowLogCollector" }) + public void testGetFlowLogCollector() throws Exception { try { - ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .start("testString") - .limit(Long.valueOf("10")) + GetFlowLogCollectorOptions getFlowLogCollectorOptions = new GetFlowLogCollectorOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptions).execute(); + Response response = service.getFlowLogCollector(getFlowLogCollectorOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ReservedIPCollectionInstanceNetworkInterfaceContext reservedIpCollectionInstanceNetworkInterfaceContextResult = response.getResult(); - assertNotNull(reservedIpCollectionInstanceNetworkInterfaceContextResult); + FlowLogCollector flowLogCollectorResult = response.getResult(); + assertNotNull(flowLogCollectorResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5285,56 +5372,28 @@ public void testListInstanceNetworkInterfaceIps() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceNetworkInterfaceIps" }) - public void testListInstanceNetworkInterfaceIpsWithPager() throws Exception { + @Test(dependsOnMethods = { "testGetFlowLogCollector" }) + public void testUpdateFlowLogCollector() throws Exception { try { - ListInstanceNetworkInterfaceIpsOptions options = new ListInstanceNetworkInterfaceIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .limit(Long.valueOf("10")) + FlowLogCollectorPatch flowLogCollectorPatchModel = new FlowLogCollectorPatch.Builder() + .active(false) + .name("my-flow-log-collector") .build(); + Map flowLogCollectorPatchModelAsPatch = flowLogCollectorPatchModel.asPatch(); - // Test getNext(). - List allResults = new ArrayList<>(); - InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); - - // Test getAll(); - pager = new InstanceNetworkInterfaceIpsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); - - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListInstanceNetworkInterfaceIps" }) - public void testGetInstanceNetworkInterfaceIp() throws Exception { - try { - GetInstanceNetworkInterfaceIpOptions getInstanceNetworkInterfaceIpOptions = new GetInstanceNetworkInterfaceIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + UpdateFlowLogCollectorOptions updateFlowLogCollectorOptions = new UpdateFlowLogCollectorOptions.Builder() .id("testString") + .flowLogCollectorPatch(flowLogCollectorPatchModelAsPatch) .build(); // Invoke operation - Response response = service.getInstanceNetworkInterfaceIp(getInstanceNetworkInterfaceIpOptions).execute(); + Response response = service.updateFlowLogCollector(updateFlowLogCollectorOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ReservedIP reservedIpResult = response.getResult(); - assertNotNull(reservedIpResult); + FlowLogCollector flowLogCollectorResult = response.getResult(); + assertNotNull(flowLogCollectorResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5342,21 +5401,19 @@ public void testGetInstanceNetworkInterfaceIp() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceNetworkInterfaceIp" }) - public void testListInstanceVolumeAttachments() throws Exception { + @Test(dependsOnMethods = { "testUpdateFlowLogCollector" }) + public void testListRegions() throws Exception { try { - ListInstanceVolumeAttachmentsOptions listInstanceVolumeAttachmentsOptions = new ListInstanceVolumeAttachmentsOptions.Builder() - .instanceId("testString") - .build(); + ListRegionsOptions listRegionsOptions = new ListRegionsOptions(); // Invoke operation - Response response = service.listInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptions).execute(); + Response response = service.listRegions(listRegionsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VolumeAttachmentCollection volumeAttachmentCollectionResult = response.getResult(); - assertNotNull(volumeAttachmentCollectionResult); + RegionCollection regionCollectionResult = response.getResult(); + assertNotNull(regionCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5364,28 +5421,21 @@ public void testListInstanceVolumeAttachments() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceVolumeAttachments" }) - public void testCreateInstanceVolumeAttachment() throws Exception { + @Test(dependsOnMethods = { "testListRegions" }) + public void testGetRegion() throws Exception { try { - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() - .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .build(); - - CreateInstanceVolumeAttachmentOptions createInstanceVolumeAttachmentOptions = new CreateInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") - .volume(volumeAttachmentPrototypeVolumeModel) - .deleteVolumeOnInstanceDelete(false) - .name("my-volume-attachment") + GetRegionOptions getRegionOptions = new GetRegionOptions.Builder() + .name("us-south") .build(); // Invoke operation - Response response = service.createInstanceVolumeAttachment(createInstanceVolumeAttachmentOptions).execute(); + Response response = service.getRegion(getRegionOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - VolumeAttachment volumeAttachmentResult = response.getResult(); - assertNotNull(volumeAttachmentResult); + Region regionResult = response.getResult(); + assertNotNull(regionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5393,22 +5443,21 @@ public void testCreateInstanceVolumeAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testCreateInstanceVolumeAttachment" }) - public void testGetInstanceVolumeAttachment() throws Exception { + @Test(dependsOnMethods = { "testGetRegion" }) + public void testListRegionZones() throws Exception { try { - GetInstanceVolumeAttachmentOptions getInstanceVolumeAttachmentOptions = new GetInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") + ListRegionZonesOptions listRegionZonesOptions = new ListRegionZonesOptions.Builder() + .regionName("us-south") .build(); // Invoke operation - Response response = service.getInstanceVolumeAttachment(getInstanceVolumeAttachmentOptions).execute(); + Response response = service.listRegionZones(listRegionZonesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VolumeAttachment volumeAttachmentResult = response.getResult(); - assertNotNull(volumeAttachmentResult); + ZoneCollection zoneCollectionResult = response.getResult(); + assertNotNull(zoneCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5416,29 +5465,22 @@ public void testGetInstanceVolumeAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceVolumeAttachment" }) - public void testUpdateInstanceVolumeAttachment() throws Exception { + @Test(dependsOnMethods = { "testListRegionZones" }) + public void testGetRegionZone() throws Exception { try { - VolumeAttachmentPatch volumeAttachmentPatchModel = new VolumeAttachmentPatch.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .build(); - Map volumeAttachmentPatchModelAsPatch = volumeAttachmentPatchModel.asPatch(); - - UpdateInstanceVolumeAttachmentOptions updateInstanceVolumeAttachmentOptions = new UpdateInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") - .volumeAttachmentPatch(volumeAttachmentPatchModelAsPatch) + GetRegionZoneOptions getRegionZoneOptions = new GetRegionZoneOptions.Builder() + .regionName("us-south") + .name("us-south-1") .build(); // Invoke operation - Response response = service.updateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptions).execute(); + Response response = service.getRegionZone(getRegionZoneOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VolumeAttachment volumeAttachmentResult = response.getResult(); - assertNotNull(volumeAttachmentResult); + Zone zoneResult = response.getResult(); + assertNotNull(zoneResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5446,22 +5488,28 @@ public void testUpdateInstanceVolumeAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceVolumeAttachment" }) - public void testListInstanceGroups() throws Exception { + @Test(dependsOnMethods = { "testGetRegionZone" }) + public void testListImages() throws Exception { try { - ListInstanceGroupsOptions listInstanceGroupsOptions = new ListInstanceGroupsOptions.Builder() + ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .status(java.util.Arrays.asList("available")) + .visibility("private") + .userDataFormat(java.util.Arrays.asList("cloud_init")) + .remoteAccountId("bb1b52262f7441a586f49068482f1e60") .build(); // Invoke operation - Response response = service.listInstanceGroups(listInstanceGroupsOptions).execute(); + Response response = service.listImages(listImagesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroupCollection instanceGroupCollectionResult = response.getResult(); - assertNotNull(instanceGroupCollectionResult); + ImageCollection imageCollectionResult = response.getResult(); + assertNotNull(imageCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5469,26 +5517,32 @@ public void testListInstanceGroups() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceGroups" }) - public void testListInstanceGroupsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListImages" }) + public void testListImagesWithPager() throws Exception { try { - ListInstanceGroupsOptions options = new ListInstanceGroupsOptions.Builder() + ListImagesOptions options = new ListImagesOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .status(java.util.Arrays.asList("available")) + .visibility("private") + .userDataFormat(java.util.Arrays.asList("cloud_init")) + .remoteAccountId("bb1b52262f7441a586f49068482f1e60") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - InstanceGroupsPager pager = new InstanceGroupsPager(service, options); + List allResults = new ArrayList<>(); + ImagesPager pager = new ImagesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new InstanceGroupsPager(service, options); - List allItems = pager.getAll(); + pager = new ImagesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -5500,48 +5554,55 @@ public void testListInstanceGroupsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceGroups" }) - public void testCreateInstanceGroup() throws Exception { + @Test(dependsOnMethods = { "testListImages" }) + public void testCreateImage() throws Exception { try { - InstanceTemplateIdentityById instanceTemplateIdentityModel = new InstanceTemplateIdentityById.Builder() - .id("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2") + ImageAllowedUsePrototype imageAllowedUsePrototypeModel = new ImageAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() - .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); - LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + ImageFilePrototype imageFilePrototypeModel = new ImageFilePrototype.Builder() + .href("cos://us-south/my-bucket/my-image.qcow2") .build(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + OperatingSystemIdentityByName operatingSystemIdentityModel = new OperatingSystemIdentityByName.Builder() + .name("debian-9-amd64") .build(); - CreateInstanceGroupOptions createInstanceGroupOptions = new CreateInstanceGroupOptions.Builder() - .instanceTemplate(instanceTemplateIdentityModel) - .subnets(java.util.Arrays.asList(subnetIdentityModel)) - .applicationPort(Long.valueOf("22")) - .loadBalancer(loadBalancerIdentityModel) - .loadBalancerPool(loadBalancerPoolIdentityModel) - .membershipCount(Long.valueOf("10")) - .name("my-instance-group") + ImagePrototypeImageByFile imagePrototypeModel = new ImagePrototypeImageByFile.Builder() + .allowedUse(imageAllowedUsePrototypeModel) + .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .name("my-image") + .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .resourceGroup(resourceGroupIdentityModel) + .encryptedDataKey("testString") + .encryptionKey(encryptionKeyIdentityModel) + .file(imageFilePrototypeModel) + .operatingSystem(operatingSystemIdentityModel) + .build(); + + CreateImageOptions createImageOptions = new CreateImageOptions.Builder() + .imagePrototype(imagePrototypeModel) .build(); // Invoke operation - Response response = service.createInstanceGroup(createInstanceGroupOptions).execute(); + Response response = service.createImage(createImageOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - InstanceGroup instanceGroupResult = response.getResult(); - assertNotNull(instanceGroupResult); + Image imageResult = response.getResult(); + assertNotNull(imageResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5549,21 +5610,21 @@ public void testCreateInstanceGroup() throws Exception { } } - @Test(dependsOnMethods = { "testCreateInstanceGroup" }) - public void testGetInstanceGroup() throws Exception { + @Test(dependsOnMethods = { "testCreateImage" }) + public void testGetImage() throws Exception { try { - GetInstanceGroupOptions getInstanceGroupOptions = new GetInstanceGroupOptions.Builder() + GetImageOptions getImageOptions = new GetImageOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getInstanceGroup(getInstanceGroupOptions).execute(); + Response response = service.getImage(getImageOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroup instanceGroupResult = response.getResult(); - assertNotNull(instanceGroupResult); + Image imageResult = response.getResult(); + assertNotNull(imageResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5571,49 +5632,36 @@ public void testGetInstanceGroup() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceGroup" }) - public void testUpdateInstanceGroup() throws Exception { + @Test(dependsOnMethods = { "testGetImage" }) + public void testUpdateImage() throws Exception { try { - InstanceTemplateIdentityById instanceTemplateIdentityModel = new InstanceTemplateIdentityById.Builder() - .id("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2") - .build(); - - LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() - .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .build(); - - LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + ImageAllowedUsePatch imageAllowedUsePatchModel = new ImageAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - InstanceGroupPatch instanceGroupPatchModel = new InstanceGroupPatch.Builder() - .applicationPort(Long.valueOf("22")) - .instanceTemplate(instanceTemplateIdentityModel) - .loadBalancer(loadBalancerIdentityModel) - .loadBalancerPool(loadBalancerPoolIdentityModel) - .membershipCount(Long.valueOf("20")) - .name("my-instance-group") - .subnets(java.util.Arrays.asList(subnetIdentityModel)) + ImagePatch imagePatchModel = new ImagePatch.Builder() + .allowedUse(imageAllowedUsePatchModel) + .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .name("my-image") + .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .build(); - Map instanceGroupPatchModelAsPatch = instanceGroupPatchModel.asPatch(); + Map imagePatchModelAsPatch = imagePatchModel.asPatch(); - UpdateInstanceGroupOptions updateInstanceGroupOptions = new UpdateInstanceGroupOptions.Builder() + UpdateImageOptions updateImageOptions = new UpdateImageOptions.Builder() .id("testString") - .instanceGroupPatch(instanceGroupPatchModelAsPatch) + .imagePatch(imagePatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateInstanceGroup(updateInstanceGroupOptions).execute(); + Response response = service.updateImage(updateImageOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroup instanceGroupResult = response.getResult(); - assertNotNull(instanceGroupResult); + Image imageResult = response.getResult(); + assertNotNull(imageResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5621,23 +5669,23 @@ public void testUpdateInstanceGroup() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceGroup" }) - public void testListInstanceGroupManagers() throws Exception { + @Test(dependsOnMethods = { "testUpdateImage" }) + public void testListImageBareMetalServerProfiles() throws Exception { try { - ListInstanceGroupManagersOptions listInstanceGroupManagersOptions = new ListInstanceGroupManagersOptions.Builder() - .instanceGroupId("testString") + ListImageBareMetalServerProfilesOptions listImageBareMetalServerProfilesOptions = new ListImageBareMetalServerProfilesOptions.Builder() + .id("testString") .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listInstanceGroupManagers(listInstanceGroupManagersOptions).execute(); + Response response = service.listImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroupManagerCollection instanceGroupManagerCollectionResult = response.getResult(); - assertNotNull(instanceGroupManagerCollectionResult); + ImageBareMetalServerProfileCollection imageBareMetalServerProfileCollectionResult = response.getResult(); + assertNotNull(imageBareMetalServerProfileCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5645,27 +5693,27 @@ public void testListInstanceGroupManagers() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceGroupManagers" }) - public void testListInstanceGroupManagersWithPager() throws Exception { + @Test(dependsOnMethods = { "testListImageBareMetalServerProfiles" }) + public void testListImageBareMetalServerProfilesWithPager() throws Exception { try { - ListInstanceGroupManagersOptions options = new ListInstanceGroupManagersOptions.Builder() - .instanceGroupId("testString") + ListImageBareMetalServerProfilesOptions options = new ListImageBareMetalServerProfilesOptions.Builder() + .id("testString") .limit(Long.valueOf("10")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - InstanceGroupManagersPager pager = new InstanceGroupManagersPager(service, options); + List allResults = new ArrayList<>(); + ImageBareMetalServerProfilesPager pager = new ImageBareMetalServerProfilesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new InstanceGroupManagersPager(service, options); - List allItems = pager.getAll(); + pager = new ImageBareMetalServerProfilesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -5677,55 +5725,41 @@ public void testListInstanceGroupManagersWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceGroupManagers" }) - public void testCreateInstanceGroupManager() throws Exception { + @Test(dependsOnMethods = { "testListImageBareMetalServerProfiles" }) + public void testDeprecateImage() throws Exception { try { - InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype instanceGroupManagerPrototypeModel = new InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.Builder() - .managementEnabled(true) - .name("my-instance-group-manager") - .aggregationWindow(Long.valueOf("120")) - .cooldown(Long.valueOf("210")) - .managerType("autoscale") - .maxMembershipCount(Long.valueOf("10")) - .minMembershipCount(Long.valueOf("10")) - .build(); - - CreateInstanceGroupManagerOptions createInstanceGroupManagerOptions = new CreateInstanceGroupManagerOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerPrototype(instanceGroupManagerPrototypeModel) + DeprecateImageOptions deprecateImageOptions = new DeprecateImageOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.createInstanceGroupManager(createInstanceGroupManagerOptions).execute(); + Response response = service.deprecateImage(deprecateImageOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - InstanceGroupManager instanceGroupManagerResult = response.getResult(); - assertNotNull(instanceGroupManagerResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testCreateInstanceGroupManager" }) - public void testGetInstanceGroupManager() throws Exception { + @Test(dependsOnMethods = { "testDeprecateImage" }) + public void testListImageInstanceProfiles() throws Exception { try { - GetInstanceGroupManagerOptions getInstanceGroupManagerOptions = new GetInstanceGroupManagerOptions.Builder() - .instanceGroupId("testString") + ListImageInstanceProfilesOptions listImageInstanceProfilesOptions = new ListImageInstanceProfilesOptions.Builder() .id("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.getInstanceGroupManager(getInstanceGroupManagerOptions).execute(); + Response response = service.listImageInstanceProfiles(listImageInstanceProfilesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroupManager instanceGroupManagerResult = response.getResult(); - assertNotNull(instanceGroupManagerResult); + ImageInstanceProfileCollection imageInstanceProfileCollectionResult = response.getResult(); + assertNotNull(imageInstanceProfileCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5733,125 +5767,101 @@ public void testGetInstanceGroupManager() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceGroupManager" }) - public void testUpdateInstanceGroupManager() throws Exception { + @Test(dependsOnMethods = { "testListImageInstanceProfiles" }) + public void testListImageInstanceProfilesWithPager() throws Exception { try { - InstanceGroupManagerPatch instanceGroupManagerPatchModel = new InstanceGroupManagerPatch.Builder() - .aggregationWindow(Long.valueOf("120")) - .cooldown(Long.valueOf("210")) - .managementEnabled(false) - .maxMembershipCount(Long.valueOf("10")) - .minMembershipCount(Long.valueOf("10")) - .name("my-instance-group-manager") - .build(); - Map instanceGroupManagerPatchModelAsPatch = instanceGroupManagerPatchModel.asPatch(); - - UpdateInstanceGroupManagerOptions updateInstanceGroupManagerOptions = new UpdateInstanceGroupManagerOptions.Builder() - .instanceGroupId("testString") + ListImageInstanceProfilesOptions options = new ListImageInstanceProfilesOptions.Builder() .id("testString") - .instanceGroupManagerPatch(instanceGroupManagerPatchModelAsPatch) + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.updateInstanceGroupManager(updateInstanceGroupManagerOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + ImageInstanceProfilesPager pager = new ImageInstanceProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - InstanceGroupManager instanceGroupManagerResult = response.getResult(); - assertNotNull(instanceGroupManagerResult); + // Test getAll(); + pager = new ImageInstanceProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateInstanceGroupManager" }) - public void testListInstanceGroupManagerActions() throws Exception { + @Test(dependsOnMethods = { "testListImageInstanceProfiles" }) + public void testObsoleteImage() throws Exception { try { - ListInstanceGroupManagerActionsOptions listInstanceGroupManagerActionsOptions = new ListInstanceGroupManagerActionsOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .start("testString") - .limit(Long.valueOf("10")) + ObsoleteImageOptions obsoleteImageOptions = new ObsoleteImageOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listInstanceGroupManagerActions(listInstanceGroupManagerActionsOptions).execute(); + Response response = service.obsoleteImage(obsoleteImageOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - InstanceGroupManagerActionsCollection instanceGroupManagerActionsCollectionResult = response.getResult(); - assertNotNull(instanceGroupManagerActionsCollectionResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListInstanceGroupManagerActions" }) - public void testListInstanceGroupManagerActionsWithPager() throws Exception { + @Test(dependsOnMethods = { "testObsoleteImage" }) + public void testListImageExportJobs() throws Exception { try { - ListInstanceGroupManagerActionsOptions options = new ListInstanceGroupManagerActionsOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .limit(Long.valueOf("10")) + ListImageExportJobsOptions listImageExportJobsOptions = new ListImageExportJobsOptions.Builder() + .imageId("testString") + .name("my-name") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - InstanceGroupManagerActionsPager pager = new InstanceGroupManagerActionsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + // Invoke operation + Response response = service.listImageExportJobs(listImageExportJobsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - // Test getAll(); - pager = new InstanceGroupManagerActionsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + ImageExportJobUnpaginatedCollection imageExportJobUnpaginatedCollectionResult = response.getResult(); + assertNotNull(imageExportJobUnpaginatedCollectionResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListInstanceGroupManagerActions" }) - public void testCreateInstanceGroupManagerAction() throws Exception { + @Test(dependsOnMethods = { "testListImageExportJobs" }) + public void testCreateImageExportJob() throws Exception { try { - InstanceGroupManagerScheduledActionGroupPrototype instanceGroupManagerScheduledActionGroupPrototypeModel = new InstanceGroupManagerScheduledActionGroupPrototype.Builder() - .membershipCount(Long.valueOf("10")) - .build(); - - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.Builder() - .name("my-instance-group-manager-action") - .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .group(instanceGroupManagerScheduledActionGroupPrototypeModel) + CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName cloudObjectStorageBucketIdentityModel = new CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() + .name("bucket-27200-lwx4cfvcue") .build(); - CreateInstanceGroupManagerActionOptions createInstanceGroupManagerActionOptions = new CreateInstanceGroupManagerActionOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .instanceGroupManagerActionPrototype(instanceGroupManagerActionPrototypeModel) + CreateImageExportJobOptions createImageExportJobOptions = new CreateImageExportJobOptions.Builder() + .imageId("testString") + .storageBucket(cloudObjectStorageBucketIdentityModel) + .format("qcow2") + .name("my-image-export") .build(); // Invoke operation - Response response = service.createInstanceGroupManagerAction(createInstanceGroupManagerActionOptions).execute(); + Response response = service.createImageExportJob(createImageExportJobOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); - assertNotNull(instanceGroupManagerActionResult); + ImageExportJob imageExportJobResult = response.getResult(); + assertNotNull(imageExportJobResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5859,23 +5869,22 @@ public void testCreateInstanceGroupManagerAction() throws Exception { } } - @Test(dependsOnMethods = { "testCreateInstanceGroupManagerAction" }) - public void testGetInstanceGroupManagerAction() throws Exception { + @Test(dependsOnMethods = { "testCreateImageExportJob" }) + public void testGetImageExportJob() throws Exception { try { - GetInstanceGroupManagerActionOptions getInstanceGroupManagerActionOptions = new GetInstanceGroupManagerActionOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") + GetImageExportJobOptions getImageExportJobOptions = new GetImageExportJobOptions.Builder() + .imageId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getInstanceGroupManagerAction(getInstanceGroupManagerActionOptions).execute(); + Response response = service.getImageExportJob(getImageExportJobOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); - assertNotNull(instanceGroupManagerActionResult); + ImageExportJob imageExportJobResult = response.getResult(); + assertNotNull(imageExportJobResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5883,44 +5892,28 @@ public void testGetInstanceGroupManagerAction() throws Exception { } } - @Test(dependsOnMethods = { "testGetInstanceGroupManagerAction" }) - public void testUpdateInstanceGroupManagerAction() throws Exception { + @Test(dependsOnMethods = { "testGetImageExportJob" }) + public void testUpdateImageExportJob() throws Exception { try { - InstanceGroupManagerActionGroupPatch instanceGroupManagerActionGroupPatchModel = new InstanceGroupManagerActionGroupPatch.Builder() - .membershipCount(Long.valueOf("10")) - .build(); - - InstanceGroupManagerActionManagerPatch instanceGroupManagerActionManagerPatchModel = new InstanceGroupManagerActionManagerPatch.Builder() - .maxMembershipCount(Long.valueOf("10")) - .minMembershipCount(Long.valueOf("10")) + ImageExportJobPatch imageExportJobPatchModel = new ImageExportJobPatch.Builder() + .name("my-image-export-job-updated") .build(); + Map imageExportJobPatchModelAsPatch = imageExportJobPatchModel.asPatch(); - InstanceGroupManagerActionPatch instanceGroupManagerActionPatchModel = new InstanceGroupManagerActionPatch.Builder() - .autoDelete(false) - .autoDeleteTimeout(Long.valueOf("24")) - .cronSpec("30 */2 * * 1-5") - .group(instanceGroupManagerActionGroupPatchModel) - .manager(instanceGroupManagerActionManagerPatchModel) - .name("my-instance-group-manager-action") - .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .build(); - Map instanceGroupManagerActionPatchModelAsPatch = instanceGroupManagerActionPatchModel.asPatch(); - - UpdateInstanceGroupManagerActionOptions updateInstanceGroupManagerActionOptions = new UpdateInstanceGroupManagerActionOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") + UpdateImageExportJobOptions updateImageExportJobOptions = new UpdateImageExportJobOptions.Builder() + .imageId("testString") .id("testString") - .instanceGroupManagerActionPatch(instanceGroupManagerActionPatchModelAsPatch) + .imageExportJobPatch(imageExportJobPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions).execute(); + Response response = service.updateImageExportJob(updateImageExportJobOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); - assertNotNull(instanceGroupManagerActionResult); + ImageExportJob imageExportJobResult = response.getResult(); + assertNotNull(imageExportJobResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5928,24 +5921,22 @@ public void testUpdateInstanceGroupManagerAction() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceGroupManagerAction" }) - public void testListInstanceGroupManagerPolicies() throws Exception { + @Test(dependsOnMethods = { "testUpdateImageExportJob" }) + public void testListOperatingSystems() throws Exception { try { - ListInstanceGroupManagerPoliciesOptions listInstanceGroupManagerPoliciesOptions = new ListInstanceGroupManagerPoliciesOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") + ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptions).execute(); + Response response = service.listOperatingSystems(listOperatingSystemsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroupManagerPolicyCollection instanceGroupManagerPolicyCollectionResult = response.getResult(); - assertNotNull(instanceGroupManagerPolicyCollectionResult); + OperatingSystemCollection operatingSystemCollectionResult = response.getResult(); + assertNotNull(operatingSystemCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -5953,28 +5944,26 @@ public void testListInstanceGroupManagerPolicies() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceGroupManagerPolicies" }) - public void testListInstanceGroupManagerPoliciesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListOperatingSystems" }) + public void testListOperatingSystemsWithPager() throws Exception { try { - ListInstanceGroupManagerPoliciesOptions options = new ListInstanceGroupManagerPoliciesOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") + ListOperatingSystemsOptions options = new ListOperatingSystemsOptions.Builder() .limit(Long.valueOf("10")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - InstanceGroupManagerPoliciesPager pager = new InstanceGroupManagerPoliciesPager(service, options); + List allResults = new ArrayList<>(); + OperatingSystemsPager pager = new OperatingSystemsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new InstanceGroupManagerPoliciesPager(service, options); - List allItems = pager.getAll(); + pager = new OperatingSystemsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -5986,86 +5975,21 @@ public void testListInstanceGroupManagerPoliciesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceGroupManagerPolicies" }) - public void testCreateInstanceGroupManagerPolicy() throws Exception { - try { - InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype instanceGroupManagerPolicyPrototypeModel = new InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.Builder() - .name("my-instance-group-manager-policy") - .metricType("cpu") - .metricValue(Long.valueOf("0")) - .policyType("target") - .build(); - - CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptions = new CreateInstanceGroupManagerPolicyOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .instanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototypeModel) - .build(); - - // Invoke operation - Response response = service.createInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); - assertNotNull(instanceGroupManagerPolicyResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateInstanceGroupManagerPolicy" }) - public void testGetInstanceGroupManagerPolicy() throws Exception { - try { - GetInstanceGroupManagerPolicyOptions getInstanceGroupManagerPolicyOptions = new GetInstanceGroupManagerPolicyOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .id("testString") - .build(); - - // Invoke operation - Response response = service.getInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); - assertNotNull(instanceGroupManagerPolicyResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testGetInstanceGroupManagerPolicy" }) - public void testUpdateInstanceGroupManagerPolicy() throws Exception { + @Test(dependsOnMethods = { "testListOperatingSystems" }) + public void testGetOperatingSystem() throws Exception { try { - InstanceGroupManagerPolicyPatch instanceGroupManagerPolicyPatchModel = new InstanceGroupManagerPolicyPatch.Builder() - .metricType("cpu") - .metricValue(Long.valueOf("75")) - .name("my-instance-group-manager-policy") - .build(); - Map instanceGroupManagerPolicyPatchModelAsPatch = instanceGroupManagerPolicyPatchModel.asPatch(); - - UpdateInstanceGroupManagerPolicyOptions updateInstanceGroupManagerPolicyOptions = new UpdateInstanceGroupManagerPolicyOptions.Builder() - .instanceGroupId("testString") - .instanceGroupManagerId("testString") - .id("testString") - .instanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatchModelAsPatch) + GetOperatingSystemOptions getOperatingSystemOptions = new GetOperatingSystemOptions.Builder() + .name("red-7-amd64") .build(); // Invoke operation - Response response = service.updateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptions).execute(); + Response response = service.getOperatingSystem(getOperatingSystemOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); - assertNotNull(instanceGroupManagerPolicyResult); + OperatingSystem operatingSystemResult = response.getResult(); + assertNotNull(operatingSystemResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6073,23 +5997,22 @@ public void testUpdateInstanceGroupManagerPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceGroupManagerPolicy" }) - public void testListInstanceGroupMemberships() throws Exception { + @Test(dependsOnMethods = { "testGetOperatingSystem" }) + public void testListInstanceGroups() throws Exception { try { - ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptions = new ListInstanceGroupMembershipsOptions.Builder() - .instanceGroupId("testString") + ListInstanceGroupsOptions listInstanceGroupsOptions = new ListInstanceGroupsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listInstanceGroupMemberships(listInstanceGroupMembershipsOptions).execute(); + Response response = service.listInstanceGroups(listInstanceGroupsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - InstanceGroupMembershipCollection instanceGroupMembershipCollectionResult = response.getResult(); - assertNotNull(instanceGroupMembershipCollectionResult); + InstanceGroupCollection instanceGroupCollectionResult = response.getResult(); + assertNotNull(instanceGroupCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6097,27 +6020,26 @@ public void testListInstanceGroupMemberships() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceGroupMemberships" }) - public void testListInstanceGroupMembershipsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroups" }) + public void testListInstanceGroupsWithPager() throws Exception { try { - ListInstanceGroupMembershipsOptions options = new ListInstanceGroupMembershipsOptions.Builder() - .instanceGroupId("testString") + ListInstanceGroupsOptions options = new ListInstanceGroupsOptions.Builder() .limit(Long.valueOf("10")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - InstanceGroupMembershipsPager pager = new InstanceGroupMembershipsPager(service, options); + List allResults = new ArrayList<>(); + InstanceGroupsPager pager = new InstanceGroupsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new InstanceGroupMembershipsPager(service, options); - List allItems = pager.getAll(); + pager = new InstanceGroupsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -6129,52 +6051,48 @@ public void testListInstanceGroupMembershipsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListInstanceGroupMemberships" }) - public void testGetInstanceGroupMembership() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroups" }) + public void testCreateInstanceGroup() throws Exception { try { - GetInstanceGroupMembershipOptions getInstanceGroupMembershipOptions = new GetInstanceGroupMembershipOptions.Builder() - .instanceGroupId("testString") - .id("testString") + InstanceTemplateIdentityById instanceTemplateIdentityModel = new InstanceTemplateIdentityById.Builder() + .id("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2") .build(); - // Invoke operation - Response response = service.getInstanceGroupMembership(getInstanceGroupMembershipOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); - InstanceGroupMembership instanceGroupMembershipResult = response.getResult(); - assertNotNull(instanceGroupMembershipResult); + LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() + .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .build(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); - @Test(dependsOnMethods = { "testGetInstanceGroupMembership" }) - public void testUpdateInstanceGroupMembership() throws Exception { - try { - InstanceGroupMembershipPatch instanceGroupMembershipPatchModel = new InstanceGroupMembershipPatch.Builder() - .deleteInstanceOnMembershipDelete(false) - .name("my-instance-group-membership") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - Map instanceGroupMembershipPatchModelAsPatch = instanceGroupMembershipPatchModel.asPatch(); - UpdateInstanceGroupMembershipOptions updateInstanceGroupMembershipOptions = new UpdateInstanceGroupMembershipOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .instanceGroupMembershipPatch(instanceGroupMembershipPatchModelAsPatch) + CreateInstanceGroupOptions createInstanceGroupOptions = new CreateInstanceGroupOptions.Builder() + .instanceTemplate(instanceTemplateIdentityModel) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .applicationPort(Long.valueOf("22")) + .loadBalancer(loadBalancerIdentityModel) + .loadBalancerPool(loadBalancerPoolIdentityModel) + .membershipCount(Long.valueOf("10")) + .name("my-instance-group") + .resourceGroup(resourceGroupIdentityModel) .build(); // Invoke operation - Response response = service.updateInstanceGroupMembership(updateInstanceGroupMembershipOptions).execute(); + Response response = service.createInstanceGroup(createInstanceGroupOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - InstanceGroupMembership instanceGroupMembershipResult = response.getResult(); - assertNotNull(instanceGroupMembershipResult); + InstanceGroup instanceGroupResult = response.getResult(); + assertNotNull(instanceGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6182,27 +6100,21 @@ public void testUpdateInstanceGroupMembership() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateInstanceGroupMembership" }) - public void testListReservations() throws Exception { + @Test(dependsOnMethods = { "testCreateInstanceGroup" }) + public void testGetInstanceGroup() throws Exception { try { - ListReservationsOptions listReservationsOptions = new ListReservationsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .name("my-name") - .profileResourceType("testString") - .affinityPolicy("automatic") - .resourceGroupId("testString") - .zoneName("us-south-1") + GetInstanceGroupOptions getInstanceGroupOptions = new GetInstanceGroupOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listReservations(listReservationsOptions).execute(); + Response response = service.getInstanceGroup(getInstanceGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ReservationCollection reservationCollectionResult = response.getResult(); - assertNotNull(reservationCollectionResult); + InstanceGroup instanceGroupResult = response.getResult(); + assertNotNull(instanceGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6210,85 +6122,49 @@ public void testListReservations() throws Exception { } } - @Test(dependsOnMethods = { "testListReservations" }) - public void testListReservationsWithPager() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceGroup" }) + public void testUpdateInstanceGroup() throws Exception { try { - ListReservationsOptions options = new ListReservationsOptions.Builder() - .limit(Long.valueOf("10")) - .name("my-name") - .profileResourceType("testString") - .affinityPolicy("automatic") - .resourceGroupId("testString") - .zoneName("us-south-1") - .build(); - - // Test getNext(). - List allResults = new ArrayList<>(); - ReservationsPager pager = new ReservationsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); - - // Test getAll(); - pager = new ReservationsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); - - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListReservations" }) - public void testCreateReservation() throws Exception { - try { - ReservationCapacityPrototype reservationCapacityPrototypeModel = new ReservationCapacityPrototype.Builder() - .total(Long.valueOf("10")) + InstanceTemplateIdentityById instanceTemplateIdentityModel = new InstanceTemplateIdentityById.Builder() + .id("0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2") .build(); - ReservationCommittedUsePrototype reservationCommittedUsePrototypeModel = new ReservationCommittedUsePrototype.Builder() - .expirationPolicy("release") - .term("testString") + LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() + .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") .build(); - ReservationProfilePrototype reservationProfilePrototypeModel = new ReservationProfilePrototype.Builder() - .name("bx2-4x16") - .resourceType("bare_metal_server_profile") + LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") .build(); - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + InstanceGroupPatch instanceGroupPatchModel = new InstanceGroupPatch.Builder() + .applicationPort(Long.valueOf("22")) + .instanceTemplate(instanceTemplateIdentityModel) + .loadBalancer(loadBalancerIdentityModel) + .loadBalancerPool(loadBalancerPoolIdentityModel) + .membershipCount(Long.valueOf("20")) + .name("my-instance-group") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) .build(); + Map instanceGroupPatchModelAsPatch = instanceGroupPatchModel.asPatch(); - CreateReservationOptions createReservationOptions = new CreateReservationOptions.Builder() - .capacity(reservationCapacityPrototypeModel) - .committedUse(reservationCommittedUsePrototypeModel) - .profile(reservationProfilePrototypeModel) - .zone(zoneIdentityModel) - .affinityPolicy("automatic") - .name("my-reservation") - .resourceGroup(resourceGroupIdentityModel) + UpdateInstanceGroupOptions updateInstanceGroupOptions = new UpdateInstanceGroupOptions.Builder() + .id("testString") + .instanceGroupPatch(instanceGroupPatchModelAsPatch) .build(); // Invoke operation - Response response = service.createReservation(createReservationOptions).execute(); + Response response = service.updateInstanceGroup(updateInstanceGroupOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - Reservation reservationResult = response.getResult(); - assertNotNull(reservationResult); + InstanceGroup instanceGroupResult = response.getResult(); + assertNotNull(instanceGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6296,21 +6172,23 @@ public void testCreateReservation() throws Exception { } } - @Test(dependsOnMethods = { "testCreateReservation" }) - public void testGetReservation() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceGroup" }) + public void testListInstanceGroupManagers() throws Exception { try { - GetReservationOptions getReservationOptions = new GetReservationOptions.Builder() - .id("testString") + ListInstanceGroupManagersOptions listInstanceGroupManagersOptions = new ListInstanceGroupManagersOptions.Builder() + .instanceGroupId("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.getReservation(getReservationOptions).execute(); + Response response = service.listInstanceGroupManagers(listInstanceGroupManagersOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Reservation reservationResult = response.getResult(); - assertNotNull(reservationResult); + InstanceGroupManagerCollection instanceGroupManagerCollectionResult = response.getResult(); + assertNotNull(instanceGroupManagerCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6318,45 +6196,87 @@ public void testGetReservation() throws Exception { } } - @Test(dependsOnMethods = { "testGetReservation" }) - public void testUpdateReservation() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroupManagers" }) + public void testListInstanceGroupManagersWithPager() throws Exception { try { - ReservationCapacityPatch reservationCapacityPatchModel = new ReservationCapacityPatch.Builder() - .total(Long.valueOf("10")) + ListInstanceGroupManagersOptions options = new ListInstanceGroupManagersOptions.Builder() + .instanceGroupId("testString") + .limit(Long.valueOf("10")) .build(); - ReservationCommittedUsePatch reservationCommittedUsePatchModel = new ReservationCommittedUsePatch.Builder() - .expirationPolicy("release") - .term("testString") - .build(); + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceGroupManagersPager pager = new InstanceGroupManagersPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - ReservationProfilePatch reservationProfilePatchModel = new ReservationProfilePatch.Builder() - .name("bx2-4x16") - .resourceType("bare_metal_server_profile") + // Test getAll(); + pager = new InstanceGroupManagersPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListInstanceGroupManagers" }) + public void testCreateInstanceGroupManager() throws Exception { + try { + InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype instanceGroupManagerPrototypeModel = new InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype.Builder() + .managementEnabled(true) + .name("my-instance-group-manager") + .aggregationWindow(Long.valueOf("120")) + .cooldown(Long.valueOf("210")) + .managerType("autoscale") + .maxMembershipCount(Long.valueOf("10")) + .minMembershipCount(Long.valueOf("10")) .build(); - ReservationPatch reservationPatchModel = new ReservationPatch.Builder() - .affinityPolicy("automatic") - .capacity(reservationCapacityPatchModel) - .committedUse(reservationCommittedUsePatchModel) - .name("my-reservation") - .profile(reservationProfilePatchModel) + CreateInstanceGroupManagerOptions createInstanceGroupManagerOptions = new CreateInstanceGroupManagerOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerPrototype(instanceGroupManagerPrototypeModel) .build(); - Map reservationPatchModelAsPatch = reservationPatchModel.asPatch(); - UpdateReservationOptions updateReservationOptions = new UpdateReservationOptions.Builder() + // Invoke operation + Response response = service.createInstanceGroupManager(createInstanceGroupManagerOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + InstanceGroupManager instanceGroupManagerResult = response.getResult(); + assertNotNull(instanceGroupManagerResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateInstanceGroupManager" }) + public void testGetInstanceGroupManager() throws Exception { + try { + GetInstanceGroupManagerOptions getInstanceGroupManagerOptions = new GetInstanceGroupManagerOptions.Builder() + .instanceGroupId("testString") .id("testString") - .reservationPatch(reservationPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateReservation(updateReservationOptions).execute(); + Response response = service.getInstanceGroupManager(getInstanceGroupManagerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Reservation reservationResult = response.getResult(); - assertNotNull(reservationResult); + InstanceGroupManager instanceGroupManagerResult = response.getResult(); + assertNotNull(instanceGroupManagerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6364,43 +6284,58 @@ public void testUpdateReservation() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateReservation" }) - public void testActivateReservation() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceGroupManager" }) + public void testUpdateInstanceGroupManager() throws Exception { try { - ActivateReservationOptions activateReservationOptions = new ActivateReservationOptions.Builder() + InstanceGroupManagerPatch instanceGroupManagerPatchModel = new InstanceGroupManagerPatch.Builder() + .aggregationWindow(Long.valueOf("120")) + .cooldown(Long.valueOf("210")) + .managementEnabled(false) + .maxMembershipCount(Long.valueOf("10")) + .minMembershipCount(Long.valueOf("10")) + .name("my-instance-group-manager") + .build(); + Map instanceGroupManagerPatchModelAsPatch = instanceGroupManagerPatchModel.asPatch(); + + UpdateInstanceGroupManagerOptions updateInstanceGroupManagerOptions = new UpdateInstanceGroupManagerOptions.Builder() + .instanceGroupId("testString") .id("testString") + .instanceGroupManagerPatch(instanceGroupManagerPatchModelAsPatch) .build(); // Invoke operation - Response response = service.activateReservation(activateReservationOptions).execute(); + Response response = service.updateInstanceGroupManager(updateInstanceGroupManagerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 200); + + InstanceGroupManager instanceGroupManagerResult = response.getResult(); + assertNotNull(instanceGroupManagerResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testActivateReservation" }) - public void testListDedicatedHostGroups() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceGroupManager" }) + public void testListInstanceGroupManagerActions() throws Exception { try { - ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() + ListInstanceGroupManagerActionsOptions listInstanceGroupManagerActionsOptions = new ListInstanceGroupManagerActionsOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") .build(); // Invoke operation - Response response = service.listDedicatedHostGroups(listDedicatedHostGroupsOptions).execute(); + Response response = service.listInstanceGroupManagerActions(listInstanceGroupManagerActionsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHostGroupCollection dedicatedHostGroupCollectionResult = response.getResult(); - assertNotNull(dedicatedHostGroupCollectionResult); + InstanceGroupManagerActionsCollection instanceGroupManagerActionsCollectionResult = response.getResult(); + assertNotNull(instanceGroupManagerActionsCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6408,29 +6343,28 @@ public void testListDedicatedHostGroups() throws Exception { } } - @Test(dependsOnMethods = { "testListDedicatedHostGroups" }) - public void testListDedicatedHostGroupsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroupManagerActions" }) + public void testListInstanceGroupManagerActionsWithPager() throws Exception { try { - ListDedicatedHostGroupsOptions options = new ListDedicatedHostGroupsOptions.Builder() + ListInstanceGroupManagerActionsOptions options = new ListInstanceGroupManagerActionsOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(service, options); + List allResults = new ArrayList<>(); + InstanceGroupManagerActionsPager pager = new InstanceGroupManagerActionsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new DedicatedHostGroupsPager(service, options); - List allItems = pager.getAll(); + pager = new InstanceGroupManagerActionsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -6442,33 +6376,33 @@ public void testListDedicatedHostGroupsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListDedicatedHostGroups" }) - public void testCreateDedicatedHostGroup() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroupManagerActions" }) + public void testCreateInstanceGroupManagerAction() throws Exception { try { - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + InstanceGroupManagerScheduledActionGroupPrototype instanceGroupManagerScheduledActionGroupPrototypeModel = new InstanceGroupManagerScheduledActionGroupPrototype.Builder() + .membershipCount(Long.valueOf("10")) .build(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.Builder() + .name("my-instance-group-manager-action") + .cronSpec("30 */2 * * 1-5") + .group(instanceGroupManagerScheduledActionGroupPrototypeModel) + .build(); - CreateDedicatedHostGroupOptions createDedicatedHostGroupOptions = new CreateDedicatedHostGroupOptions.Builder() - .xClass("mx2") - .family("balanced") - .zone(zoneIdentityModel) - .name("testString") - .resourceGroup(resourceGroupIdentityModel) + CreateInstanceGroupManagerActionOptions createInstanceGroupManagerActionOptions = new CreateInstanceGroupManagerActionOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .instanceGroupManagerActionPrototype(instanceGroupManagerActionPrototypeModel) .build(); // Invoke operation - Response response = service.createDedicatedHostGroup(createDedicatedHostGroupOptions).execute(); + Response response = service.createInstanceGroupManagerAction(createInstanceGroupManagerActionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); - assertNotNull(dedicatedHostGroupResult); + InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); + assertNotNull(instanceGroupManagerActionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6476,21 +6410,23 @@ public void testCreateDedicatedHostGroup() throws Exception { } } - @Test(dependsOnMethods = { "testCreateDedicatedHostGroup" }) - public void testGetDedicatedHostGroup() throws Exception { + @Test(dependsOnMethods = { "testCreateInstanceGroupManagerAction" }) + public void testGetInstanceGroupManagerAction() throws Exception { try { - GetDedicatedHostGroupOptions getDedicatedHostGroupOptions = new GetDedicatedHostGroupOptions.Builder() + GetInstanceGroupManagerActionOptions getInstanceGroupManagerActionOptions = new GetInstanceGroupManagerActionOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getDedicatedHostGroup(getDedicatedHostGroupOptions).execute(); + Response response = service.getInstanceGroupManagerAction(getInstanceGroupManagerActionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); - assertNotNull(dedicatedHostGroupResult); + InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); + assertNotNull(instanceGroupManagerActionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6498,27 +6434,44 @@ public void testGetDedicatedHostGroup() throws Exception { } } - @Test(dependsOnMethods = { "testGetDedicatedHostGroup" }) - public void testUpdateDedicatedHostGroup() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceGroupManagerAction" }) + public void testUpdateInstanceGroupManagerAction() throws Exception { try { - DedicatedHostGroupPatch dedicatedHostGroupPatchModel = new DedicatedHostGroupPatch.Builder() - .name("my-dedicated-host-group-updated") + InstanceGroupManagerActionGroupPatch instanceGroupManagerActionGroupPatchModel = new InstanceGroupManagerActionGroupPatch.Builder() + .membershipCount(Long.valueOf("10")) .build(); - Map dedicatedHostGroupPatchModelAsPatch = dedicatedHostGroupPatchModel.asPatch(); - UpdateDedicatedHostGroupOptions updateDedicatedHostGroupOptions = new UpdateDedicatedHostGroupOptions.Builder() + InstanceGroupManagerActionManagerPatch instanceGroupManagerActionManagerPatchModel = new InstanceGroupManagerActionManagerPatch.Builder() + .maxMembershipCount(Long.valueOf("10")) + .minMembershipCount(Long.valueOf("10")) + .build(); + + InstanceGroupManagerActionPatch instanceGroupManagerActionPatchModel = new InstanceGroupManagerActionPatch.Builder() + .autoDelete(false) + .autoDeleteTimeout(Long.valueOf("24")) + .cronSpec("30 */2 * * 1-5") + .group(instanceGroupManagerActionGroupPatchModel) + .manager(instanceGroupManagerActionManagerPatchModel) + .name("my-instance-group-manager-action") + .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + Map instanceGroupManagerActionPatchModelAsPatch = instanceGroupManagerActionPatchModel.asPatch(); + + UpdateInstanceGroupManagerActionOptions updateInstanceGroupManagerActionOptions = new UpdateInstanceGroupManagerActionOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") .id("testString") - .dedicatedHostGroupPatch(dedicatedHostGroupPatchModelAsPatch) + .instanceGroupManagerActionPatch(instanceGroupManagerActionPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateDedicatedHostGroup(updateDedicatedHostGroupOptions).execute(); + Response response = service.updateInstanceGroupManagerAction(updateInstanceGroupManagerActionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHostGroup dedicatedHostGroupResult = response.getResult(); - assertNotNull(dedicatedHostGroupResult); + InstanceGroupManagerAction instanceGroupManagerActionResult = response.getResult(); + assertNotNull(instanceGroupManagerActionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6526,22 +6479,24 @@ public void testUpdateDedicatedHostGroup() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateDedicatedHostGroup" }) - public void testListDedicatedHostProfiles() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceGroupManagerAction" }) + public void testListInstanceGroupManagerPolicies() throws Exception { try { - ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() + ListInstanceGroupManagerPoliciesOptions listInstanceGroupManagerPoliciesOptions = new ListInstanceGroupManagerPoliciesOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listDedicatedHostProfiles(listDedicatedHostProfilesOptions).execute(); + Response response = service.listInstanceGroupManagerPolicies(listInstanceGroupManagerPoliciesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHostProfileCollection dedicatedHostProfileCollectionResult = response.getResult(); - assertNotNull(dedicatedHostProfileCollectionResult); + InstanceGroupManagerPolicyCollection instanceGroupManagerPolicyCollectionResult = response.getResult(); + assertNotNull(instanceGroupManagerPolicyCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6549,26 +6504,28 @@ public void testListDedicatedHostProfiles() throws Exception { } } - @Test(dependsOnMethods = { "testListDedicatedHostProfiles" }) - public void testListDedicatedHostProfilesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroupManagerPolicies" }) + public void testListInstanceGroupManagerPoliciesWithPager() throws Exception { try { - ListDedicatedHostProfilesOptions options = new ListDedicatedHostProfilesOptions.Builder() + ListInstanceGroupManagerPoliciesOptions options = new ListInstanceGroupManagerPoliciesOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") .limit(Long.valueOf("10")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(service, options); + List allResults = new ArrayList<>(); + InstanceGroupManagerPoliciesPager pager = new InstanceGroupManagerPoliciesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new DedicatedHostProfilesPager(service, options); - List allItems = pager.getAll(); + pager = new InstanceGroupManagerPoliciesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -6580,21 +6537,30 @@ public void testListDedicatedHostProfilesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListDedicatedHostProfiles" }) - public void testGetDedicatedHostProfile() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroupManagerPolicies" }) + public void testCreateInstanceGroupManagerPolicy() throws Exception { try { - GetDedicatedHostProfileOptions getDedicatedHostProfileOptions = new GetDedicatedHostProfileOptions.Builder() - .name("mx2-host-152x1216") + InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype instanceGroupManagerPolicyPrototypeModel = new InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.Builder() + .name("my-instance-group-manager-policy") + .metricType("cpu") + .metricValue(Long.valueOf("0")) + .policyType("target") + .build(); + + CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptions = new CreateInstanceGroupManagerPolicyOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .instanceGroupManagerPolicyPrototype(instanceGroupManagerPolicyPrototypeModel) .build(); // Invoke operation - Response response = service.getDedicatedHostProfile(getDedicatedHostProfileOptions).execute(); + Response response = service.createInstanceGroupManagerPolicy(createInstanceGroupManagerPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - DedicatedHostProfile dedicatedHostProfileResult = response.getResult(); - assertNotNull(dedicatedHostProfileResult); + InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); + assertNotNull(instanceGroupManagerPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6602,103 +6568,55 @@ public void testGetDedicatedHostProfile() throws Exception { } } - @Test(dependsOnMethods = { "testGetDedicatedHostProfile" }) - public void testListDedicatedHosts() throws Exception { + @Test(dependsOnMethods = { "testCreateInstanceGroupManagerPolicy" }) + public void testGetInstanceGroupManagerPolicy() throws Exception { try { - ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() - .dedicatedHostGroupId("testString") - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") + GetInstanceGroupManagerPolicyOptions getInstanceGroupManagerPolicyOptions = new GetInstanceGroupManagerPolicyOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.listDedicatedHosts(listDedicatedHostsOptions).execute(); + Response response = service.getInstanceGroupManagerPolicy(getInstanceGroupManagerPolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHostCollection dedicatedHostCollectionResult = response.getResult(); - assertNotNull(dedicatedHostCollectionResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListDedicatedHosts" }) - public void testListDedicatedHostsWithPager() throws Exception { - try { - ListDedicatedHostsOptions options = new ListDedicatedHostsOptions.Builder() - .dedicatedHostGroupId("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") - .build(); - - // Test getNext(). - List allResults = new ArrayList<>(); - DedicatedHostsPager pager = new DedicatedHostsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); - - // Test getAll(); - pager = new DedicatedHostsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); + assertNotNull(instanceGroupManagerPolicyResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListDedicatedHosts" }) - public void testCreateDedicatedHost() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceGroupManagerPolicy" }) + public void testUpdateInstanceGroupManagerPolicy() throws Exception { try { - DedicatedHostProfileIdentityByName dedicatedHostProfileIdentityModel = new DedicatedHostProfileIdentityByName.Builder() - .name("mx2-host-152x1216") - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - DedicatedHostGroupIdentityById dedicatedHostGroupIdentityModel = new DedicatedHostGroupIdentityById.Builder() - .id("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0") - .build(); - - DedicatedHostPrototypeDedicatedHostByGroup dedicatedHostPrototypeModel = new DedicatedHostPrototypeDedicatedHostByGroup.Builder() - .instancePlacementEnabled(true) - .name("my-host") - .profile(dedicatedHostProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .group(dedicatedHostGroupIdentityModel) + InstanceGroupManagerPolicyPatch instanceGroupManagerPolicyPatchModel = new InstanceGroupManagerPolicyPatch.Builder() + .metricType("cpu") + .metricValue(Long.valueOf("75")) + .name("my-instance-group-manager-policy") .build(); + Map instanceGroupManagerPolicyPatchModelAsPatch = instanceGroupManagerPolicyPatchModel.asPatch(); - CreateDedicatedHostOptions createDedicatedHostOptions = new CreateDedicatedHostOptions.Builder() - .dedicatedHostPrototype(dedicatedHostPrototypeModel) + UpdateInstanceGroupManagerPolicyOptions updateInstanceGroupManagerPolicyOptions = new UpdateInstanceGroupManagerPolicyOptions.Builder() + .instanceGroupId("testString") + .instanceGroupManagerId("testString") + .id("testString") + .instanceGroupManagerPolicyPatch(instanceGroupManagerPolicyPatchModelAsPatch) .build(); // Invoke operation - Response response = service.createDedicatedHost(createDedicatedHostOptions).execute(); + Response response = service.updateInstanceGroupManagerPolicy(updateInstanceGroupManagerPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - DedicatedHost dedicatedHostResult = response.getResult(); - assertNotNull(dedicatedHostResult); + InstanceGroupManagerPolicy instanceGroupManagerPolicyResult = response.getResult(); + assertNotNull(instanceGroupManagerPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6706,21 +6624,23 @@ public void testCreateDedicatedHost() throws Exception { } } - @Test(dependsOnMethods = { "testCreateDedicatedHost" }) - public void testListDedicatedHostDisks() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceGroupManagerPolicy" }) + public void testListInstanceGroupMemberships() throws Exception { try { - ListDedicatedHostDisksOptions listDedicatedHostDisksOptions = new ListDedicatedHostDisksOptions.Builder() - .dedicatedHostId("testString") + ListInstanceGroupMembershipsOptions listInstanceGroupMembershipsOptions = new ListInstanceGroupMembershipsOptions.Builder() + .instanceGroupId("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listDedicatedHostDisks(listDedicatedHostDisksOptions).execute(); + Response response = service.listInstanceGroupMemberships(listInstanceGroupMembershipsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHostDiskCollection dedicatedHostDiskCollectionResult = response.getResult(); - assertNotNull(dedicatedHostDiskCollectionResult); + InstanceGroupMembershipCollection instanceGroupMembershipCollectionResult = response.getResult(); + assertNotNull(instanceGroupMembershipCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6728,51 +6648,54 @@ public void testListDedicatedHostDisks() throws Exception { } } - @Test(dependsOnMethods = { "testListDedicatedHostDisks" }) - public void testGetDedicatedHostDisk() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroupMemberships" }) + public void testListInstanceGroupMembershipsWithPager() throws Exception { try { - GetDedicatedHostDiskOptions getDedicatedHostDiskOptions = new GetDedicatedHostDiskOptions.Builder() - .dedicatedHostId("testString") - .id("testString") + ListInstanceGroupMembershipsOptions options = new ListInstanceGroupMembershipsOptions.Builder() + .instanceGroupId("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.getDedicatedHostDisk(getDedicatedHostDiskOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceGroupMembershipsPager pager = new InstanceGroupMembershipsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - DedicatedHostDisk dedicatedHostDiskResult = response.getResult(); - assertNotNull(dedicatedHostDiskResult); + // Test getAll(); + pager = new InstanceGroupMembershipsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetDedicatedHostDisk" }) - public void testUpdateDedicatedHostDisk() throws Exception { + @Test(dependsOnMethods = { "testListInstanceGroupMemberships" }) + public void testGetInstanceGroupMembership() throws Exception { try { - DedicatedHostDiskPatch dedicatedHostDiskPatchModel = new DedicatedHostDiskPatch.Builder() - .name("my-dedicated-host-disk-updated") - .build(); - Map dedicatedHostDiskPatchModelAsPatch = dedicatedHostDiskPatchModel.asPatch(); - - UpdateDedicatedHostDiskOptions updateDedicatedHostDiskOptions = new UpdateDedicatedHostDiskOptions.Builder() - .dedicatedHostId("testString") + GetInstanceGroupMembershipOptions getInstanceGroupMembershipOptions = new GetInstanceGroupMembershipOptions.Builder() + .instanceGroupId("testString") .id("testString") - .dedicatedHostDiskPatch(dedicatedHostDiskPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateDedicatedHostDisk(updateDedicatedHostDiskOptions).execute(); + Response response = service.getInstanceGroupMembership(getInstanceGroupMembershipOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHostDisk dedicatedHostDiskResult = response.getResult(); - assertNotNull(dedicatedHostDiskResult); + InstanceGroupMembership instanceGroupMembershipResult = response.getResult(); + assertNotNull(instanceGroupMembershipResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6780,21 +6703,29 @@ public void testUpdateDedicatedHostDisk() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateDedicatedHostDisk" }) - public void testGetDedicatedHost() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceGroupMembership" }) + public void testUpdateInstanceGroupMembership() throws Exception { try { - GetDedicatedHostOptions getDedicatedHostOptions = new GetDedicatedHostOptions.Builder() + InstanceGroupMembershipPatch instanceGroupMembershipPatchModel = new InstanceGroupMembershipPatch.Builder() + .deleteInstanceOnMembershipDelete(false) + .name("my-instance-group-membership") + .build(); + Map instanceGroupMembershipPatchModelAsPatch = instanceGroupMembershipPatchModel.asPatch(); + + UpdateInstanceGroupMembershipOptions updateInstanceGroupMembershipOptions = new UpdateInstanceGroupMembershipOptions.Builder() + .instanceGroupId("testString") .id("testString") + .instanceGroupMembershipPatch(instanceGroupMembershipPatchModelAsPatch) .build(); // Invoke operation - Response response = service.getDedicatedHost(getDedicatedHostOptions).execute(); + Response response = service.updateInstanceGroupMembership(updateInstanceGroupMembershipOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHost dedicatedHostResult = response.getResult(); - assertNotNull(dedicatedHostResult); + InstanceGroupMembership instanceGroupMembershipResult = response.getResult(); + assertNotNull(instanceGroupMembershipResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6802,28 +6733,19 @@ public void testGetDedicatedHost() throws Exception { } } - @Test(dependsOnMethods = { "testGetDedicatedHost" }) - public void testUpdateDedicatedHost() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceGroupMembership" }) + public void testListInstanceTemplates() throws Exception { try { - DedicatedHostPatch dedicatedHostPatchModel = new DedicatedHostPatch.Builder() - .instancePlacementEnabled(false) - .name("my-host") - .build(); - Map dedicatedHostPatchModelAsPatch = dedicatedHostPatchModel.asPatch(); - - UpdateDedicatedHostOptions updateDedicatedHostOptions = new UpdateDedicatedHostOptions.Builder() - .id("testString") - .dedicatedHostPatch(dedicatedHostPatchModelAsPatch) - .build(); + ListInstanceTemplatesOptions listInstanceTemplatesOptions = new ListInstanceTemplatesOptions(); // Invoke operation - Response response = service.updateDedicatedHost(updateDedicatedHostOptions).execute(); + Response response = service.listInstanceTemplates(listInstanceTemplatesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - DedicatedHost dedicatedHostResult = response.getResult(); - assertNotNull(dedicatedHostResult); + InstanceTemplateCollection instanceTemplateCollectionResult = response.getResult(); + assertNotNull(instanceTemplateCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6831,154 +6753,231 @@ public void testUpdateDedicatedHost() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateDedicatedHost" }) - public void testListPlacementGroups() throws Exception { + @Test(dependsOnMethods = { "testListInstanceTemplates" }) + public void testCreateInstanceTemplate() throws Exception { try { - ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) + InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() + .hostFailure("restart") .build(); - // Invoke operation - Response response = service.listPlacementGroups(listPlacementGroupsOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - PlacementGroupCollection placementGroupCollectionResult = response.getResult(); - assertNotNull(placementGroupCollectionResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") + .build(); - @Test(dependsOnMethods = { "testListPlacementGroups" }) - public void testListPlacementGroupsWithPager() throws Exception { - try { - ListPlacementGroupsOptions options = new ListPlacementGroupsOptions.Builder() - .limit(Long.valueOf("10")) + ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() + .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - PlacementGroupsPager pager = new PlacementGroupsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() + .autoDelete(false) + .name("my-cluster-network-interface") + .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) + .subnet(clusterNetworkSubnetIdentityModel) + .build(); - // Test getAll(); - pager = new PlacementGroupsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + InstanceClusterNetworkAttachmentPrototypeInstanceContext instanceClusterNetworkAttachmentPrototypeInstanceContextModel = new InstanceClusterNetworkAttachmentPrototypeInstanceContext.Builder() + .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) + .name("my-instance-network-attachment") + .build(); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); - @Test(dependsOnMethods = { "testListPlacementGroups" }) - public void testCreatePlacementGroup() throws Exception { - try { - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) .build(); - CreatePlacementGroupOptions createPlacementGroupOptions = new CreatePlacementGroupOptions.Builder() - .strategy("host_spread") - .name("my-placement-group") - .resourceGroup(resourceGroupIdentityModel) + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") .build(); - // Invoke operation - Response response = service.createPlacementGroup(createPlacementGroupOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() + .enabled(false) + .protocol("https") + .responseHopLimit(Long.valueOf("2")) + .build(); - PlacementGroup placementGroupResult = response.getResult(); - assertNotNull(placementGroupResult); + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() + .name("bx2-4x16") + .build(); - @Test(dependsOnMethods = { "testCreatePlacementGroup" }) - public void testGetPlacementGroup() throws Exception { - try { - GetPlacementGroupOptions getPlacementGroupOptions = new GetPlacementGroupOptions.Builder() - .id("testString") + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") .build(); - // Invoke operation - Response response = service.getPlacementGroup(getPlacementGroupOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + InstanceReservationAffinityPrototype instanceReservationAffinityPrototypeModel = new InstanceReservationAffinityPrototype.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) + .build(); - PlacementGroup placementGroupResult = response.getResult(); - assertNotNull(placementGroupResult); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); - @Test(dependsOnMethods = { "testGetPlacementGroup" }) - public void testUpdatePlacementGroup() throws Exception { - try { - PlacementGroupPatch placementGroupPatchModel = new PlacementGroupPatch.Builder() - .name("my-placement-group-updated") + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() + .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); - Map placementGroupPatchModelAsPatch = placementGroupPatchModel.asPatch(); - UpdatePlacementGroupOptions updatePlacementGroupOptions = new UpdatePlacementGroupOptions.Builder() - .id("testString") - .placementGroupPatch(placementGroupPatchModelAsPatch) + VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype.Builder() + .deleteVolumeOnInstanceDelete(false) + .name("my-volume-attachment") + .volume(volumeAttachmentPrototypeVolumeModel) .build(); - // Invoke operation - Response response = service.updatePlacementGroup(updatePlacementGroupOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); - PlacementGroup placementGroupResult = response.getResult(); - assertNotNull(placementGroupResult); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); - @Test(dependsOnMethods = { "testUpdatePlacementGroup" }) - public void testListBareMetalServerProfiles() throws Exception { - try { - ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("general-purpose") .build(); - // Invoke operation - Response response = service.listBareMetalServerProfiles(listBareMetalServerProfilesOptions).execute(); + VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) + .bandwidth(Long.valueOf("1000")) + .capacity(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-boot-volume") + .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .build(); + + VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceByImageContextModel) + .build(); + + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() + .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .build(); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + InstanceNetworkAttachmentPrototype instanceNetworkAttachmentPrototypeModel = new InstanceNetworkAttachmentPrototype.Builder() + .name("my-instance-network-attachment") + .virtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .build(); + + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.Builder() + .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) + .clusterNetworkAttachments(java.util.Arrays.asList(instanceClusterNetworkAttachmentPrototypeInstanceContextModel)) + .confidentialComputeMode("disabled") + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .enableSecureBoot(true) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance") + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .reservationAffinity(instanceReservationAffinityPrototypeModel) + .resourceGroup(resourceGroupIdentityModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .vcpu(instanceVcpuPrototypeModel) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") + .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .image(imageIdentityModel) + .zone(zoneIdentityModel) + .networkAttachments(java.util.Arrays.asList(instanceNetworkAttachmentPrototypeModel)) + .primaryNetworkAttachment(instanceNetworkAttachmentPrototypeModel) + .build(); + + CreateInstanceTemplateOptions createInstanceTemplateOptions = new CreateInstanceTemplateOptions.Builder() + .instanceTemplatePrototype(instanceTemplatePrototypeModel) + .build(); + + // Invoke operation + Response response = service.createInstanceTemplate(createInstanceTemplateOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + InstanceTemplate instanceTemplateResult = response.getResult(); + assertNotNull(instanceTemplateResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateInstanceTemplate" }) + public void testGetInstanceTemplate() throws Exception { + try { + GetInstanceTemplateOptions getInstanceTemplateOptions = new GetInstanceTemplateOptions.Builder() + .id("testString") + .build(); + + // Invoke operation + Response response = service.getInstanceTemplate(getInstanceTemplateOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerProfileCollection bareMetalServerProfileCollectionResult = response.getResult(); - assertNotNull(bareMetalServerProfileCollectionResult); + InstanceTemplate instanceTemplateResult = response.getResult(); + assertNotNull(instanceTemplateResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -6986,52 +6985,69 @@ public void testListBareMetalServerProfiles() throws Exception { } } - @Test(dependsOnMethods = { "testListBareMetalServerProfiles" }) - public void testListBareMetalServerProfilesWithPager() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceTemplate" }) + public void testUpdateInstanceTemplate() throws Exception { try { - ListBareMetalServerProfilesOptions options = new ListBareMetalServerProfilesOptions.Builder() - .limit(Long.valueOf("10")) + InstanceTemplatePatch instanceTemplatePatchModel = new InstanceTemplatePatch.Builder() + .name("my-instance-template-updated") .build(); + Map instanceTemplatePatchModelAsPatch = instanceTemplatePatchModel.asPatch(); - // Test getNext(). - List allResults = new ArrayList<>(); - BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + UpdateInstanceTemplateOptions updateInstanceTemplateOptions = new UpdateInstanceTemplateOptions.Builder() + .id("testString") + .instanceTemplatePatch(instanceTemplatePatchModelAsPatch) + .build(); - // Test getAll(); - pager = new BareMetalServerProfilesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + // Invoke operation + Response response = service.updateInstanceTemplate(updateInstanceTemplateOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + InstanceTemplate instanceTemplateResult = response.getResult(); + assertNotNull(instanceTemplateResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListBareMetalServerProfiles" }) - public void testGetBareMetalServerProfile() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceTemplate" }) + public void testListInstanceProfiles() throws Exception { try { - GetBareMetalServerProfileOptions getBareMetalServerProfileOptions = new GetBareMetalServerProfileOptions.Builder() - .name("bx2-metal-192x768") + ListInstanceProfilesOptions listInstanceProfilesOptions = new ListInstanceProfilesOptions(); + + // Invoke operation + Response response = service.listInstanceProfiles(listInstanceProfilesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + InstanceProfileCollection instanceProfileCollectionResult = response.getResult(); + assertNotNull(instanceProfileCollectionResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListInstanceProfiles" }) + public void testGetInstanceProfile() throws Exception { + try { + GetInstanceProfileOptions getInstanceProfileOptions = new GetInstanceProfileOptions.Builder() + .name("mx2-host-152x1216") .build(); // Invoke operation - Response response = service.getBareMetalServerProfile(getBareMetalServerProfileOptions).execute(); + Response response = service.getInstanceProfile(getInstanceProfileOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerProfile bareMetalServerProfileResult = response.getResult(); - assertNotNull(bareMetalServerProfileResult); + InstanceProfile instanceProfileResult = response.getResult(); + assertNotNull(instanceProfileResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7039,14 +7055,26 @@ public void testGetBareMetalServerProfile() throws Exception { } } - @Test(dependsOnMethods = { "testGetBareMetalServerProfile" }) - public void testListBareMetalServers() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceProfile" }) + public void testListInstances() throws Exception { try { - ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() + ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("my-name") + .clusterNetworkId("testString") + .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") + .clusterNetworkName("my-cluster-network") + .dedicatedHostId("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") + .instanceGroupMembershipInstanceGroupId("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .instanceGroupMembershipInstanceGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .placementGroupId("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") + .reservationAffinityPolicy("automatic") .reservationId("testString") .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") .reservationName("my-reservation") @@ -7056,13 +7084,13 @@ public void testListBareMetalServers() throws Exception { .build(); // Invoke operation - Response response = service.listBareMetalServers(listBareMetalServersOptions).execute(); + Response response = service.listInstances(listInstancesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerCollection bareMetalServerCollectionResult = response.getResult(); - assertNotNull(bareMetalServerCollectionResult); + InstanceCollection instanceCollectionResult = response.getResult(); + assertNotNull(instanceCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7070,13 +7098,25 @@ public void testListBareMetalServers() throws Exception { } } - @Test(dependsOnMethods = { "testListBareMetalServers" }) - public void testListBareMetalServersWithPager() throws Exception { + @Test(dependsOnMethods = { "testListInstances" }) + public void testListInstancesWithPager() throws Exception { try { - ListBareMetalServersOptions options = new ListBareMetalServersOptions.Builder() + ListInstancesOptions options = new ListInstancesOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") .name("my-name") + .clusterNetworkId("testString") + .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") + .clusterNetworkName("my-cluster-network") + .dedicatedHostId("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") + .instanceGroupMembershipInstanceGroupId("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .instanceGroupMembershipInstanceGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .placementGroupId("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") + .reservationAffinityPolicy("automatic") .reservationId("testString") .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") .reservationName("my-reservation") @@ -7086,18 +7126,18 @@ public void testListBareMetalServersWithPager() throws Exception { .build(); // Test getNext(). - List allResults = new ArrayList<>(); - BareMetalServersPager pager = new BareMetalServersPager(service, options); + List allResults = new ArrayList<>(); + InstancesPager pager = new InstancesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new BareMetalServersPager(service, options); - List allItems = pager.getAll(); + pager = new InstancesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -7109,32 +7149,67 @@ public void testListBareMetalServersWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListBareMetalServers" }) - public void testCreateBareMetalServer() throws Exception { + @Test(dependsOnMethods = { "testListInstances" }) + public void testCreateInstance() throws Exception { try { - ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() + .hostFailure("restart") .build(); - KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") .build(); - BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() - .image(imageIdentityModel) - .keys(java.util.Arrays.asList(keyIdentityModel)) - .userData("testString") + ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() + .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") .build(); - BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() - .name("bx2-metal-192x768") + InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() + .autoDelete(false) + .name("my-cluster-network-interface") + .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) + .subnet(clusterNetworkSubnetIdentityModel) + .build(); + + InstanceClusterNetworkAttachmentPrototypeInstanceContext instanceClusterNetworkAttachmentPrototypeInstanceContextModel = new InstanceClusterNetworkAttachmentPrototypeInstanceContext.Builder() + .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) + .name("my-instance-network-attachment") + .build(); + + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + + InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") + .build(); + + InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() + .enabled(false) + .protocol("https") + .responseHopLimit(Long.valueOf("2")) + .build(); + + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("r006-418fe842-a3e9-47b9-a938-1aa5bd632871") + .build(); + + InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() + .name("bx2-2x8") .build(); ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") .build(); - BareMetalServerReservationAffinityPrototype bareMetalServerReservationAffinityPrototypeModel = new BareMetalServerReservationAffinityPrototype.Builder() + InstanceReservationAffinityPrototype instanceReservationAffinityPrototypeModel = new InstanceReservationAffinityPrototype.Builder() .policy("automatic") .pool(java.util.Arrays.asList(reservationIdentityModel)) .build(); @@ -7143,25 +7218,72 @@ public void testCreateBareMetalServer() throws Exception { .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - BareMetalServerTrustedPlatformModulePrototype bareMetalServerTrustedPlatformModulePrototypeModel = new BareMetalServerTrustedPlatformModulePrototype.Builder() - .mode("disabled") + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("5iops-tier") + .build(); + + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + + VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.Builder() + .bandwidth(Long.valueOf("1000")) + .iops(Long.valueOf("10000")) + .name("my-data-volume") + .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .capacity(Long.valueOf("1000")) + .encryptionKey(encryptionKeyIdentityModel) + .build(); + + VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype.Builder() + .deleteVolumeOnInstanceDelete(false) + .name("my-volume-attachment") + .volume(volumeAttachmentPrototypeVolumeModel) .build(); VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") + VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) + .bandwidth(Long.valueOf("1000")) + .capacity(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-boot-volume") + .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) .build(); - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceByImageContextModel) + .build(); + + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() + .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .build(); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() .address("10.0.0.5") .autoDelete(false) .name("my-reserved-ip") @@ -7175,60 +7297,52 @@ public void testCreateBareMetalServer() throws Exception { .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.Builder() + NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) + .name("my-instance-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .subnet(subnetIdentityModel) .build(); - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype bareMetalServerNetworkAttachmentPrototypeModel = new BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.Builder() - .name("my-bare-metal-server-network-attachment") - .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .allowedVlans(java.util.Arrays.asList(Long.valueOf(""))) - .interfaceType("pci") - .build(); - - BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype bareMetalServerPrimaryNetworkAttachmentPrototypeModel = new BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype.Builder() - .name("my-bare-metal-server-network-attachment") - .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .allowedVlans(java.util.Arrays.asList(Long.valueOf(""))) - .interfaceType("pci") - .build(); - - BareMetalServerPrototypeBareMetalServerByNetworkAttachment bareMetalServerPrototypeModel = new BareMetalServerPrototypeBareMetalServerByNetworkAttachment.Builder() - .bandwidth(Long.valueOf("20000")) - .enableSecureBoot(false) - .initialization(bareMetalServerInitializationPrototypeModel) - .name("my-bare-metal-server") - .profile(bareMetalServerProfileIdentityModel) - .reservationAffinity(bareMetalServerReservationAffinityPrototypeModel) + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface instancePrototypeModel = new InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.Builder() + .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) + .clusterNetworkAttachments(java.util.Arrays.asList(instanceClusterNetworkAttachmentPrototypeInstanceContextModel)) + .confidentialComputeMode("disabled") + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .enableSecureBoot(true) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance") + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .reservationAffinity(instanceReservationAffinityPrototypeModel) .resourceGroup(resourceGroupIdentityModel) - .trustedPlatformModule(bareMetalServerTrustedPlatformModulePrototypeModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .vcpu(instanceVcpuPrototypeModel) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .image(imageIdentityModel) .zone(zoneIdentityModel) - .networkAttachments(java.util.Arrays.asList(bareMetalServerNetworkAttachmentPrototypeModel)) - .primaryNetworkAttachment(bareMetalServerPrimaryNetworkAttachmentPrototypeModel) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) + .primaryNetworkInterface(networkInterfacePrototypeModel) .build(); - CreateBareMetalServerOptions createBareMetalServerOptions = new CreateBareMetalServerOptions.Builder() - .bareMetalServerPrototype(bareMetalServerPrototypeModel) + CreateInstanceOptions createInstanceOptions = new CreateInstanceOptions.Builder() + .instancePrototype(instancePrototypeModel) .build(); // Invoke operation - Response response = service.createBareMetalServer(createBareMetalServerOptions).execute(); + Response response = service.createInstance(createInstanceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - BareMetalServer bareMetalServerResult = response.getResult(); - assertNotNull(bareMetalServerResult); + Instance instanceResult = response.getResult(); + assertNotNull(instanceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7236,23 +7350,21 @@ public void testCreateBareMetalServer() throws Exception { } } - @Test(dependsOnMethods = { "testCreateBareMetalServer" }) - public void testCreateBareMetalServerConsoleAccessToken() throws Exception { + @Test(dependsOnMethods = { "testCreateInstance" }) + public void testGetInstance() throws Exception { try { - CreateBareMetalServerConsoleAccessTokenOptions createBareMetalServerConsoleAccessTokenOptions = new CreateBareMetalServerConsoleAccessTokenOptions.Builder() - .bareMetalServerId("testString") - .consoleType("serial") - .force(false) + GetInstanceOptions getInstanceOptions = new GetInstanceOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.createBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptions).execute(); + Response response = service.getInstance(getInstanceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerConsoleAccessToken bareMetalServerConsoleAccessTokenResult = response.getResult(); - assertNotNull(bareMetalServerConsoleAccessTokenResult); + Instance instanceResult = response.getResult(); + assertNotNull(instanceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7260,21 +7372,69 @@ public void testCreateBareMetalServerConsoleAccessToken() throws Exception { } } - @Test(dependsOnMethods = { "testCreateBareMetalServerConsoleAccessToken" }) - public void testListBareMetalServerDisks() throws Exception { + @Test(dependsOnMethods = { "testGetInstance" }) + public void testUpdateInstance() throws Exception { try { - ListBareMetalServerDisksOptions listBareMetalServerDisksOptions = new ListBareMetalServerDisksOptions.Builder() - .bareMetalServerId("testString") + InstanceAvailabilityPolicyPatch instanceAvailabilityPolicyPatchModel = new InstanceAvailabilityPolicyPatch.Builder() + .hostFailure("restart") + .build(); + + InstanceMetadataServicePatch instanceMetadataServicePatchModel = new InstanceMetadataServicePatch.Builder() + .enabled(true) + .protocol("http") + .responseHopLimit(Long.valueOf("1")) + .build(); + + InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPatchModel = new InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); + + InstancePatchProfileInstanceProfileIdentityByName instancePatchProfileModel = new InstancePatchProfileInstanceProfileIdentityByName.Builder() + .name("bx2-4x16") + .build(); + + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .build(); + + InstanceReservationAffinityPatch instanceReservationAffinityPatchModel = new InstanceReservationAffinityPatch.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) + .build(); + + InstanceVCPUPatch instanceVcpuPatchModel = new InstanceVCPUPatch.Builder() + .percentage(Long.valueOf("100")) + .build(); + + InstancePatch instancePatchModel = new InstancePatch.Builder() + .availabilityPolicy(instanceAvailabilityPolicyPatchModel) + .confidentialComputeMode("disabled") + .enableSecureBoot(true) + .metadataService(instanceMetadataServicePatchModel) + .name("my-instance") + .placementTarget(instancePlacementTargetPatchModel) + .profile(instancePatchProfileModel) + .reservationAffinity(instanceReservationAffinityPatchModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .vcpu(instanceVcpuPatchModel) + .volumeBandwidthQosMode("pooled") + .build(); + Map instancePatchModelAsPatch = instancePatchModel.asPatch(); + + UpdateInstanceOptions updateInstanceOptions = new UpdateInstanceOptions.Builder() + .id("testString") + .instancePatch(instancePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.listBareMetalServerDisks(listBareMetalServerDisksOptions).execute(); + Response response = service.updateInstance(updateInstanceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerDiskCollection bareMetalServerDiskCollectionResult = response.getResult(); - assertNotNull(bareMetalServerDiskCollectionResult); + Instance instanceResult = response.getResult(); + assertNotNull(instanceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7282,22 +7442,21 @@ public void testListBareMetalServerDisks() throws Exception { } } - @Test(dependsOnMethods = { "testListBareMetalServerDisks" }) - public void testGetBareMetalServerDisk() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstance" }) + public void testGetInstanceInitialization() throws Exception { try { - GetBareMetalServerDiskOptions getBareMetalServerDiskOptions = new GetBareMetalServerDiskOptions.Builder() - .bareMetalServerId("testString") + GetInstanceInitializationOptions getInstanceInitializationOptions = new GetInstanceInitializationOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getBareMetalServerDisk(getBareMetalServerDiskOptions).execute(); + Response response = service.getInstanceInitialization(getInstanceInitializationOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerDisk bareMetalServerDiskResult = response.getResult(); - assertNotNull(bareMetalServerDiskResult); + InstanceInitialization instanceInitializationResult = response.getResult(); + assertNotNull(instanceInitializationResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7305,28 +7464,23 @@ public void testGetBareMetalServerDisk() throws Exception { } } - @Test(dependsOnMethods = { "testGetBareMetalServerDisk" }) - public void testUpdateBareMetalServerDisk() throws Exception { - try { - BareMetalServerDiskPatch bareMetalServerDiskPatchModel = new BareMetalServerDiskPatch.Builder() - .name("my-bare-metal-server-disk-updated") - .build(); - Map bareMetalServerDiskPatchModelAsPatch = bareMetalServerDiskPatchModel.asPatch(); - - UpdateBareMetalServerDiskOptions updateBareMetalServerDiskOptions = new UpdateBareMetalServerDiskOptions.Builder() - .bareMetalServerId("testString") - .id("testString") - .bareMetalServerDiskPatch(bareMetalServerDiskPatchModelAsPatch) + @Test(dependsOnMethods = { "testGetInstanceInitialization" }) + public void testCreateInstanceAction() throws Exception { + try { + CreateInstanceActionOptions createInstanceActionOptions = new CreateInstanceActionOptions.Builder() + .instanceId("testString") + .type("reboot") + .force(true) .build(); // Invoke operation - Response response = service.updateBareMetalServerDisk(updateBareMetalServerDiskOptions).execute(); + Response response = service.createInstanceAction(createInstanceActionOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - BareMetalServerDisk bareMetalServerDiskResult = response.getResult(); - assertNotNull(bareMetalServerDiskResult); + InstanceAction instanceActionResult = response.getResult(); + assertNotNull(instanceActionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7334,23 +7488,23 @@ public void testUpdateBareMetalServerDisk() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateBareMetalServerDisk" }) - public void testListBareMetalServerNetworkAttachments() throws Exception { + @Test(dependsOnMethods = { "testCreateInstanceAction" }) + public void testListInstanceClusterNetworkAttachments() throws Exception { try { - ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptions = new ListBareMetalServerNetworkAttachmentsOptions.Builder() - .bareMetalServerId("testString") + ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptions = new ListInstanceClusterNetworkAttachmentsOptions.Builder() + .instanceId("testString") .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptions).execute(); + Response response = service.listInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerNetworkAttachmentCollection bareMetalServerNetworkAttachmentCollectionResult = response.getResult(); - assertNotNull(bareMetalServerNetworkAttachmentCollectionResult); + InstanceClusterNetworkAttachmentCollection instanceClusterNetworkAttachmentCollectionResult = response.getResult(); + assertNotNull(instanceClusterNetworkAttachmentCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7358,27 +7512,27 @@ public void testListBareMetalServerNetworkAttachments() throws Exception { } } - @Test(dependsOnMethods = { "testListBareMetalServerNetworkAttachments" }) - public void testListBareMetalServerNetworkAttachmentsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListInstanceClusterNetworkAttachments" }) + public void testListInstanceClusterNetworkAttachmentsWithPager() throws Exception { try { - ListBareMetalServerNetworkAttachmentsOptions options = new ListBareMetalServerNetworkAttachmentsOptions.Builder() - .bareMetalServerId("testString") + ListInstanceClusterNetworkAttachmentsOptions options = new ListInstanceClusterNetworkAttachmentsOptions.Builder() + .instanceId("testString") .limit(Long.valueOf("10")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - BareMetalServerNetworkAttachmentsPager pager = new BareMetalServerNetworkAttachmentsPager(service, options); + List allResults = new ArrayList<>(); + InstanceClusterNetworkAttachmentsPager pager = new InstanceClusterNetworkAttachmentsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new BareMetalServerNetworkAttachmentsPager(service, options); - List allItems = pager.getAll(); + pager = new InstanceClusterNetworkAttachmentsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -7390,66 +7544,45 @@ public void testListBareMetalServerNetworkAttachmentsWithPager() throws Exceptio } } - @Test(dependsOnMethods = { "testListBareMetalServerNetworkAttachments" }) - public void testCreateBareMetalServerNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testListInstanceClusterNetworkAttachments" }) + public void testCreateClusterNetworkAttachment() throws Exception { try { - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() .address("10.0.0.5") .autoDelete(false) - .name("my-reserved-ip") - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .name("my-cluster-network-subnet-reserved-ip") .build(); - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() + .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") .build(); - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.Builder() - .allowIpSpoofing(true) + InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) + .name("my-cluster-network-interface") + .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) + .subnet(clusterNetworkSubnetIdentityModel) .build(); - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype bareMetalServerNetworkAttachmentPrototypeModel = new BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.Builder() - .name("my-bare-metal-server-network-attachment") - .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .allowedVlans(java.util.Arrays.asList(Long.valueOf(""))) - .interfaceType("pci") + InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById instanceClusterNetworkAttachmentBeforePrototypeModel = new InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById.Builder() + .id("0717-fb880975-db45-4459-8548-64e3995ac213") .build(); - CreateBareMetalServerNetworkAttachmentOptions createBareMetalServerNetworkAttachmentOptions = new CreateBareMetalServerNetworkAttachmentOptions.Builder() - .bareMetalServerId("testString") - .bareMetalServerNetworkAttachmentPrototype(bareMetalServerNetworkAttachmentPrototypeModel) + CreateClusterNetworkAttachmentOptions createClusterNetworkAttachmentOptions = new CreateClusterNetworkAttachmentOptions.Builder() + .instanceId("testString") + .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) + .before(instanceClusterNetworkAttachmentBeforePrototypeModel) + .name("my-instance-network-attachment") .build(); // Invoke operation - Response response = service.createBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptions).execute(); + Response response = service.createClusterNetworkAttachment(createClusterNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - BareMetalServerNetworkAttachment bareMetalServerNetworkAttachmentResult = response.getResult(); - assertNotNull(bareMetalServerNetworkAttachmentResult); + InstanceClusterNetworkAttachment instanceClusterNetworkAttachmentResult = response.getResult(); + assertNotNull(instanceClusterNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7457,22 +7590,22 @@ public void testCreateBareMetalServerNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testCreateBareMetalServerNetworkAttachment" }) - public void testGetBareMetalServerNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testCreateClusterNetworkAttachment" }) + public void testGetInstanceClusterNetworkAttachment() throws Exception { try { - GetBareMetalServerNetworkAttachmentOptions getBareMetalServerNetworkAttachmentOptions = new GetBareMetalServerNetworkAttachmentOptions.Builder() - .bareMetalServerId("testString") + GetInstanceClusterNetworkAttachmentOptions getInstanceClusterNetworkAttachmentOptions = new GetInstanceClusterNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptions).execute(); + Response response = service.getInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerNetworkAttachment bareMetalServerNetworkAttachmentResult = response.getResult(); - assertNotNull(bareMetalServerNetworkAttachmentResult); + InstanceClusterNetworkAttachment instanceClusterNetworkAttachmentResult = response.getResult(); + assertNotNull(instanceClusterNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7480,29 +7613,28 @@ public void testGetBareMetalServerNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testGetBareMetalServerNetworkAttachment" }) - public void testUpdateBareMetalServerNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceClusterNetworkAttachment" }) + public void testUpdateInstanceClusterNetworkAttachment() throws Exception { try { - BareMetalServerNetworkAttachmentPatch bareMetalServerNetworkAttachmentPatchModel = new BareMetalServerNetworkAttachmentPatch.Builder() - .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) - .name("my-bare-metal-server-network-attachment-updated") + InstanceClusterNetworkAttachmentPatch instanceClusterNetworkAttachmentPatchModel = new InstanceClusterNetworkAttachmentPatch.Builder() + .name("my-instance-network-attachment-updated") .build(); - Map bareMetalServerNetworkAttachmentPatchModelAsPatch = bareMetalServerNetworkAttachmentPatchModel.asPatch(); + Map instanceClusterNetworkAttachmentPatchModelAsPatch = instanceClusterNetworkAttachmentPatchModel.asPatch(); - UpdateBareMetalServerNetworkAttachmentOptions updateBareMetalServerNetworkAttachmentOptions = new UpdateBareMetalServerNetworkAttachmentOptions.Builder() - .bareMetalServerId("testString") + UpdateInstanceClusterNetworkAttachmentOptions updateInstanceClusterNetworkAttachmentOptions = new UpdateInstanceClusterNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") - .bareMetalServerNetworkAttachmentPatch(bareMetalServerNetworkAttachmentPatchModelAsPatch) + .instanceClusterNetworkAttachmentPatch(instanceClusterNetworkAttachmentPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptions).execute(); + Response response = service.updateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerNetworkAttachment bareMetalServerNetworkAttachmentResult = response.getResult(); - assertNotNull(bareMetalServerNetworkAttachmentResult); + InstanceClusterNetworkAttachment instanceClusterNetworkAttachmentResult = response.getResult(); + assertNotNull(instanceClusterNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7510,23 +7642,23 @@ public void testUpdateBareMetalServerNetworkAttachment() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateBareMetalServerNetworkAttachment" }) - public void testListBareMetalServerNetworkInterfaces() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceClusterNetworkAttachment" }) + public void testCreateInstanceConsoleAccessToken() throws Exception { try { - ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() - .bareMetalServerId("testString") - .start("testString") - .limit(Long.valueOf("10")) + CreateInstanceConsoleAccessTokenOptions createInstanceConsoleAccessTokenOptions = new CreateInstanceConsoleAccessTokenOptions.Builder() + .instanceId("testString") + .consoleType("serial") + .force(false) .build(); // Invoke operation - Response response = service.listBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptions).execute(); + Response response = service.createInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerNetworkInterfaceCollection bareMetalServerNetworkInterfaceCollectionResult = response.getResult(); - assertNotNull(bareMetalServerNetworkInterfaceCollectionResult); + InstanceConsoleAccessToken instanceConsoleAccessTokenResult = response.getResult(); + assertNotNull(instanceConsoleAccessTokenResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7534,78 +7666,44 @@ public void testListBareMetalServerNetworkInterfaces() throws Exception { } } - @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaces" }) - public void testListBareMetalServerNetworkInterfacesWithPager() throws Exception { + @Test(dependsOnMethods = { "testCreateInstanceConsoleAccessToken" }) + public void testListInstanceDisks() throws Exception { try { - ListBareMetalServerNetworkInterfacesOptions options = new ListBareMetalServerNetworkInterfacesOptions.Builder() - .bareMetalServerId("testString") - .limit(Long.valueOf("10")) + ListInstanceDisksOptions listInstanceDisksOptions = new ListInstanceDisksOptions.Builder() + .instanceId("testString") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + // Invoke operation + Response response = service.listInstanceDisks(listInstanceDisksOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - // Test getAll(); - pager = new BareMetalServerNetworkInterfacesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + InstanceDiskCollection instanceDiskCollectionResult = response.getResult(); + assertNotNull(instanceDiskCollectionResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaces" }) - public void testCreateBareMetalServerNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testListInstanceDisks" }) + public void testGetInstanceDisk() throws Exception { try { - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() - .allowIpSpoofing(true) - .enableInfrastructureNat(true) - .name("my-bare-metal-server-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .interfaceType("hipersocket") - .build(); - - CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptions = new CreateBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") - .bareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototypeModel) + GetInstanceDiskOptions getInstanceDiskOptions = new GetInstanceDiskOptions.Builder() + .instanceId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.createBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptions).execute(); + Response response = service.getInstanceDisk(getInstanceDiskOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); - assertNotNull(bareMetalServerNetworkInterfaceResult); + InstanceDisk instanceDiskResult = response.getResult(); + assertNotNull(instanceDiskResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7613,22 +7711,28 @@ public void testCreateBareMetalServerNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testCreateBareMetalServerNetworkInterface" }) - public void testGetBareMetalServerNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceDisk" }) + public void testUpdateInstanceDisk() throws Exception { try { - GetBareMetalServerNetworkInterfaceOptions getBareMetalServerNetworkInterfaceOptions = new GetBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") - .id("testString") + InstanceDiskPatch instanceDiskPatchModel = new InstanceDiskPatch.Builder() + .name("my-instance-disk-updated") + .build(); + Map instanceDiskPatchModelAsPatch = instanceDiskPatchModel.asPatch(); + + UpdateInstanceDiskOptions updateInstanceDiskOptions = new UpdateInstanceDiskOptions.Builder() + .instanceId("testString") + .id("testString") + .instanceDiskPatch(instanceDiskPatchModelAsPatch) .build(); // Invoke operation - Response response = service.getBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptions).execute(); + Response response = service.updateInstanceDisk(updateInstanceDiskOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); - assertNotNull(bareMetalServerNetworkInterfaceResult); + InstanceDisk instanceDiskResult = response.getResult(); + assertNotNull(instanceDiskResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7636,31 +7740,21 @@ public void testGetBareMetalServerNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testGetBareMetalServerNetworkInterface" }) - public void testUpdateBareMetalServerNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceDisk" }) + public void testListInstanceNetworkAttachments() throws Exception { try { - BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatchModel = new BareMetalServerNetworkInterfacePatch.Builder() - .allowIpSpoofing(true) - .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) - .enableInfrastructureNat(true) - .name("my-bare-metal-server-network-interface") - .build(); - Map bareMetalServerNetworkInterfacePatchModelAsPatch = bareMetalServerNetworkInterfacePatchModel.asPatch(); - - UpdateBareMetalServerNetworkInterfaceOptions updateBareMetalServerNetworkInterfaceOptions = new UpdateBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") - .id("testString") - .bareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatchModelAsPatch) + ListInstanceNetworkAttachmentsOptions listInstanceNetworkAttachmentsOptions = new ListInstanceNetworkAttachmentsOptions.Builder() + .instanceId("testString") .build(); // Invoke operation - Response response = service.updateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptions).execute(); + Response response = service.listInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerNetworkInterface bareMetalServerNetworkInterfaceResult = response.getResult(); - assertNotNull(bareMetalServerNetworkInterfaceResult); + InstanceNetworkAttachmentCollection instanceNetworkAttachmentCollectionResult = response.getResult(); + assertNotNull(instanceNetworkAttachmentCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7668,22 +7762,60 @@ public void testUpdateBareMetalServerNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateBareMetalServerNetworkInterface" }) - public void testListBareMetalServerNetworkInterfaceFloatingIps() throws Exception { + @Test(dependsOnMethods = { "testListInstanceNetworkAttachments" }) + public void testCreateInstanceNetworkAttachment() throws Exception { try { - ListBareMetalServerNetworkInterfaceFloatingIpsOptions listBareMetalServerNetworkInterfaceFloatingIpsOptions = new ListBareMetalServerNetworkInterfaceFloatingIpsOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.7") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + CreateInstanceNetworkAttachmentOptions createInstanceNetworkAttachmentOptions = new CreateInstanceNetworkAttachmentOptions.Builder() + .instanceId("testString") + .virtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .name("testString") .build(); // Invoke operation - Response response = service.listBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptions).execute(); + Response response = service.createInstanceNetworkAttachment(createInstanceNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - FloatingIPUnpaginatedCollection floatingIpUnpaginatedCollectionResult = response.getResult(); - assertNotNull(floatingIpUnpaginatedCollectionResult); + InstanceNetworkAttachment instanceNetworkAttachmentResult = response.getResult(); + assertNotNull(instanceNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7691,23 +7823,22 @@ public void testListBareMetalServerNetworkInterfaceFloatingIps() throws Exceptio } } - @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaceFloatingIps" }) - public void testGetBareMetalServerNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testCreateInstanceNetworkAttachment" }) + public void testGetInstanceNetworkAttachment() throws Exception { try { - GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptions = new GetBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + GetInstanceNetworkAttachmentOptions getInstanceNetworkAttachmentOptions = new GetInstanceNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getBareMetalServerNetworkInterfaceFloatingIp(getBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); + Response response = service.getInstanceNetworkAttachment(getInstanceNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FloatingIP floatingIpResult = response.getResult(); - assertNotNull(floatingIpResult); + InstanceNetworkAttachment instanceNetworkAttachmentResult = response.getResult(); + assertNotNull(instanceNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7715,23 +7846,28 @@ public void testGetBareMetalServerNetworkInterfaceFloatingIp() throws Exception } } - @Test(dependsOnMethods = { "testGetBareMetalServerNetworkInterfaceFloatingIp" }) - public void testAddBareMetalServerNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceNetworkAttachment" }) + public void testUpdateInstanceNetworkAttachment() throws Exception { try { - AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptions = new AddBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + InstanceNetworkAttachmentPatch instanceNetworkAttachmentPatchModel = new InstanceNetworkAttachmentPatch.Builder() + .name("my-instance-network-attachment-updated") + .build(); + Map instanceNetworkAttachmentPatchModelAsPatch = instanceNetworkAttachmentPatchModel.asPatch(); + + UpdateInstanceNetworkAttachmentOptions updateInstanceNetworkAttachmentOptions = new UpdateInstanceNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") + .instanceNetworkAttachmentPatch(instanceNetworkAttachmentPatchModelAsPatch) .build(); // Invoke operation - Response response = service.addBareMetalServerNetworkInterfaceFloatingIp(addBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); + Response response = service.updateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - FloatingIP floatingIpResult = response.getResult(); - assertNotNull(floatingIpResult); + InstanceNetworkAttachment instanceNetworkAttachmentResult = response.getResult(); + assertNotNull(instanceNetworkAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7739,22 +7875,21 @@ public void testAddBareMetalServerNetworkInterfaceFloatingIp() throws Exception } } - @Test(dependsOnMethods = { "testAddBareMetalServerNetworkInterfaceFloatingIp" }) - public void testListBareMetalServerNetworkInterfaceIps() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceNetworkAttachment" }) + public void testListInstanceNetworkInterfaces() throws Exception { try { - ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptions = new ListBareMetalServerNetworkInterfaceIpsOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + ListInstanceNetworkInterfacesOptions listInstanceNetworkInterfacesOptions = new ListInstanceNetworkInterfacesOptions.Builder() + .instanceId("testString") .build(); // Invoke operation - Response response = service.listBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptions).execute(); + Response response = service.listInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ReservedIPCollectionBareMetalServerNetworkInterfaceContext reservedIpCollectionBareMetalServerNetworkInterfaceContextResult = response.getResult(); - assertNotNull(reservedIpCollectionBareMetalServerNetworkInterfaceContextResult); + NetworkInterfaceUnpaginatedCollection networkInterfaceUnpaginatedCollectionResult = response.getResult(); + assertNotNull(networkInterfaceUnpaginatedCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7762,23 +7897,40 @@ public void testListBareMetalServerNetworkInterfaceIps() throws Exception { } } - @Test(dependsOnMethods = { "testListBareMetalServerNetworkInterfaceIps" }) - public void testGetBareMetalServerNetworkInterfaceIp() throws Exception { + @Test(dependsOnMethods = { "testListInstanceNetworkInterfaces" }) + public void testCreateInstanceNetworkInterface() throws Exception { try { - GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptions = new GetBareMetalServerNetworkInterfaceIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") - .id("testString") + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + CreateInstanceNetworkInterfaceOptions createInstanceNetworkInterfaceOptions = new CreateInstanceNetworkInterfaceOptions.Builder() + .instanceId("testString") + .subnet(subnetIdentityModel) + .allowIpSpoofing(true) + .name("my-instance-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke operation - Response response = service.getBareMetalServerNetworkInterfaceIp(getBareMetalServerNetworkInterfaceIpOptions).execute(); + Response response = service.createInstanceNetworkInterface(createInstanceNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - ReservedIP reservedIpResult = response.getResult(); - assertNotNull(reservedIpResult); + NetworkInterface networkInterfaceResult = response.getResult(); + assertNotNull(networkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7786,21 +7938,22 @@ public void testGetBareMetalServerNetworkInterfaceIp() throws Exception { } } - @Test(dependsOnMethods = { "testGetBareMetalServerNetworkInterfaceIp" }) - public void testGetBareMetalServer() throws Exception { + @Test(dependsOnMethods = { "testCreateInstanceNetworkInterface" }) + public void testGetInstanceNetworkInterface() throws Exception { try { - GetBareMetalServerOptions getBareMetalServerOptions = new GetBareMetalServerOptions.Builder() + GetInstanceNetworkInterfaceOptions getInstanceNetworkInterfaceOptions = new GetInstanceNetworkInterfaceOptions.Builder() + .instanceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getBareMetalServer(getBareMetalServerOptions).execute(); + Response response = service.getInstanceNetworkInterface(getInstanceNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServer bareMetalServerResult = response.getResult(); - assertNotNull(bareMetalServerResult); + NetworkInterface networkInterfaceResult = response.getResult(); + assertNotNull(networkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7808,44 +7961,29 @@ public void testGetBareMetalServer() throws Exception { } } - @Test(dependsOnMethods = { "testGetBareMetalServer" }) - public void testUpdateBareMetalServer() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceNetworkInterface" }) + public void testUpdateInstanceNetworkInterface() throws Exception { try { - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .build(); - - BareMetalServerReservationAffinityPatch bareMetalServerReservationAffinityPatchModel = new BareMetalServerReservationAffinityPatch.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) - .build(); - - BareMetalServerTrustedPlatformModulePatch bareMetalServerTrustedPlatformModulePatchModel = new BareMetalServerTrustedPlatformModulePatch.Builder() - .mode("disabled") - .build(); - - BareMetalServerPatch bareMetalServerPatchModel = new BareMetalServerPatch.Builder() - .bandwidth(Long.valueOf("20000")) - .enableSecureBoot(false) - .name("my-bare-metal-server") - .reservationAffinity(bareMetalServerReservationAffinityPatchModel) - .trustedPlatformModule(bareMetalServerTrustedPlatformModulePatchModel) + NetworkInterfacePatch networkInterfacePatchModel = new NetworkInterfacePatch.Builder() + .allowIpSpoofing(true) + .name("my-network-interface-updated") .build(); - Map bareMetalServerPatchModelAsPatch = bareMetalServerPatchModel.asPatch(); + Map networkInterfacePatchModelAsPatch = networkInterfacePatchModel.asPatch(); - UpdateBareMetalServerOptions updateBareMetalServerOptions = new UpdateBareMetalServerOptions.Builder() + UpdateInstanceNetworkInterfaceOptions updateInstanceNetworkInterfaceOptions = new UpdateInstanceNetworkInterfaceOptions.Builder() + .instanceId("testString") .id("testString") - .bareMetalServerPatch(bareMetalServerPatchModelAsPatch) + .networkInterfacePatch(networkInterfacePatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateBareMetalServer(updateBareMetalServerOptions).execute(); + Response response = service.updateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServer bareMetalServerResult = response.getResult(); - assertNotNull(bareMetalServerResult); + NetworkInterface networkInterfaceResult = response.getResult(); + assertNotNull(networkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7853,40 +7991,46 @@ public void testUpdateBareMetalServer() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateBareMetalServer" }) - public void testUpdateFirmwareForBareMetalServer() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceNetworkInterface" }) + public void testListInstanceNetworkInterfaceFloatingIps() throws Exception { try { - UpdateFirmwareForBareMetalServerOptions updateFirmwareForBareMetalServerOptions = new UpdateFirmwareForBareMetalServerOptions.Builder() - .id("testString") - .autoStart(true) + ListInstanceNetworkInterfaceFloatingIpsOptions listInstanceNetworkInterfaceFloatingIpsOptions = new ListInstanceNetworkInterfaceFloatingIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .build(); // Invoke operation - Response response = service.updateFirmwareForBareMetalServer(updateFirmwareForBareMetalServerOptions).execute(); + Response response = service.listInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 200); + + FloatingIPUnpaginatedCollection floatingIpUnpaginatedCollectionResult = response.getResult(); + assertNotNull(floatingIpUnpaginatedCollectionResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateFirmwareForBareMetalServer" }) - public void testGetBareMetalServerInitialization() throws Exception { + @Test(dependsOnMethods = { "testListInstanceNetworkInterfaceFloatingIps" }) + public void testGetInstanceNetworkInterfaceFloatingIp() throws Exception { try { - GetBareMetalServerInitializationOptions getBareMetalServerInitializationOptions = new GetBareMetalServerInitializationOptions.Builder() + GetInstanceNetworkInterfaceFloatingIpOptions getInstanceNetworkInterfaceFloatingIpOptions = new GetInstanceNetworkInterfaceFloatingIpOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getBareMetalServerInitialization(getBareMetalServerInitializationOptions).execute(); + Response response = service.getInstanceNetworkInterfaceFloatingIp(getInstanceNetworkInterfaceFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BareMetalServerInitialization bareMetalServerInitializationResult = response.getResult(); - assertNotNull(bareMetalServerInitializationResult); + FloatingIP floatingIpResult = response.getResult(); + assertNotNull(floatingIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7894,32 +8038,23 @@ public void testGetBareMetalServerInitialization() throws Exception { } } - @Test(dependsOnMethods = { "testGetBareMetalServerInitialization" }) - public void testReplaceBareMetalServerInitialization() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceNetworkInterfaceFloatingIp" }) + public void testAddInstanceNetworkInterfaceFloatingIp() throws Exception { try { - ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .build(); - - KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") - .build(); - - ReplaceBareMetalServerInitializationOptions replaceBareMetalServerInitializationOptions = new ReplaceBareMetalServerInitializationOptions.Builder() + AddInstanceNetworkInterfaceFloatingIpOptions addInstanceNetworkInterfaceFloatingIpOptions = new AddInstanceNetworkInterfaceFloatingIpOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .id("testString") - .image(imageIdentityModel) - .keys(java.util.Arrays.asList(keyIdentityModel)) - .userData("testString") .build(); // Invoke operation - Response response = service.replaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptions).execute(); + Response response = service.addInstanceNetworkInterfaceFloatingIp(addInstanceNetworkInterfaceFloatingIpOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - BareMetalServerInitialization bareMetalServerInitializationResult = response.getResult(); - assertNotNull(bareMetalServerInitializationResult); + FloatingIP floatingIpResult = response.getResult(); + assertNotNull(floatingIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -7927,77 +8062,132 @@ public void testReplaceBareMetalServerInitialization() throws Exception { } } - @Test(dependsOnMethods = { "testReplaceBareMetalServerInitialization" }) - public void testRestartBareMetalServer() throws Exception { + @Test(dependsOnMethods = { "testAddInstanceNetworkInterfaceFloatingIp" }) + public void testListInstanceNetworkInterfaceIps() throws Exception { try { - RestartBareMetalServerOptions restartBareMetalServerOptions = new RestartBareMetalServerOptions.Builder() - .id("testString") + ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.restartBareMetalServer(restartBareMetalServerOptions).execute(); + Response response = service.listInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 200); + + ReservedIPCollectionInstanceNetworkInterfaceContext reservedIpCollectionInstanceNetworkInterfaceContextResult = response.getResult(); + assertNotNull(reservedIpCollectionInstanceNetworkInterfaceContextResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testRestartBareMetalServer" }) - public void testStartBareMetalServer() throws Exception { + @Test(dependsOnMethods = { "testListInstanceNetworkInterfaceIps" }) + public void testListInstanceNetworkInterfaceIpsWithPager() throws Exception { try { - StartBareMetalServerOptions startBareMetalServerOptions = new StartBareMetalServerOptions.Builder() + ListInstanceNetworkInterfaceIpsOptions options = new ListInstanceNetworkInterfaceIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") + .limit(Long.valueOf("10")) + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new InstanceNetworkInterfaceIpsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListInstanceNetworkInterfaceIps" }) + public void testGetInstanceNetworkInterfaceIp() throws Exception { + try { + GetInstanceNetworkInterfaceIpOptions getInstanceNetworkInterfaceIpOptions = new GetInstanceNetworkInterfaceIpOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.startBareMetalServer(startBareMetalServerOptions).execute(); + Response response = service.getInstanceNetworkInterfaceIp(getInstanceNetworkInterfaceIpOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 200); + + ReservedIP reservedIpResult = response.getResult(); + assertNotNull(reservedIpResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testStartBareMetalServer" }) - public void testStopBareMetalServer() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceNetworkInterfaceIp" }) + public void testListInstanceVolumeAttachments() throws Exception { try { - StopBareMetalServerOptions stopBareMetalServerOptions = new StopBareMetalServerOptions.Builder() - .id("testString") - .type("hard") + ListInstanceVolumeAttachmentsOptions listInstanceVolumeAttachmentsOptions = new ListInstanceVolumeAttachmentsOptions.Builder() + .instanceId("testString") .build(); // Invoke operation - Response response = service.stopBareMetalServer(stopBareMetalServerOptions).execute(); + Response response = service.listInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 200); + + VolumeAttachmentCollection volumeAttachmentCollectionResult = response.getResult(); + assertNotNull(volumeAttachmentCollectionResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testStopBareMetalServer" }) - public void testListVolumeProfiles() throws Exception { + @Test(dependsOnMethods = { "testListInstanceVolumeAttachments" }) + public void testCreateInstanceVolumeAttachment() throws Exception { try { - ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() + .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); + + CreateInstanceVolumeAttachmentOptions createInstanceVolumeAttachmentOptions = new CreateInstanceVolumeAttachmentOptions.Builder() + .instanceId("testString") + .volume(volumeAttachmentPrototypeVolumeModel) + .deleteVolumeOnInstanceDelete(false) + .name("my-volume-attachment") .build(); // Invoke operation - Response response = service.listVolumeProfiles(listVolumeProfilesOptions).execute(); + Response response = service.createInstanceVolumeAttachment(createInstanceVolumeAttachmentOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - VolumeProfileCollection volumeProfileCollectionResult = response.getResult(); - assertNotNull(volumeProfileCollectionResult); + VolumeAttachment volumeAttachmentResult = response.getResult(); + assertNotNull(volumeAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8005,52 +8195,52 @@ public void testListVolumeProfiles() throws Exception { } } - @Test(dependsOnMethods = { "testListVolumeProfiles" }) - public void testListVolumeProfilesWithPager() throws Exception { + @Test(dependsOnMethods = { "testCreateInstanceVolumeAttachment" }) + public void testGetInstanceVolumeAttachment() throws Exception { try { - ListVolumeProfilesOptions options = new ListVolumeProfilesOptions.Builder() - .limit(Long.valueOf("10")) + GetInstanceVolumeAttachmentOptions getInstanceVolumeAttachmentOptions = new GetInstanceVolumeAttachmentOptions.Builder() + .instanceId("testString") + .id("testString") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - VolumeProfilesPager pager = new VolumeProfilesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + // Invoke operation + Response response = service.getInstanceVolumeAttachment(getInstanceVolumeAttachmentOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - // Test getAll(); - pager = new VolumeProfilesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + VolumeAttachment volumeAttachmentResult = response.getResult(); + assertNotNull(volumeAttachmentResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListVolumeProfiles" }) - public void testGetVolumeProfile() throws Exception { + @Test(dependsOnMethods = { "testGetInstanceVolumeAttachment" }) + public void testUpdateInstanceVolumeAttachment() throws Exception { try { - GetVolumeProfileOptions getVolumeProfileOptions = new GetVolumeProfileOptions.Builder() - .name("10iops-tier") + VolumeAttachmentPatch volumeAttachmentPatchModel = new VolumeAttachmentPatch.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .build(); + Map volumeAttachmentPatchModelAsPatch = volumeAttachmentPatchModel.asPatch(); + + UpdateInstanceVolumeAttachmentOptions updateInstanceVolumeAttachmentOptions = new UpdateInstanceVolumeAttachmentOptions.Builder() + .instanceId("testString") + .id("testString") + .volumeAttachmentPatch(volumeAttachmentPatchModelAsPatch) .build(); // Invoke operation - Response response = service.getVolumeProfile(getVolumeProfileOptions).execute(); + Response response = service.updateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VolumeProfile volumeProfileResult = response.getResult(); - assertNotNull(volumeProfileResult); + VolumeAttachment volumeAttachmentResult = response.getResult(); + assertNotNull(volumeAttachmentResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8058,29 +8248,23 @@ public void testGetVolumeProfile() throws Exception { } } - @Test(dependsOnMethods = { "testGetVolumeProfile" }) - public void testListVolumes() throws Exception { + @Test(dependsOnMethods = { "testUpdateInstanceVolumeAttachment" }) + public void testListKeys() throws Exception { try { - ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() + ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .attachmentState("attached") - .encryption("provider_managed") - .name("my-name") - .operatingSystemFamily("Ubuntu Server") - .operatingSystemArchitecture("amd64") - .tag("testString") - .zoneName("us-south-1") + .resourceGroupId("testString") .build(); // Invoke operation - Response response = service.listVolumes(listVolumesOptions).execute(); + Response response = service.listKeys(listKeysOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VolumeCollection volumeCollectionResult = response.getResult(); - assertNotNull(volumeCollectionResult); + KeyCollection keyCollectionResult = response.getResult(); + assertNotNull(keyCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8088,33 +8272,27 @@ public void testListVolumes() throws Exception { } } - @Test(dependsOnMethods = { "testListVolumes" }) - public void testListVolumesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListKeys" }) + public void testListKeysWithPager() throws Exception { try { - ListVolumesOptions options = new ListVolumesOptions.Builder() + ListKeysOptions options = new ListKeysOptions.Builder() .limit(Long.valueOf("10")) - .attachmentState("attached") - .encryption("provider_managed") - .name("my-name") - .operatingSystemFamily("Ubuntu Server") - .operatingSystemArchitecture("amd64") - .tag("testString") - .zoneName("us-south-1") + .resourceGroupId("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VolumesPager pager = new VolumesPager(service, options); + List allResults = new ArrayList<>(); + KeysPager pager = new KeysPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VolumesPager(service, options); - List allItems = pager.getAll(); + pager = new KeysPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -8126,49 +8304,28 @@ public void testListVolumesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVolumes" }) - public void testCreateVolume() throws Exception { + @Test(dependsOnMethods = { "testListKeys" }) + public void testCreateKey() throws Exception { try { - VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("custom") - .build(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - VolumePrototypeVolumeByCapacity volumePrototypeModel = new VolumePrototypeVolumeByCapacity.Builder() - .bandwidth(Long.valueOf("1000")) - .iops(Long.valueOf("10000")) - .name("my-volume") - .profile(volumeProfileIdentityModel) + CreateKeyOptions createKeyOptions = new CreateKeyOptions.Builder() + .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En") + .name("my-key-1") .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .zone(zoneIdentityModel) - .capacity(Long.valueOf("100")) - .encryptionKey(encryptionKeyIdentityModel) - .build(); - - CreateVolumeOptions createVolumeOptions = new CreateVolumeOptions.Builder() - .volumePrototype(volumePrototypeModel) + .type("rsa") .build(); // Invoke operation - Response response = service.createVolume(createVolumeOptions).execute(); + Response response = service.createKey(createKeyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - Volume volumeResult = response.getResult(); - assertNotNull(volumeResult); + Key keyResult = response.getResult(); + assertNotNull(keyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8176,21 +8333,21 @@ public void testCreateVolume() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVolume" }) - public void testGetVolume() throws Exception { + @Test(dependsOnMethods = { "testCreateKey" }) + public void testGetKey() throws Exception { try { - GetVolumeOptions getVolumeOptions = new GetVolumeOptions.Builder() + GetKeyOptions getKeyOptions = new GetKeyOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getVolume(getVolumeOptions).execute(); + Response response = service.getKey(getKeyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Volume volumeResult = response.getResult(); - assertNotNull(volumeResult); + Key keyResult = response.getResult(); + assertNotNull(keyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8198,37 +8355,27 @@ public void testGetVolume() throws Exception { } } - @Test(dependsOnMethods = { "testGetVolume" }) - public void testUpdateVolume() throws Exception { + @Test(dependsOnMethods = { "testGetKey" }) + public void testUpdateKey() throws Exception { try { - VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("general-purpose") - .build(); - - VolumePatch volumePatchModel = new VolumePatch.Builder() - .bandwidth(Long.valueOf("1000")) - .capacity(Long.valueOf("100")) - .iops(Long.valueOf("10000")) - .name("my-volume") - .profile(volumeProfileIdentityModel) - .userTags(java.util.Arrays.asList("testString")) + KeyPatch keyPatchModel = new KeyPatch.Builder() + .name("my-key-1") .build(); - Map volumePatchModelAsPatch = volumePatchModel.asPatch(); + Map keyPatchModelAsPatch = keyPatchModel.asPatch(); - UpdateVolumeOptions updateVolumeOptions = new UpdateVolumeOptions.Builder() + UpdateKeyOptions updateKeyOptions = new UpdateKeyOptions.Builder() .id("testString") - .volumePatch(volumePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .keyPatch(keyPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateVolume(updateVolumeOptions).execute(); + Response response = service.updateKey(updateKeyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Volume volumeResult = response.getResult(); - assertNotNull(volumeResult); + Key keyResult = response.getResult(); + assertNotNull(keyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8236,26 +8383,22 @@ public void testUpdateVolume() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVolume" }) - public void testListSnapshotConsistencyGroups() throws Exception { + @Test(dependsOnMethods = { "testUpdateKey" }) + public void testListLoadBalancerProfiles() throws Exception { try { - ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptions = new ListSnapshotConsistencyGroupsOptions.Builder() + ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .backupPolicyPlanId("testString") .build(); // Invoke operation - Response response = service.listSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptions).execute(); + Response response = service.listLoadBalancerProfiles(listLoadBalancerProfilesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SnapshotConsistencyGroupCollection snapshotConsistencyGroupCollectionResult = response.getResult(); - assertNotNull(snapshotConsistencyGroupCollectionResult); + LoadBalancerProfileCollection loadBalancerProfileCollectionResult = response.getResult(); + assertNotNull(loadBalancerProfileCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8263,30 +8406,26 @@ public void testListSnapshotConsistencyGroups() throws Exception { } } - @Test(dependsOnMethods = { "testListSnapshotConsistencyGroups" }) - public void testListSnapshotConsistencyGroupsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListLoadBalancerProfiles" }) + public void testListLoadBalancerProfilesWithPager() throws Exception { try { - ListSnapshotConsistencyGroupsOptions options = new ListSnapshotConsistencyGroupsOptions.Builder() + ListLoadBalancerProfilesOptions options = new ListLoadBalancerProfilesOptions.Builder() .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .backupPolicyPlanId("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - SnapshotConsistencyGroupsPager pager = new SnapshotConsistencyGroupsPager(service, options); + List allResults = new ArrayList<>(); + LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new SnapshotConsistencyGroupsPager(service, options); - List allItems = pager.getAll(); + pager = new LoadBalancerProfilesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -8298,42 +8437,21 @@ public void testListSnapshotConsistencyGroupsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListSnapshotConsistencyGroups" }) - public void testCreateSnapshotConsistencyGroup() throws Exception { + @Test(dependsOnMethods = { "testListLoadBalancerProfiles" }) + public void testGetLoadBalancerProfile() throws Exception { try { - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() - .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .build(); - - SnapshotPrototypeSnapshotConsistencyGroupContext snapshotPrototypeSnapshotConsistencyGroupContextModel = new SnapshotPrototypeSnapshotConsistencyGroupContext.Builder() - .name("my-snapshot") - .sourceVolume(volumeIdentityModel) - .userTags(java.util.Arrays.asList("testString")) - .build(); - - SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots snapshotConsistencyGroupPrototypeModel = new SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots.Builder() - .deleteSnapshotsOnDelete(true) - .name("my-snapshot-consistency-group") - .resourceGroup(resourceGroupIdentityModel) - .snapshots(java.util.Arrays.asList(snapshotPrototypeSnapshotConsistencyGroupContextModel)) - .build(); - - CreateSnapshotConsistencyGroupOptions createSnapshotConsistencyGroupOptions = new CreateSnapshotConsistencyGroupOptions.Builder() - .snapshotConsistencyGroupPrototype(snapshotConsistencyGroupPrototypeModel) + GetLoadBalancerProfileOptions getLoadBalancerProfileOptions = new GetLoadBalancerProfileOptions.Builder() + .name("network-fixed") .build(); // Invoke operation - Response response = service.createSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptions).execute(); + Response response = service.getLoadBalancerProfile(getLoadBalancerProfileOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - SnapshotConsistencyGroup snapshotConsistencyGroupResult = response.getResult(); - assertNotNull(snapshotConsistencyGroupResult); + LoadBalancerProfile loadBalancerProfileResult = response.getResult(); + assertNotNull(loadBalancerProfileResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8341,21 +8459,22 @@ public void testCreateSnapshotConsistencyGroup() throws Exception { } } - @Test(dependsOnMethods = { "testCreateSnapshotConsistencyGroup" }) - public void testGetSnapshotConsistencyGroup() throws Exception { + @Test(dependsOnMethods = { "testGetLoadBalancerProfile" }) + public void testListLoadBalancers() throws Exception { try { - GetSnapshotConsistencyGroupOptions getSnapshotConsistencyGroupOptions = new GetSnapshotConsistencyGroupOptions.Builder() - .id("testString") + ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.getSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptions).execute(); + Response response = service.listLoadBalancers(listLoadBalancersOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SnapshotConsistencyGroup snapshotConsistencyGroupResult = response.getResult(); - assertNotNull(snapshotConsistencyGroupResult); + LoadBalancerCollection loadBalancerCollectionResult = response.getResult(); + assertNotNull(loadBalancerCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8363,169 +8482,164 @@ public void testGetSnapshotConsistencyGroup() throws Exception { } } - @Test(dependsOnMethods = { "testGetSnapshotConsistencyGroup" }) - public void testUpdateSnapshotConsistencyGroup() throws Exception { + @Test(dependsOnMethods = { "testListLoadBalancers" }) + public void testListLoadBalancersWithPager() throws Exception { try { - SnapshotConsistencyGroupPatch snapshotConsistencyGroupPatchModel = new SnapshotConsistencyGroupPatch.Builder() - .deleteSnapshotsOnDelete(false) - .name("my-snapshot-consistency-group") - .build(); - Map snapshotConsistencyGroupPatchModelAsPatch = snapshotConsistencyGroupPatchModel.asPatch(); - - UpdateSnapshotConsistencyGroupOptions updateSnapshotConsistencyGroupOptions = new UpdateSnapshotConsistencyGroupOptions.Builder() - .id("testString") - .snapshotConsistencyGroupPatch(snapshotConsistencyGroupPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + ListLoadBalancersOptions options = new ListLoadBalancersOptions.Builder() + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.updateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + LoadBalancersPager pager = new LoadBalancersPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - SnapshotConsistencyGroup snapshotConsistencyGroupResult = response.getResult(); - assertNotNull(snapshotConsistencyGroupResult); + // Test getAll(); + pager = new LoadBalancersPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateSnapshotConsistencyGroup" }) - public void testListSnapshots() throws Exception { + @Test(dependsOnMethods = { "testListLoadBalancers" }) + public void testCreateLoadBalancer() throws Exception { try { - ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .tag("testString") - .resourceGroupId("testString") - .name("my-name") - .sourceVolumeId("testString") - .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .sourceImageId("testString") - .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .sort("name") - .backupPolicyPlanId("testString") - .copiesId("testString") - .copiesName("my-snapshot-copy") - .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") - .copiesRemoteRegionName("us-south") - .sourceSnapshotId("testString") - .sourceSnapshotRemoteRegionName("us-south") - .sourceVolumeRemoteRegionName("us-east") - .sourceImageRemoteRegionName("us-south") - .clonesZoneName("us-south-1") - .snapshotConsistencyGroupId("testString") - .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - // Invoke operation - Response response = service.listSnapshots(listSnapshotsOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + DNSInstanceIdentityByCRN dnsInstanceIdentityModel = new DNSInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::") + .build(); - SnapshotCollection snapshotCollectionResult = response.getResult(); - assertNotNull(snapshotCollectionResult); + DNSZoneIdentityById dnsZoneIdentityModel = new DNSZoneIdentityById.Builder() + .id("d66662cc-aa23-4fe1-9987-858487a61f45") + .build(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + LoadBalancerDNSPrototype loadBalancerDnsPrototypeModel = new LoadBalancerDNSPrototype.Builder() + .instance(dnsInstanceIdentityModel) + .zone(dnsZoneIdentityModel) + .build(); - @Test(dependsOnMethods = { "testListSnapshots" }) - public void testListSnapshotsWithPager() throws Exception { - try { - ListSnapshotsOptions options = new ListSnapshotsOptions.Builder() - .limit(Long.valueOf("10")) - .tag("testString") - .resourceGroupId("testString") - .name("my-name") - .sourceVolumeId("testString") - .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .sourceImageId("testString") - .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .sort("name") - .backupPolicyPlanId("testString") - .copiesId("testString") - .copiesName("my-snapshot-copy") - .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") - .copiesRemoteRegionName("us-south") - .sourceSnapshotId("testString") - .sourceSnapshotRemoteRegionName("us-south") - .sourceVolumeRemoteRegionName("us-east") - .sourceImageRemoteRegionName("us-south") - .clonesZoneName("us-south-1") - .snapshotConsistencyGroupId("testString") - .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - SnapshotsPager pager = new SnapshotsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByNameModel = new LoadBalancerPoolIdentityByName.Builder() + .name("my-load-balancer-pool") + .build(); - // Test getAll(); - pager = new SnapshotsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") + .build(); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); - @Test(dependsOnMethods = { "testListSnapshots" }) - public void testCreateSnapshot() throws Exception { - try { - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModel = new LoadBalancerListenerPrototypeLoadBalancerContext.Builder() + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerPoolIdentityByNameModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) + .idleConnectionTimeout(Long.valueOf("100")) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .protocol("http") .build(); - SnapshotClonePrototype snapshotClonePrototypeModel = new SnapshotClonePrototype.Builder() - .zone(zoneIdentityModel) + LoadBalancerLoggingDatapathPrototype loadBalancerLoggingDatapathPrototypeModel = new LoadBalancerLoggingDatapathPrototype.Builder() + .active(true) + .build(); + + LoadBalancerLoggingPrototype loadBalancerLoggingPrototypeModel = new LoadBalancerLoggingPrototype.Builder() + .datapath(loadBalancerLoggingDatapathPrototypeModel) + .build(); + + LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype.Builder() + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("tcp") + .build(); + + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") + .build(); + + LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); + + LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() + .cookieName("my-cookie-name") + .type("app_cookie") + .build(); + + LoadBalancerPoolPrototypeLoadBalancerContext loadBalancerPoolPrototypeLoadBalancerContextModel = new LoadBalancerPoolPrototypeLoadBalancerContext.Builder() + .algorithm("least_connections") + .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + .name("my-load-balancer-pool") + .protocol("http") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + .build(); + + LoadBalancerProfileIdentityByName loadBalancerProfileIdentityModel = new LoadBalancerProfileIdentityByName.Builder() + .name("network-fixed") .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() - .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") .build(); - SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() - .clones(java.util.Arrays.asList(snapshotClonePrototypeModel)) - .name("my-snapshot") + CreateLoadBalancerOptions createLoadBalancerOptions = new CreateLoadBalancerOptions.Builder() + .isPublic(true) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .dns(loadBalancerDnsPrototypeModel) + .isPrivatePath(true) + .listeners(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel)) + .logging(loadBalancerLoggingPrototypeModel) + .name("my-load-balancer") + .pools(java.util.Arrays.asList(loadBalancerPoolPrototypeLoadBalancerContextModel)) + .profile(loadBalancerProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .sourceVolume(volumeIdentityModel) - .build(); - - CreateSnapshotOptions createSnapshotOptions = new CreateSnapshotOptions.Builder() - .snapshotPrototype(snapshotPrototypeModel) + .routeMode(true) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke operation - Response response = service.createSnapshot(createSnapshotOptions).execute(); + Response response = service.createLoadBalancer(createLoadBalancerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - Snapshot snapshotResult = response.getResult(); - assertNotNull(snapshotResult); + LoadBalancer loadBalancerResult = response.getResult(); + assertNotNull(loadBalancerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8533,21 +8647,21 @@ public void testCreateSnapshot() throws Exception { } } - @Test(dependsOnMethods = { "testCreateSnapshot" }) - public void testGetSnapshot() throws Exception { + @Test(dependsOnMethods = { "testCreateLoadBalancer" }) + public void testGetLoadBalancer() throws Exception { try { - GetSnapshotOptions getSnapshotOptions = new GetSnapshotOptions.Builder() + GetLoadBalancerOptions getLoadBalancerOptions = new GetLoadBalancerOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getSnapshot(getSnapshotOptions).execute(); + Response response = service.getLoadBalancer(getLoadBalancerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Snapshot snapshotResult = response.getResult(); - assertNotNull(snapshotResult); + LoadBalancer loadBalancerResult = response.getResult(); + assertNotNull(loadBalancerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8555,51 +8669,56 @@ public void testGetSnapshot() throws Exception { } } - @Test(dependsOnMethods = { "testGetSnapshot" }) - public void testUpdateSnapshot() throws Exception { + @Test(dependsOnMethods = { "testGetLoadBalancer" }) + public void testUpdateLoadBalancer() throws Exception { try { - SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() - .name("my-snapshot-updated") - .userTags(java.util.Arrays.asList("testString")) + DNSInstanceIdentityByCRN dnsInstanceIdentityModel = new DNSInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::") .build(); - Map snapshotPatchModelAsPatch = snapshotPatchModel.asPatch(); - UpdateSnapshotOptions updateSnapshotOptions = new UpdateSnapshotOptions.Builder() - .id("testString") - .snapshotPatch(snapshotPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + DNSZoneIdentityById dnsZoneIdentityModel = new DNSZoneIdentityById.Builder() + .id("d66662cc-aa23-4fe1-9987-858487a61f45") .build(); - // Invoke operation - Response response = service.updateSnapshot(updateSnapshotOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + LoadBalancerDNSPatch loadBalancerDnsPatchModel = new LoadBalancerDNSPatch.Builder() + .instance(dnsInstanceIdentityModel) + .zone(dnsZoneIdentityModel) + .build(); - Snapshot snapshotResult = response.getResult(); - assertNotNull(snapshotResult); + LoadBalancerLoggingDatapathPatch loadBalancerLoggingDatapathPatchModel = new LoadBalancerLoggingDatapathPatch.Builder() + .active(true) + .build(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + LoadBalancerLoggingPatch loadBalancerLoggingPatchModel = new LoadBalancerLoggingPatch.Builder() + .datapath(loadBalancerLoggingDatapathPatchModel) + .build(); - @Test(dependsOnMethods = { "testUpdateSnapshot" }) - public void testListSnapshotClones() throws Exception { - try { - ListSnapshotClonesOptions listSnapshotClonesOptions = new ListSnapshotClonesOptions.Builder() + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + LoadBalancerPatch loadBalancerPatchModel = new LoadBalancerPatch.Builder() + .dns(loadBalancerDnsPatchModel) + .logging(loadBalancerLoggingPatchModel) + .name("my-load-balancer") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .build(); + Map loadBalancerPatchModelAsPatch = loadBalancerPatchModel.asPatch(); + + UpdateLoadBalancerOptions updateLoadBalancerOptions = new UpdateLoadBalancerOptions.Builder() .id("testString") + .loadBalancerPatch(loadBalancerPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.listSnapshotClones(listSnapshotClonesOptions).execute(); + Response response = service.updateLoadBalancer(updateLoadBalancerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SnapshotCloneCollection snapshotCloneCollectionResult = response.getResult(); - assertNotNull(snapshotCloneCollectionResult); + LoadBalancer loadBalancerResult = response.getResult(); + assertNotNull(loadBalancerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8607,22 +8726,21 @@ public void testListSnapshotClones() throws Exception { } } - @Test(dependsOnMethods = { "testListSnapshotClones" }) - public void testGetSnapshotClone() throws Exception { + @Test(dependsOnMethods = { "testUpdateLoadBalancer" }) + public void testGetLoadBalancerStatistics() throws Exception { try { - GetSnapshotCloneOptions getSnapshotCloneOptions = new GetSnapshotCloneOptions.Builder() + GetLoadBalancerStatisticsOptions getLoadBalancerStatisticsOptions = new GetLoadBalancerStatisticsOptions.Builder() .id("testString") - .zoneName("us-south-1") .build(); // Invoke operation - Response response = service.getSnapshotClone(getSnapshotCloneOptions).execute(); + Response response = service.getLoadBalancerStatistics(getLoadBalancerStatisticsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SnapshotClone snapshotCloneResult = response.getResult(); - assertNotNull(snapshotCloneResult); + LoadBalancerStatistics loadBalancerStatisticsResult = response.getResult(); + assertNotNull(loadBalancerStatisticsResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8630,22 +8748,21 @@ public void testGetSnapshotClone() throws Exception { } } - @Test(dependsOnMethods = { "testGetSnapshotClone" }) - public void testCreateSnapshotClone() throws Exception { + @Test(dependsOnMethods = { "testGetLoadBalancerStatistics" }) + public void testListLoadBalancerListeners() throws Exception { try { - CreateSnapshotCloneOptions createSnapshotCloneOptions = new CreateSnapshotCloneOptions.Builder() - .id("testString") - .zoneName("us-south-1") + ListLoadBalancerListenersOptions listLoadBalancerListenersOptions = new ListLoadBalancerListenersOptions.Builder() + .loadBalancerId("testString") .build(); // Invoke operation - Response response = service.createSnapshotClone(createSnapshotCloneOptions).execute(); + Response response = service.listLoadBalancerListeners(listLoadBalancerListenersOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SnapshotClone snapshotCloneResult = response.getResult(); - assertNotNull(snapshotCloneResult); + LoadBalancerListenerCollection loadBalancerListenerCollectionResult = response.getResult(); + assertNotNull(loadBalancerListenerCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8653,23 +8770,465 @@ public void testCreateSnapshotClone() throws Exception { } } - @Test(dependsOnMethods = { "testCreateSnapshotClone" }) - public void testListShareProfiles() throws Exception { + @Test(dependsOnMethods = { "testListLoadBalancerListeners" }) + public void testCreateLoadBalancerListener() throws Exception { try { - ListShareProfilesOptions listShareProfilesOptions = new ListShareProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .sort("name") + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") .build(); - // Invoke operation - Response response = service.listShareProfiles(listShareProfilesOptions).execute(); + LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") + .build(); + + LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); + + LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("testString") + .build(); + + LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + LoadBalancerListenerPolicyPrototype loadBalancerListenerPolicyPrototypeModel = new LoadBalancerListenerPolicyPrototype.Builder() + .action("forward_to_listener") + .name("my-load-balancer-listener-policy") + .priority(Long.valueOf("5")) + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) + .target(loadBalancerListenerPolicyTargetPrototypeModel) + .build(); + + CreateLoadBalancerListenerOptions createLoadBalancerListenerOptions = new CreateLoadBalancerListenerOptions.Builder() + .loadBalancerId("testString") + .protocol("http") + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerPoolIdentityModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) + .idleConnectionTimeout(Long.valueOf("100")) + .policies(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel)) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .build(); + + // Invoke operation + Response response = service.createLoadBalancerListener(createLoadBalancerListenerOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + LoadBalancerListener loadBalancerListenerResult = response.getResult(); + assertNotNull(loadBalancerListenerResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateLoadBalancerListener" }) + public void testGetLoadBalancerListener() throws Exception { + try { + GetLoadBalancerListenerOptions getLoadBalancerListenerOptions = new GetLoadBalancerListenerOptions.Builder() + .loadBalancerId("testString") + .id("testString") + .build(); + + // Invoke operation + Response response = service.getLoadBalancerListener(getLoadBalancerListenerOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + LoadBalancerListener loadBalancerListenerResult = response.getResult(); + assertNotNull(loadBalancerListenerResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetLoadBalancerListener" }) + public void testUpdateLoadBalancerListener() throws Exception { + try { + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); + + LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById loadBalancerListenerDefaultPoolPatchModel = new LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") + .build(); + + LoadBalancerListenerHTTPSRedirectPatch loadBalancerListenerHttpsRedirectPatchModel = new LoadBalancerListenerHTTPSRedirectPatch.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); + + LoadBalancerListenerPatch loadBalancerListenerPatchModel = new LoadBalancerListenerPatch.Builder() + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerListenerDefaultPoolPatchModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPatchModel) + .idleConnectionTimeout(Long.valueOf("100")) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .protocol("http") + .build(); + Map loadBalancerListenerPatchModelAsPatch = loadBalancerListenerPatchModel.asPatch(); + + UpdateLoadBalancerListenerOptions updateLoadBalancerListenerOptions = new UpdateLoadBalancerListenerOptions.Builder() + .loadBalancerId("testString") + .id("testString") + .loadBalancerListenerPatch(loadBalancerListenerPatchModelAsPatch) + .build(); + + // Invoke operation + Response response = service.updateLoadBalancerListener(updateLoadBalancerListenerOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + LoadBalancerListener loadBalancerListenerResult = response.getResult(); + assertNotNull(loadBalancerListenerResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testUpdateLoadBalancerListener" }) + public void testListLoadBalancerListenerPolicies() throws Exception { + try { + ListLoadBalancerListenerPoliciesOptions listLoadBalancerListenerPoliciesOptions = new ListLoadBalancerListenerPoliciesOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .build(); + + // Invoke operation + Response response = service.listLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + LoadBalancerListenerPolicyCollection loadBalancerListenerPolicyCollectionResult = response.getResult(); + assertNotNull(loadBalancerListenerPolicyCollectionResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListLoadBalancerListenerPolicies" }) + public void testCreateLoadBalancerListenerPolicy() throws Exception { + try { + LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("testString") + .build(); + + LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + CreateLoadBalancerListenerPolicyOptions createLoadBalancerListenerPolicyOptions = new CreateLoadBalancerListenerPolicyOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .action("forward_to_listener") + .priority(Long.valueOf("5")) + .name("my-load-balancer-listener-policy") + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) + .target(loadBalancerListenerPolicyTargetPrototypeModel) + .build(); + + // Invoke operation + Response response = service.createLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); + assertNotNull(loadBalancerListenerPolicyResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateLoadBalancerListenerPolicy" }) + public void testGetLoadBalancerListenerPolicy() throws Exception { + try { + GetLoadBalancerListenerPolicyOptions getLoadBalancerListenerPolicyOptions = new GetLoadBalancerListenerPolicyOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .id("testString") + .build(); + + // Invoke operation + Response response = service.getLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); + assertNotNull(loadBalancerListenerPolicyResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetLoadBalancerListenerPolicy" }) + public void testUpdateLoadBalancerListenerPolicy() throws Exception { + try { + LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPatchModel = new LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + LoadBalancerListenerPolicyPatch loadBalancerListenerPolicyPatchModel = new LoadBalancerListenerPolicyPatch.Builder() + .name("my-load-balancer-listener-policy-updated") + .priority(Long.valueOf("5")) + .target(loadBalancerListenerPolicyTargetPatchModel) + .build(); + Map loadBalancerListenerPolicyPatchModelAsPatch = loadBalancerListenerPolicyPatchModel.asPatch(); + + UpdateLoadBalancerListenerPolicyOptions updateLoadBalancerListenerPolicyOptions = new UpdateLoadBalancerListenerPolicyOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .id("testString") + .loadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatchModelAsPatch) + .build(); + + // Invoke operation + Response response = service.updateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); + assertNotNull(loadBalancerListenerPolicyResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testUpdateLoadBalancerListenerPolicy" }) + public void testListLoadBalancerListenerPolicyRules() throws Exception { + try { + ListLoadBalancerListenerPolicyRulesOptions listLoadBalancerListenerPolicyRulesOptions = new ListLoadBalancerListenerPolicyRulesOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .build(); + + // Invoke operation + Response response = service.listLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + LoadBalancerListenerPolicyRuleCollection loadBalancerListenerPolicyRuleCollectionResult = response.getResult(); + assertNotNull(loadBalancerListenerPolicyRuleCollectionResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListLoadBalancerListenerPolicyRules" }) + public void testCreateLoadBalancerListenerPolicyRule() throws Exception { + try { + CreateLoadBalancerListenerPolicyRuleOptions createLoadBalancerListenerPolicyRuleOptions = new CreateLoadBalancerListenerPolicyRuleOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .condition("contains") + .type("body") + .value("testString") + .field("MY-APP-HEADER") + .build(); + + // Invoke operation + Response response = service.createLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); + assertNotNull(loadBalancerListenerPolicyRuleResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateLoadBalancerListenerPolicyRule" }) + public void testGetLoadBalancerListenerPolicyRule() throws Exception { + try { + GetLoadBalancerListenerPolicyRuleOptions getLoadBalancerListenerPolicyRuleOptions = new GetLoadBalancerListenerPolicyRuleOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .id("testString") + .build(); + + // Invoke operation + Response response = service.getLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareProfileCollection shareProfileCollectionResult = response.getResult(); - assertNotNull(shareProfileCollectionResult); + LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); + assertNotNull(loadBalancerListenerPolicyRuleResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetLoadBalancerListenerPolicyRule" }) + public void testUpdateLoadBalancerListenerPolicyRule() throws Exception { + try { + LoadBalancerListenerPolicyRulePatch loadBalancerListenerPolicyRulePatchModel = new LoadBalancerListenerPolicyRulePatch.Builder() + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("my-example-hostname-updated") + .build(); + Map loadBalancerListenerPolicyRulePatchModelAsPatch = loadBalancerListenerPolicyRulePatchModel.asPatch(); + + UpdateLoadBalancerListenerPolicyRuleOptions updateLoadBalancerListenerPolicyRuleOptions = new UpdateLoadBalancerListenerPolicyRuleOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .id("testString") + .loadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatchModelAsPatch) + .build(); + + // Invoke operation + Response response = service.updateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); + assertNotNull(loadBalancerListenerPolicyRuleResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testUpdateLoadBalancerListenerPolicyRule" }) + public void testListLoadBalancerPools() throws Exception { + try { + ListLoadBalancerPoolsOptions listLoadBalancerPoolsOptions = new ListLoadBalancerPoolsOptions.Builder() + .loadBalancerId("testString") + .build(); + + // Invoke operation + Response response = service.listLoadBalancerPools(listLoadBalancerPoolsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + LoadBalancerPoolCollection loadBalancerPoolCollectionResult = response.getResult(); + assertNotNull(loadBalancerPoolCollectionResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListLoadBalancerPools" }) + public void testCreateLoadBalancerPool() throws Exception { + try { + LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype.Builder() + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("tcp") + .build(); + + LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + LoadBalancerPoolFailsafePolicyPrototype loadBalancerPoolFailsafePolicyPrototypeModel = new LoadBalancerPoolFailsafePolicyPrototype.Builder() + .action("forward") + .target(loadBalancerPoolIdentityModel) + .build(); + + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") + .build(); + + LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); + + LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() + .cookieName("my-cookie-name") + .type("app_cookie") + .build(); + + CreateLoadBalancerPoolOptions createLoadBalancerPoolOptions = new CreateLoadBalancerPoolOptions.Builder() + .loadBalancerId("testString") + .algorithm("least_connections") + .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) + .protocol("http") + .failsafePolicy(loadBalancerPoolFailsafePolicyPrototypeModel) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + .name("my-load-balancer-pool") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + .build(); + + // Invoke operation + Response response = service.createLoadBalancerPool(createLoadBalancerPoolOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + LoadBalancerPool loadBalancerPoolResult = response.getResult(); + assertNotNull(loadBalancerPoolResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8677,53 +9236,80 @@ public void testListShareProfiles() throws Exception { } } - @Test(dependsOnMethods = { "testListShareProfiles" }) - public void testListShareProfilesWithPager() throws Exception { + @Test(dependsOnMethods = { "testCreateLoadBalancerPool" }) + public void testGetLoadBalancerPool() throws Exception { try { - ListShareProfilesOptions options = new ListShareProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .sort("name") + GetLoadBalancerPoolOptions getLoadBalancerPoolOptions = new GetLoadBalancerPoolOptions.Builder() + .loadBalancerId("testString") + .id("testString") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - ShareProfilesPager pager = new ShareProfilesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + // Invoke operation + Response response = service.getLoadBalancerPool(getLoadBalancerPoolOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - // Test getAll(); - pager = new ShareProfilesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + LoadBalancerPool loadBalancerPoolResult = response.getResult(); + assertNotNull(loadBalancerPoolResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListShareProfiles" }) - public void testGetShareProfile() throws Exception { + @Test(dependsOnMethods = { "testGetLoadBalancerPool" }) + public void testUpdateLoadBalancerPool() throws Exception { try { - GetShareProfileOptions getShareProfileOptions = new GetShareProfileOptions.Builder() - .name("dp2") + LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById loadBalancerPoolFailsafePolicyTargetPatchModel = new LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + LoadBalancerPoolFailsafePolicyPatch loadBalancerPoolFailsafePolicyPatchModel = new LoadBalancerPoolFailsafePolicyPatch.Builder() + .action("forward") + .target(loadBalancerPoolFailsafePolicyTargetPatchModel) + .build(); + + LoadBalancerPoolHealthMonitorPatch loadBalancerPoolHealthMonitorPatchModel = new LoadBalancerPoolHealthMonitorPatch.Builder() + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("http") + .urlPath("/") + .build(); + + LoadBalancerPoolSessionPersistencePatch loadBalancerPoolSessionPersistencePatchModel = new LoadBalancerPoolSessionPersistencePatch.Builder() + .cookieName("my-cookie-name") + .type("app_cookie") + .build(); + + LoadBalancerPoolPatch loadBalancerPoolPatchModel = new LoadBalancerPoolPatch.Builder() + .algorithm("weighted_round_robin") + .failsafePolicy(loadBalancerPoolFailsafePolicyPatchModel) + .healthMonitor(loadBalancerPoolHealthMonitorPatchModel) + .name("my-load-balancer-pool") + .protocol("http") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePatchModel) + .build(); + Map loadBalancerPoolPatchModelAsPatch = loadBalancerPoolPatchModel.asPatch(); + + UpdateLoadBalancerPoolOptions updateLoadBalancerPoolOptions = new UpdateLoadBalancerPoolOptions.Builder() + .loadBalancerId("testString") + .id("testString") + .loadBalancerPoolPatch(loadBalancerPoolPatchModelAsPatch) .build(); // Invoke operation - Response response = service.getShareProfile(getShareProfileOptions).execute(); + Response response = service.updateLoadBalancerPool(updateLoadBalancerPoolOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareProfile shareProfileResult = response.getResult(); - assertNotNull(shareProfileResult); + LoadBalancerPool loadBalancerPoolResult = response.getResult(); + assertNotNull(loadBalancerPoolResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8731,26 +9317,22 @@ public void testGetShareProfile() throws Exception { } } - @Test(dependsOnMethods = { "testGetShareProfile" }) - public void testListShares() throws Exception { + @Test(dependsOnMethods = { "testUpdateLoadBalancerPool" }) + public void testListLoadBalancerPoolMembers() throws Exception { try { - ListSharesOptions listSharesOptions = new ListSharesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .replicationRole("none") + ListLoadBalancerPoolMembersOptions listLoadBalancerPoolMembersOptions = new ListLoadBalancerPoolMembersOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") .build(); // Invoke operation - Response response = service.listShares(listSharesOptions).execute(); + Response response = service.listLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareCollection shareCollectionResult = response.getResult(); - assertNotNull(shareCollectionResult); + LoadBalancerPoolMemberCollection loadBalancerPoolMemberCollectionResult = response.getResult(); + assertNotNull(loadBalancerPoolMemberCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8758,144 +9340,63 @@ public void testListShares() throws Exception { } } - @Test(dependsOnMethods = { "testListShares" }) - public void testListSharesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListLoadBalancerPoolMembers" }) + public void testCreateLoadBalancerPoolMember() throws Exception { try { - ListSharesOptions options = new ListSharesOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .replicationRole("none") + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - SharesPager pager = new SharesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + CreateLoadBalancerPoolMemberOptions createLoadBalancerPoolMemberOptions = new CreateLoadBalancerPoolMemberOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); - // Test getAll(); - pager = new SharesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + // Invoke operation + Response response = service.createLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); + assertNotNull(loadBalancerPoolMemberResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListShares" }) - public void testCreateShare() throws Exception { + @Test(dependsOnMethods = { "testCreateLoadBalancerPoolMember" }) + public void testReplaceLoadBalancerPoolMembers() throws Exception { try { - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext shareMountTargetVirtualNetworkInterfacePrototypeModel = new ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); - - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() - .name("my-share-mount-target") - .transitEncryption("none") - .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) - .build(); - - ShareProfileIdentityByName shareProfileIdentityModel = new ShareProfileIdentityByName.Builder() - .name("tier-3iops") - .build(); - - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) - .iops(Long.valueOf("100")) - .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) - .name("my-share") - .profile(shareProfileIdentityModel) - .replicationCronSpec("0 */5 * * *") - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .zone(zoneIdentityModel) - .build(); - - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - ShareInitialOwner shareInitialOwnerModel = new ShareInitialOwner.Builder() - .gid(Long.valueOf("50")) - .uid(Long.valueOf("50")) + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") .build(); - SharePrototypeShareBySize sharePrototypeModel = new SharePrototypeShareBySize.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) - .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) - .name("my-share") - .replicaShare(sharePrototypeShareContextModel) - .userTags(java.util.Arrays.asList()) - .accessControlMode("security_group") - .encryptionKey(encryptionKeyIdentityModel) - .initialOwner(shareInitialOwnerModel) - .iops(Long.valueOf("100")) - .profile(shareProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .size(Long.valueOf("200")) - .zone(zoneIdentityModel) + LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) .build(); - CreateShareOptions createShareOptions = new CreateShareOptions.Builder() - .sharePrototype(sharePrototypeModel) + ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptions = new ReplaceLoadBalancerPoolMembersOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) .build(); // Invoke operation - Response response = service.createShare(createShareOptions).execute(); + Response response = service.replaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - Share shareResult = response.getResult(); - assertNotNull(shareResult); + LoadBalancerPoolMemberCollection loadBalancerPoolMemberCollectionResult = response.getResult(); + assertNotNull(loadBalancerPoolMemberCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8903,21 +9404,23 @@ public void testCreateShare() throws Exception { } } - @Test(dependsOnMethods = { "testCreateShare" }) - public void testGetShare() throws Exception { + @Test(dependsOnMethods = { "testReplaceLoadBalancerPoolMembers" }) + public void testGetLoadBalancerPoolMember() throws Exception { try { - GetShareOptions getShareOptions = new GetShareOptions.Builder() + GetLoadBalancerPoolMemberOptions getLoadBalancerPoolMemberOptions = new GetLoadBalancerPoolMemberOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getShare(getShareOptions).execute(); + Response response = service.getLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Share shareResult = response.getResult(); - assertNotNull(shareResult); + LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); + assertNotNull(loadBalancerPoolMemberResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8925,39 +9428,35 @@ public void testGetShare() throws Exception { } } - @Test(dependsOnMethods = { "testGetShare" }) - public void testUpdateShare() throws Exception { + @Test(dependsOnMethods = { "testGetLoadBalancerPoolMember" }) + public void testUpdateLoadBalancerPoolMember() throws Exception { try { - ShareProfileIdentityByName shareProfileIdentityModel = new ShareProfileIdentityByName.Builder() - .name("tier-3iops") + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") .build(); - SharePatch sharePatchModel = new SharePatch.Builder() - .accessControlMode("security_group") - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) - .iops(Long.valueOf("100")) - .name("my-share") - .profile(shareProfileIdentityModel) - .replicationCronSpec("0 */5 * * *") - .size(Long.valueOf("8000")) - .userTags(java.util.Arrays.asList("testString")) + LoadBalancerPoolMemberPatch loadBalancerPoolMemberPatchModel = new LoadBalancerPoolMemberPatch.Builder() + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("99")) .build(); - Map sharePatchModelAsPatch = sharePatchModel.asPatch(); + Map loadBalancerPoolMemberPatchModelAsPatch = loadBalancerPoolMemberPatchModel.asPatch(); - UpdateShareOptions updateShareOptions = new UpdateShareOptions.Builder() + UpdateLoadBalancerPoolMemberOptions updateLoadBalancerPoolMemberOptions = new UpdateLoadBalancerPoolMemberOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") .id("testString") - .sharePatch(sharePatchModelAsPatch) - .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") + .loadBalancerPoolMemberPatch(loadBalancerPoolMemberPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateShare(updateShareOptions).execute(); + Response response = service.updateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Share shareResult = response.getResult(); - assertNotNull(shareResult); + LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); + assertNotNull(loadBalancerPoolMemberResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8965,23 +9464,23 @@ public void testUpdateShare() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateShare" }) - public void testListShareAccessorBindings() throws Exception { + @Test(dependsOnMethods = { "testUpdateLoadBalancerPoolMember" }) + public void testListNetworkAcls() throws Exception { try { - ListShareAccessorBindingsOptions listShareAccessorBindingsOptions = new ListShareAccessorBindingsOptions.Builder() - .id("testString") + ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); // Invoke operation - Response response = service.listShareAccessorBindings(listShareAccessorBindingsOptions).execute(); + Response response = service.listNetworkAcls(listNetworkAclsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareAccessorBindingCollection shareAccessorBindingCollectionResult = response.getResult(); - assertNotNull(shareAccessorBindingCollectionResult); + NetworkACLCollection networkAclCollectionResult = response.getResult(); + assertNotNull(networkAclCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -8989,27 +9488,27 @@ public void testListShareAccessorBindings() throws Exception { } } - @Test(dependsOnMethods = { "testListShareAccessorBindings" }) - public void testListShareAccessorBindingsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListNetworkAcls" }) + public void testListNetworkAclsWithPager() throws Exception { try { - ListShareAccessorBindingsOptions options = new ListShareAccessorBindingsOptions.Builder() - .id("testString") + ListNetworkAclsOptions options = new ListNetworkAclsOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - ShareAccessorBindingsPager pager = new ShareAccessorBindingsPager(service, options); + List allResults = new ArrayList<>(); + NetworkAclsPager pager = new NetworkAclsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new ShareAccessorBindingsPager(service, options); - List allItems = pager.getAll(); + pager = new NetworkAclsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -9021,22 +9520,68 @@ public void testListShareAccessorBindingsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListShareAccessorBindings" }) - public void testGetShareAccessorBinding() throws Exception { + @Test(dependsOnMethods = { "testListNetworkAcls" }) + public void testCreateNetworkAcl() throws Exception { try { - GetShareAccessorBindingOptions getShareAccessorBindingOptions = new GetShareAccessorBindingOptions.Builder() - .shareId("testString") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Builder() + .action("allow") + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("any") + .build(); + + NetworkACLPrototypeNetworkACLByRules networkAclPrototypeModel = new NetworkACLPrototypeNetworkACLByRules.Builder() + .name("my-network-acl") + .resourceGroup(resourceGroupIdentityModel) + .vpc(vpcIdentityModel) + .rules(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)) + .build(); + + CreateNetworkAclOptions createNetworkAclOptions = new CreateNetworkAclOptions.Builder() + .networkAclPrototype(networkAclPrototypeModel) + .build(); + + // Invoke operation + Response response = service.createNetworkAcl(createNetworkAclOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + NetworkACL networkAclResult = response.getResult(); + assertNotNull(networkAclResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateNetworkAcl" }) + public void testGetNetworkAcl() throws Exception { + try { + GetNetworkAclOptions getNetworkAclOptions = new GetNetworkAclOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getShareAccessorBinding(getShareAccessorBindingOptions).execute(); + Response response = service.getNetworkAcl(getNetworkAclOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareAccessorBinding shareAccessorBindingResult = response.getResult(); - assertNotNull(shareAccessorBindingResult); + NetworkACL networkAclResult = response.getResult(); + assertNotNull(networkAclResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9044,44 +9589,52 @@ public void testGetShareAccessorBinding() throws Exception { } } - @Test(dependsOnMethods = { "testGetShareAccessorBinding" }) - public void testFailoverShare() throws Exception { + @Test(dependsOnMethods = { "testGetNetworkAcl" }) + public void testUpdateNetworkAcl() throws Exception { try { - FailoverShareOptions failoverShareOptions = new FailoverShareOptions.Builder() - .shareId("testString") - .fallbackPolicy("fail") - .timeout(Long.valueOf("600")) + NetworkACLPatch networkAclPatchModel = new NetworkACLPatch.Builder() + .name("my-network-acl-updated") + .build(); + Map networkAclPatchModelAsPatch = networkAclPatchModel.asPatch(); + + UpdateNetworkAclOptions updateNetworkAclOptions = new UpdateNetworkAclOptions.Builder() + .id("testString") + .networkAclPatch(networkAclPatchModelAsPatch) .build(); // Invoke operation - Response response = service.failoverShare(failoverShareOptions).execute(); + Response response = service.updateNetworkAcl(updateNetworkAclOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 200); + + NetworkACL networkAclResult = response.getResult(); + assertNotNull(networkAclResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testFailoverShare" }) - public void testListShareMountTargets() throws Exception { + @Test(dependsOnMethods = { "testUpdateNetworkAcl" }) + public void testListNetworkAclRules() throws Exception { try { - ListShareMountTargetsOptions listShareMountTargetsOptions = new ListShareMountTargetsOptions.Builder() - .shareId("testString") - .name("my-name") + ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() + .networkAclId("testString") .start("testString") .limit(Long.valueOf("10")) + .direction("inbound") .build(); // Invoke operation - Response response = service.listShareMountTargets(listShareMountTargetsOptions).execute(); + Response response = service.listNetworkAclRules(listNetworkAclRulesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareMountTargetCollection shareMountTargetCollectionResult = response.getResult(); - assertNotNull(shareMountTargetCollectionResult); + NetworkACLRuleCollection networkAclRuleCollectionResult = response.getResult(); + assertNotNull(networkAclRuleCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9089,28 +9642,28 @@ public void testListShareMountTargets() throws Exception { } } - @Test(dependsOnMethods = { "testListShareMountTargets" }) - public void testListShareMountTargetsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListNetworkAclRules" }) + public void testListNetworkAclRulesWithPager() throws Exception { try { - ListShareMountTargetsOptions options = new ListShareMountTargetsOptions.Builder() - .shareId("testString") - .name("my-name") + ListNetworkAclRulesOptions options = new ListNetworkAclRulesOptions.Builder() + .networkAclId("testString") .limit(Long.valueOf("10")) + .direction("inbound") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - ShareMountTargetsPager pager = new ShareMountTargetsPager(service, options); + List allResults = new ArrayList<>(); + NetworkAclRulesPager pager = new NetworkAclRulesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new ShareMountTargetsPager(service, options); - List allItems = pager.getAll(); + pager = new NetworkAclRulesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -9122,65 +9675,37 @@ public void testListShareMountTargetsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListShareMountTargets" }) - public void testCreateShareMountTarget() throws Exception { + @Test(dependsOnMethods = { "testListNetworkAclRules" }) + public void testCreateNetworkAclRule() throws Exception { try { - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext shareMountTargetVirtualNetworkInterfacePrototypeModel = new ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() + .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") .build(); - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() - .name("my-share-mount-target") - .transitEncryption("none") - .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("any") .build(); - - CreateShareMountTargetOptions createShareMountTargetOptions = new CreateShareMountTargetOptions.Builder() - .shareId("testString") - .shareMountTargetPrototype(shareMountTargetPrototypeModel) + + CreateNetworkAclRuleOptions createNetworkAclRuleOptions = new CreateNetworkAclRuleOptions.Builder() + .networkAclId("testString") + .networkAclRulePrototype(networkAclRulePrototypeModel) .build(); // Invoke operation - Response response = service.createShareMountTarget(createShareMountTargetOptions).execute(); + Response response = service.createNetworkAclRule(createNetworkAclRuleOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - ShareMountTarget shareMountTargetResult = response.getResult(); - assertNotNull(shareMountTargetResult); + NetworkACLRule networkAclRuleResult = response.getResult(); + assertNotNull(networkAclRuleResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9188,22 +9713,22 @@ public void testCreateShareMountTarget() throws Exception { } } - @Test(dependsOnMethods = { "testCreateShareMountTarget" }) - public void testGetShareMountTarget() throws Exception { + @Test(dependsOnMethods = { "testCreateNetworkAclRule" }) + public void testGetNetworkAclRule() throws Exception { try { - GetShareMountTargetOptions getShareMountTargetOptions = new GetShareMountTargetOptions.Builder() - .shareId("testString") + GetNetworkAclRuleOptions getNetworkAclRuleOptions = new GetNetworkAclRuleOptions.Builder() + .networkAclId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getShareMountTarget(getShareMountTargetOptions).execute(); + Response response = service.getNetworkAclRule(getNetworkAclRuleOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareMountTarget shareMountTargetResult = response.getResult(); - assertNotNull(shareMountTargetResult); + NetworkACLRule networkAclRuleResult = response.getResult(); + assertNotNull(networkAclRuleResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9211,28 +9736,43 @@ public void testGetShareMountTarget() throws Exception { } } - @Test(dependsOnMethods = { "testGetShareMountTarget" }) - public void testUpdateShareMountTarget() throws Exception { + @Test(dependsOnMethods = { "testGetNetworkAclRule" }) + public void testUpdateNetworkAclRule() throws Exception { try { - ShareMountTargetPatch shareMountTargetPatchModel = new ShareMountTargetPatch.Builder() - .name("my-share-mount-target") + NetworkACLRuleBeforePatchNetworkACLRuleIdentityById networkAclRuleBeforePatchModel = new NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.Builder() + .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") .build(); - Map shareMountTargetPatchModelAsPatch = shareMountTargetPatchModel.asPatch(); - UpdateShareMountTargetOptions updateShareMountTargetOptions = new UpdateShareMountTargetOptions.Builder() - .shareId("testString") + NetworkACLRulePatch networkAclRulePatchModel = new NetworkACLRulePatch.Builder() + .action("allow") + .before(networkAclRuleBeforePatchModel) + .code(Long.valueOf("0")) + .destination("192.168.3.2/32") + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .direction("inbound") + .name("my-network-acl-rule") + .source("10.0.0.0/0") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) + .type(Long.valueOf("8")) + .build(); + Map networkAclRulePatchModelAsPatch = networkAclRulePatchModel.asPatch(); + + UpdateNetworkAclRuleOptions updateNetworkAclRuleOptions = new UpdateNetworkAclRuleOptions.Builder() + .networkAclId("testString") .id("testString") - .shareMountTargetPatch(shareMountTargetPatchModelAsPatch) + .networkAclRulePatch(networkAclRulePatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateShareMountTarget(updateShareMountTargetOptions).execute(); + Response response = service.updateNetworkAclRule(updateNetworkAclRuleOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareMountTarget shareMountTargetResult = response.getResult(); - assertNotNull(shareMountTargetResult); + NetworkACLRule networkAclRuleResult = response.getResult(); + assertNotNull(networkAclRuleResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9240,26 +9780,22 @@ public void testUpdateShareMountTarget() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateShareMountTarget" }) - public void testListShareSnapshots() throws Exception { + @Test(dependsOnMethods = { "testUpdateNetworkAclRule" }) + public void testListPlacementGroups() throws Exception { try { - ListShareSnapshotsOptions listShareSnapshotsOptions = new ListShareSnapshotsOptions.Builder() - .shareId("testString") - .backupPolicyPlanId("testString") - .name("my-name") + ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .sort("name") .build(); // Invoke operation - Response response = service.listShareSnapshots(listShareSnapshotsOptions).execute(); + Response response = service.listPlacementGroups(listPlacementGroupsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareSnapshotCollection shareSnapshotCollectionResult = response.getResult(); - assertNotNull(shareSnapshotCollectionResult); + PlacementGroupCollection placementGroupCollectionResult = response.getResult(); + assertNotNull(placementGroupCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9267,30 +9803,26 @@ public void testListShareSnapshots() throws Exception { } } - @Test(dependsOnMethods = { "testListShareSnapshots" }) - public void testListShareSnapshotsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListPlacementGroups" }) + public void testListPlacementGroupsWithPager() throws Exception { try { - ListShareSnapshotsOptions options = new ListShareSnapshotsOptions.Builder() - .shareId("testString") - .backupPolicyPlanId("testString") - .name("my-name") + ListPlacementGroupsOptions options = new ListPlacementGroupsOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - ShareSnapshotsPager pager = new ShareSnapshotsPager(service, options); + List allResults = new ArrayList<>(); + PlacementGroupsPager pager = new PlacementGroupsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new ShareSnapshotsPager(service, options); - List allItems = pager.getAll(); + pager = new PlacementGroupsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -9302,23 +9834,27 @@ public void testListShareSnapshotsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListShareSnapshots" }) - public void testCreateShareSnapshot() throws Exception { + @Test(dependsOnMethods = { "testListPlacementGroups" }) + public void testCreatePlacementGroup() throws Exception { try { - CreateShareSnapshotOptions createShareSnapshotOptions = new CreateShareSnapshotOptions.Builder() - .shareId("testString") - .name("my-share-snapshot") - .userTags(java.util.Arrays.asList("testString")) + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + CreatePlacementGroupOptions createPlacementGroupOptions = new CreatePlacementGroupOptions.Builder() + .strategy("host_spread") + .name("my-placement-group") + .resourceGroup(resourceGroupIdentityModel) .build(); // Invoke operation - Response response = service.createShareSnapshot(createShareSnapshotOptions).execute(); + Response response = service.createPlacementGroup(createPlacementGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - ShareSnapshot shareSnapshotResult = response.getResult(); - assertNotNull(shareSnapshotResult); + PlacementGroup placementGroupResult = response.getResult(); + assertNotNull(placementGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9326,22 +9862,21 @@ public void testCreateShareSnapshot() throws Exception { } } - @Test(dependsOnMethods = { "testCreateShareSnapshot" }) - public void testGetShareSnapshot() throws Exception { + @Test(dependsOnMethods = { "testCreatePlacementGroup" }) + public void testGetPlacementGroup() throws Exception { try { - GetShareSnapshotOptions getShareSnapshotOptions = new GetShareSnapshotOptions.Builder() - .shareId("testString") + GetPlacementGroupOptions getPlacementGroupOptions = new GetPlacementGroupOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getShareSnapshot(getShareSnapshotOptions).execute(); + Response response = service.getPlacementGroup(getPlacementGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareSnapshot shareSnapshotResult = response.getResult(); - assertNotNull(shareSnapshotResult); + PlacementGroup placementGroupResult = response.getResult(); + assertNotNull(placementGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9349,29 +9884,27 @@ public void testGetShareSnapshot() throws Exception { } } - @Test(dependsOnMethods = { "testGetShareSnapshot" }) - public void testUpdateShareSnapshot() throws Exception { + @Test(dependsOnMethods = { "testGetPlacementGroup" }) + public void testUpdatePlacementGroup() throws Exception { try { - ShareSnapshotPatch shareSnapshotPatchModel = new ShareSnapshotPatch.Builder() - .userTags(java.util.Arrays.asList("testString")) + PlacementGroupPatch placementGroupPatchModel = new PlacementGroupPatch.Builder() + .name("my-placement-group-updated") .build(); - Map shareSnapshotPatchModelAsPatch = shareSnapshotPatchModel.asPatch(); + Map placementGroupPatchModelAsPatch = placementGroupPatchModel.asPatch(); - UpdateShareSnapshotOptions updateShareSnapshotOptions = new UpdateShareSnapshotOptions.Builder() - .shareId("testString") + UpdatePlacementGroupOptions updatePlacementGroupOptions = new UpdatePlacementGroupOptions.Builder() .id("testString") - .shareSnapshotPatch(shareSnapshotPatchModelAsPatch) - .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") + .placementGroupPatch(placementGroupPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateShareSnapshot(updateShareSnapshotOptions).execute(); + Response response = service.updatePlacementGroup(updatePlacementGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareSnapshot shareSnapshotResult = response.getResult(); - assertNotNull(shareSnapshotResult); + PlacementGroup placementGroupResult = response.getResult(); + assertNotNull(placementGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9379,21 +9912,23 @@ public void testUpdateShareSnapshot() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateShareSnapshot" }) - public void testGetShareSource() throws Exception { + @Test(dependsOnMethods = { "testUpdatePlacementGroup" }) + public void testListPrivatePathServiceGateways() throws Exception { try { - GetShareSourceOptions getShareSourceOptions = new GetShareSourceOptions.Builder() - .shareId("testString") + ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptions = new ListPrivatePathServiceGatewaysOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); // Invoke operation - Response response = service.getShareSource(getShareSourceOptions).execute(); + Response response = service.listPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ShareReference shareReferenceResult = response.getResult(); - assertNotNull(shareReferenceResult); + PrivatePathServiceGatewayCollection privatePathServiceGatewayCollectionResult = response.getResult(); + assertNotNull(privatePathServiceGatewayCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9401,25 +9936,66 @@ public void testGetShareSource() throws Exception { } } - @Test(dependsOnMethods = { "testGetShareSource" }) - public void testListBackupPolicies() throws Exception { + @Test(dependsOnMethods = { "testListPrivatePathServiceGateways" }) + public void testListPrivatePathServiceGatewaysWithPager() throws Exception { try { - ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() - .start("testString") + ListPrivatePathServiceGatewaysOptions options = new ListPrivatePathServiceGatewaysOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .name("my-name") - .tag("testString") + .build(); + + // Test getNext(). + List allResults = new ArrayList<>(); + PrivatePathServiceGatewaysPager pager = new PrivatePathServiceGatewaysPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new PrivatePathServiceGatewaysPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListPrivatePathServiceGateways" }) + public void testCreatePrivatePathServiceGateway() throws Exception { + try { + LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() + .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .build(); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + CreatePrivatePathServiceGatewayOptions createPrivatePathServiceGatewayOptions = new CreatePrivatePathServiceGatewayOptions.Builder() + .loadBalancer(loadBalancerIdentityModel) + .serviceEndpoints(java.util.Arrays.asList("*.example.com")) + .defaultAccessPolicy("deny") + .name("my-private-path-service-gateway") + .resourceGroup(resourceGroupIdentityModel) + .zonalAffinity(false) .build(); // Invoke operation - Response response = service.listBackupPolicies(listBackupPoliciesOptions).execute(); + Response response = service.createPrivatePathServiceGateway(createPrivatePathServiceGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - BackupPolicyCollection backupPolicyCollectionResult = response.getResult(); - assertNotNull(backupPolicyCollectionResult); + PrivatePathServiceGateway privatePathServiceGatewayResult = response.getResult(); + assertNotNull(privatePathServiceGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9427,111 +10003,56 @@ public void testListBackupPolicies() throws Exception { } } - @Test(dependsOnMethods = { "testListBackupPolicies" }) - public void testListBackupPoliciesWithPager() throws Exception { + @Test(dependsOnMethods = { "testCreatePrivatePathServiceGateway" }) + public void testGetPrivatePathServiceGateway() throws Exception { try { - ListBackupPoliciesOptions options = new ListBackupPoliciesOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .tag("testString") + GetPrivatePathServiceGatewayOptions getPrivatePathServiceGatewayOptions = new GetPrivatePathServiceGatewayOptions.Builder() + .id("testString") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - BackupPoliciesPager pager = new BackupPoliciesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + // Invoke operation + Response response = service.getPrivatePathServiceGateway(getPrivatePathServiceGatewayOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - // Test getAll(); - pager = new BackupPoliciesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + PrivatePathServiceGateway privatePathServiceGatewayResult = response.getResult(); + assertNotNull(privatePathServiceGatewayResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListBackupPolicies" }) - public void testCreateBackupPolicy() throws Exception { + @Test(dependsOnMethods = { "testGetPrivatePathServiceGateway" }) + public void testUpdatePrivatePathServiceGateway() throws Exception { try { - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - BackupPolicyPlanClonePolicyPrototype backupPolicyPlanClonePolicyPrototypeModel = new BackupPolicyPlanClonePolicyPrototype.Builder() - .maxSnapshots(Long.valueOf("5")) - .zones(java.util.Arrays.asList(zoneIdentityModel)) - .build(); - - BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("20")) - .build(); - - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() - .name("us-south") - .build(); - - BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() - .deleteOverCount(Long.valueOf("5")) - .encryptionKey(encryptionKeyIdentityModel) - .region(regionIdentityModel) - .build(); - - BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() - .active(true) - .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) - .clonePolicy(backupPolicyPlanClonePolicyPrototypeModel) - .copyUserTags(true) - .cronSpec("30 */2 * * 1-5") - .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) - .name("my-policy-plan") - .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN backupPolicyScopePrototypeModel = new BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce") + LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() + .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") .build(); - BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype backupPolicyPrototypeModel = new BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.Builder() - .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) - .name("my-backup-policy") - .plans(java.util.Arrays.asList(backupPolicyPlanPrototypeModel)) - .resourceGroup(resourceGroupIdentityModel) - .scope(backupPolicyScopePrototypeModel) - .matchResourceType("volume") + PrivatePathServiceGatewayPatch privatePathServiceGatewayPatchModel = new PrivatePathServiceGatewayPatch.Builder() + .defaultAccessPolicy("deny") + .loadBalancer(loadBalancerIdentityModel) + .name("my-private-path-service-gateway") + .zonalAffinity(true) .build(); + Map privatePathServiceGatewayPatchModelAsPatch = privatePathServiceGatewayPatchModel.asPatch(); - CreateBackupPolicyOptions createBackupPolicyOptions = new CreateBackupPolicyOptions.Builder() - .backupPolicyPrototype(backupPolicyPrototypeModel) + UpdatePrivatePathServiceGatewayOptions updatePrivatePathServiceGatewayOptions = new UpdatePrivatePathServiceGatewayOptions.Builder() + .id("testString") + .privatePathServiceGatewayPatch(privatePathServiceGatewayPatchModelAsPatch) .build(); // Invoke operation - Response response = service.createBackupPolicy(createBackupPolicyOptions).execute(); + Response response = service.updatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - BackupPolicy backupPolicyResult = response.getResult(); - assertNotNull(backupPolicyResult); + PrivatePathServiceGateway privatePathServiceGatewayResult = response.getResult(); + assertNotNull(privatePathServiceGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9539,29 +10060,24 @@ public void testCreateBackupPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testCreateBackupPolicy" }) - public void testListBackupPolicyJobs() throws Exception { + @Test(dependsOnMethods = { "testUpdatePrivatePathServiceGateway" }) + public void testListPrivatePathServiceGatewayAccountPolicies() throws Exception { try { - ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() - .backupPolicyId("testString") - .status("failed") - .backupPolicyPlanId("testString") + ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptions = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() + .privatePathServiceGatewayId("testString") .start("testString") .limit(Long.valueOf("10")) - .sort("name") - .sourceId("testString") - .targetSnapshotsId("testString") - .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); // Invoke operation - Response response = service.listBackupPolicyJobs(listBackupPolicyJobsOptions).execute(); + Response response = service.listPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BackupPolicyJobCollection backupPolicyJobCollectionResult = response.getResult(); - assertNotNull(backupPolicyJobCollectionResult); + PrivatePathServiceGatewayAccountPolicyCollection privatePathServiceGatewayAccountPolicyCollectionResult = response.getResult(); + assertNotNull(privatePathServiceGatewayAccountPolicyCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9569,33 +10085,28 @@ public void testListBackupPolicyJobs() throws Exception { } } - @Test(dependsOnMethods = { "testListBackupPolicyJobs" }) - public void testListBackupPolicyJobsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListPrivatePathServiceGatewayAccountPolicies" }) + public void testListPrivatePathServiceGatewayAccountPoliciesWithPager() throws Exception { try { - ListBackupPolicyJobsOptions options = new ListBackupPolicyJobsOptions.Builder() - .backupPolicyId("testString") - .status("failed") - .backupPolicyPlanId("testString") + ListPrivatePathServiceGatewayAccountPoliciesOptions options = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() + .privatePathServiceGatewayId("testString") .limit(Long.valueOf("10")) - .sort("name") - .sourceId("testString") - .targetSnapshotsId("testString") - .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - BackupPolicyJobsPager pager = new BackupPolicyJobsPager(service, options); + List allResults = new ArrayList<>(); + PrivatePathServiceGatewayAccountPoliciesPager pager = new PrivatePathServiceGatewayAccountPoliciesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new BackupPolicyJobsPager(service, options); - List allItems = pager.getAll(); + pager = new PrivatePathServiceGatewayAccountPoliciesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -9607,22 +10118,27 @@ public void testListBackupPolicyJobsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListBackupPolicyJobs" }) - public void testGetBackupPolicyJob() throws Exception { + @Test(dependsOnMethods = { "testListPrivatePathServiceGatewayAccountPolicies" }) + public void testCreatePrivatePathServiceGatewayAccountPolicy() throws Exception { try { - GetBackupPolicyJobOptions getBackupPolicyJobOptions = new GetBackupPolicyJobOptions.Builder() - .backupPolicyId("testString") - .id("testString") + AccountIdentityById accountIdentityModel = new AccountIdentityById.Builder() + .id("bb1b52262f7441a586f49068482f1e60") + .build(); + + CreatePrivatePathServiceGatewayAccountPolicyOptions createPrivatePathServiceGatewayAccountPolicyOptions = new CreatePrivatePathServiceGatewayAccountPolicyOptions.Builder() + .privatePathServiceGatewayId("testString") + .accessPolicy("deny") + .account(accountIdentityModel) .build(); // Invoke operation - Response response = service.getBackupPolicyJob(getBackupPolicyJobOptions).execute(); + Response response = service.createPrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - BackupPolicyJob backupPolicyJobResult = response.getResult(); - assertNotNull(backupPolicyJobResult); + PrivatePathServiceGatewayAccountPolicy privatePathServiceGatewayAccountPolicyResult = response.getResult(); + assertNotNull(privatePathServiceGatewayAccountPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9630,22 +10146,22 @@ public void testGetBackupPolicyJob() throws Exception { } } - @Test(dependsOnMethods = { "testGetBackupPolicyJob" }) - public void testListBackupPolicyPlans() throws Exception { + @Test(dependsOnMethods = { "testCreatePrivatePathServiceGatewayAccountPolicy" }) + public void testGetPrivatePathServiceGatewayAccountPolicy() throws Exception { try { - ListBackupPolicyPlansOptions listBackupPolicyPlansOptions = new ListBackupPolicyPlansOptions.Builder() - .backupPolicyId("testString") - .name("my-name") + GetPrivatePathServiceGatewayAccountPolicyOptions getPrivatePathServiceGatewayAccountPolicyOptions = new GetPrivatePathServiceGatewayAccountPolicyOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.listBackupPolicyPlans(listBackupPolicyPlansOptions).execute(); + Response response = service.getPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BackupPolicyPlanCollection backupPolicyPlanCollectionResult = response.getResult(); - assertNotNull(backupPolicyPlanCollectionResult); + PrivatePathServiceGatewayAccountPolicy privatePathServiceGatewayAccountPolicyResult = response.getResult(); + assertNotNull(privatePathServiceGatewayAccountPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9653,80 +10169,111 @@ public void testListBackupPolicyPlans() throws Exception { } } - @Test(dependsOnMethods = { "testListBackupPolicyPlans" }) - public void testCreateBackupPolicyPlan() throws Exception { + @Test(dependsOnMethods = { "testGetPrivatePathServiceGatewayAccountPolicy" }) + public void testUpdatePrivatePathServiceGatewayAccountPolicy() throws Exception { try { - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - BackupPolicyPlanClonePolicyPrototype backupPolicyPlanClonePolicyPrototypeModel = new BackupPolicyPlanClonePolicyPrototype.Builder() - .maxSnapshots(Long.valueOf("5")) - .zones(java.util.Arrays.asList(zoneIdentityModel)) + PrivatePathServiceGatewayAccountPolicyPatch privatePathServiceGatewayAccountPolicyPatchModel = new PrivatePathServiceGatewayAccountPolicyPatch.Builder() + .accessPolicy("review") .build(); + Map privatePathServiceGatewayAccountPolicyPatchModelAsPatch = privatePathServiceGatewayAccountPolicyPatchModel.asPatch(); - BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("20")) + UpdatePrivatePathServiceGatewayAccountPolicyOptions updatePrivatePathServiceGatewayAccountPolicyOptions = new UpdatePrivatePathServiceGatewayAccountPolicyOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") + .privatePathServiceGatewayAccountPolicyPatch(privatePathServiceGatewayAccountPolicyPatchModelAsPatch) .build(); - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); + // Invoke operation + Response response = service.updatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() - .name("us-south") - .build(); + PrivatePathServiceGatewayAccountPolicy privatePathServiceGatewayAccountPolicyResult = response.getResult(); + assertNotNull(privatePathServiceGatewayAccountPolicyResult); - BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() - .deleteOverCount(Long.valueOf("5")) - .encryptionKey(encryptionKeyIdentityModel) - .region(regionIdentityModel) - .build(); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - CreateBackupPolicyPlanOptions createBackupPolicyPlanOptions = new CreateBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .cronSpec("30 */2 * * 1-5") - .active(true) - .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) - .clonePolicy(backupPolicyPlanClonePolicyPrototypeModel) - .copyUserTags(true) - .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) - .name("my-policy-plan") - .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) + @Test(dependsOnMethods = { "testUpdatePrivatePathServiceGatewayAccountPolicy" }) + public void testListPrivatePathServiceGatewayEndpointGatewayBindings() throws Exception { + try { + ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptions = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() + .privatePathServiceGatewayId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .status("abandoned") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); // Invoke operation - Response response = service.createBackupPolicyPlan(createBackupPolicyPlanOptions).execute(); + Response response = service.listPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); + + PrivatePathServiceGatewayEndpointGatewayBindingCollection privatePathServiceGatewayEndpointGatewayBindingCollectionResult = response.getResult(); + assertNotNull(privatePathServiceGatewayEndpointGatewayBindingCollectionResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListPrivatePathServiceGatewayEndpointGatewayBindings" }) + public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWithPager() throws Exception { + try { + ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions options = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() + .privatePathServiceGatewayId("testString") + .limit(Long.valueOf("10")) + .status("abandoned") + .accountId("bb1b52262f7441a586f49068482f1e60") + .build(); - BackupPolicyPlan backupPolicyPlanResult = response.getResult(); - assertNotNull(backupPolicyPlanResult); + // Test getNext(). + List allResults = new ArrayList<>(); + PrivatePathServiceGatewayEndpointGatewayBindingsPager pager = new PrivatePathServiceGatewayEndpointGatewayBindingsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new PrivatePathServiceGatewayEndpointGatewayBindingsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testCreateBackupPolicyPlan" }) - public void testGetBackupPolicyPlan() throws Exception { + @Test(dependsOnMethods = { "testListPrivatePathServiceGatewayEndpointGatewayBindings" }) + public void testGetPrivatePathServiceGatewayEndpointGatewayBinding() throws Exception { try { - GetBackupPolicyPlanOptions getBackupPolicyPlanOptions = new GetBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") + GetPrivatePathServiceGatewayEndpointGatewayBindingOptions getPrivatePathServiceGatewayEndpointGatewayBindingOptions = new GetPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() + .privatePathServiceGatewayId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getBackupPolicyPlan(getBackupPolicyPlanOptions).execute(); + Response response = service.getPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BackupPolicyPlan backupPolicyPlanResult = response.getResult(); - assertNotNull(backupPolicyPlanResult); + PrivatePathServiceGatewayEndpointGatewayBinding privatePathServiceGatewayEndpointGatewayBindingResult = response.getResult(); + assertNotNull(privatePathServiceGatewayEndpointGatewayBindingResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9734,117 +10281,122 @@ public void testGetBackupPolicyPlan() throws Exception { } } - @Test(dependsOnMethods = { "testGetBackupPolicyPlan" }) - public void testUpdateBackupPolicyPlan() throws Exception { + @Test(dependsOnMethods = { "testGetPrivatePathServiceGatewayEndpointGatewayBinding" }) + public void testDenyPrivatePathServiceGatewayEndpointGatewayBinding() throws Exception { try { - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions denyPrivatePathServiceGatewayEndpointGatewayBindingOptions = new DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") + .setAccountPolicy(true) .build(); - BackupPolicyPlanClonePolicyPatch backupPolicyPlanClonePolicyPatchModel = new BackupPolicyPlanClonePolicyPatch.Builder() - .maxSnapshots(Long.valueOf("1")) - .zones(java.util.Arrays.asList(zoneIdentityModel)) - .build(); + // Invoke operation + Response response = service.denyPrivatePathServiceGatewayEndpointGatewayBinding(denyPrivatePathServiceGatewayEndpointGatewayBindingOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - BackupPolicyPlanDeletionTriggerPatch backupPolicyPlanDeletionTriggerPatchModel = new BackupPolicyPlanDeletionTriggerPatch.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("1")) + @Test(dependsOnMethods = { "testDenyPrivatePathServiceGatewayEndpointGatewayBinding" }) + public void testPermitPrivatePathServiceGatewayEndpointGatewayBinding() throws Exception { + try { + PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions permitPrivatePathServiceGatewayEndpointGatewayBindingOptions = new PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") + .setAccountPolicy(true) .build(); - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); + // Invoke operation + Response response = service.permitPrivatePathServiceGatewayEndpointGatewayBinding(permitPrivatePathServiceGatewayEndpointGatewayBindingOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() - .name("us-south") + @Test(dependsOnMethods = { "testPermitPrivatePathServiceGatewayEndpointGatewayBinding" }) + public void testPublishPrivatePathServiceGateway() throws Exception { + try { + PublishPrivatePathServiceGatewayOptions publishPrivatePathServiceGatewayOptions = new PublishPrivatePathServiceGatewayOptions.Builder() + .privatePathServiceGatewayId("testString") .build(); - BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() - .deleteOverCount(Long.valueOf("5")) - .encryptionKey(encryptionKeyIdentityModel) - .region(regionIdentityModel) - .build(); + // Invoke operation + Response response = service.publishPrivatePathServiceGateway(publishPrivatePathServiceGatewayOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() - .active(true) - .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) - .clonePolicy(backupPolicyPlanClonePolicyPatchModel) - .copyUserTags(false) - .cronSpec("30 */2 * * 1-5") - .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) - .name("my-policy-plan") - .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) + @Test(dependsOnMethods = { "testPublishPrivatePathServiceGateway" }) + public void testRevokeAccountForPrivatePathServiceGateway() throws Exception { + try { + AccountIdentityById accountIdentityModel = new AccountIdentityById.Builder() + .id("bb1b52262f7441a586f49068482f1e60") .build(); - Map backupPolicyPlanPatchModelAsPatch = backupPolicyPlanPatchModel.asPatch(); - UpdateBackupPolicyPlanOptions updateBackupPolicyPlanOptions = new UpdateBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .id("testString") - .backupPolicyPlanPatch(backupPolicyPlanPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + RevokeAccountForPrivatePathServiceGatewayOptions revokeAccountForPrivatePathServiceGatewayOptions = new RevokeAccountForPrivatePathServiceGatewayOptions.Builder() + .privatePathServiceGatewayId("testString") + .account(accountIdentityModel) .build(); // Invoke operation - Response response = service.updateBackupPolicyPlan(updateBackupPolicyPlanOptions).execute(); + Response response = service.revokeAccountForPrivatePathServiceGateway(revokeAccountForPrivatePathServiceGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - BackupPolicyPlan backupPolicyPlanResult = response.getResult(); - assertNotNull(backupPolicyPlanResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateBackupPolicyPlan" }) - public void testGetBackupPolicy() throws Exception { + @Test(dependsOnMethods = { "testRevokeAccountForPrivatePathServiceGateway" }) + public void testUnpublishPrivatePathServiceGateway() throws Exception { try { - GetBackupPolicyOptions getBackupPolicyOptions = new GetBackupPolicyOptions.Builder() - .id("testString") + UnpublishPrivatePathServiceGatewayOptions unpublishPrivatePathServiceGatewayOptions = new UnpublishPrivatePathServiceGatewayOptions.Builder() + .privatePathServiceGatewayId("testString") .build(); // Invoke operation - Response response = service.getBackupPolicy(getBackupPolicyOptions).execute(); + Response response = service.unpublishPrivatePathServiceGateway(unpublishPrivatePathServiceGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - BackupPolicy backupPolicyResult = response.getResult(); - assertNotNull(backupPolicyResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetBackupPolicy" }) - public void testUpdateBackupPolicy() throws Exception { + @Test(dependsOnMethods = { "testUnpublishPrivatePathServiceGateway" }) + public void testListPublicAddressRanges() throws Exception { try { - BackupPolicyPatch backupPolicyPatchModel = new BackupPolicyPatch.Builder() - .includedContent(java.util.Arrays.asList("data_volumes")) - .matchUserTags(java.util.Arrays.asList("my-tag-1", "my-tag-2", "my-tag-3")) - .name("my-backup-policy") - .build(); - Map backupPolicyPatchModelAsPatch = backupPolicyPatchModel.asPatch(); - - UpdateBackupPolicyOptions updateBackupPolicyOptions = new UpdateBackupPolicyOptions.Builder() - .id("testString") - .backupPolicyPatch(backupPolicyPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + ListPublicAddressRangesOptions listPublicAddressRangesOptions = new ListPublicAddressRangesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); // Invoke operation - Response response = service.updateBackupPolicy(updateBackupPolicyOptions).execute(); + Response response = service.listPublicAddressRanges(listPublicAddressRangesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - BackupPolicy backupPolicyResult = response.getResult(); - assertNotNull(backupPolicyResult); + PublicAddressRangeCollection publicAddressRangeCollectionResult = response.getResult(); + assertNotNull(publicAddressRangeCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9852,41 +10404,73 @@ public void testUpdateBackupPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateBackupPolicy" }) - public void testListRegions() throws Exception { + @Test(dependsOnMethods = { "testListPublicAddressRanges" }) + public void testListPublicAddressRangesWithPager() throws Exception { try { - ListRegionsOptions listRegionsOptions = new ListRegionsOptions(); + ListPublicAddressRangesOptions options = new ListPublicAddressRangesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); - // Invoke operation - Response response = service.listRegions(listRegionsOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + PublicAddressRangesPager pager = new PublicAddressRangesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - RegionCollection regionCollectionResult = response.getResult(); - assertNotNull(regionCollectionResult); + // Test getAll(); + pager = new PublicAddressRangesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListRegions" }) - public void testGetRegion() throws Exception { + @Test(dependsOnMethods = { "testListPublicAddressRanges" }) + public void testCreatePublicAddressRange() throws Exception { try { - GetRegionOptions getRegionOptions = new GetRegionOptions.Builder() - .name("us-south") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + PublicAddressRangeTargetPrototype publicAddressRangeTargetPrototypeModel = new PublicAddressRangeTargetPrototype.Builder() + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .build(); + + CreatePublicAddressRangeOptions createPublicAddressRangeOptions = new CreatePublicAddressRangeOptions.Builder() + .ipv4AddressCount(Long.valueOf("8")) + .name("my-public-address-range") + .resourceGroup(resourceGroupIdentityModel) + .target(publicAddressRangeTargetPrototypeModel) .build(); // Invoke operation - Response response = service.getRegion(getRegionOptions).execute(); + Response response = service.createPublicAddressRange(createPublicAddressRangeOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - Region regionResult = response.getResult(); - assertNotNull(regionResult); + PublicAddressRange publicAddressRangeResult = response.getResult(); + assertNotNull(publicAddressRangeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9894,21 +10478,21 @@ public void testGetRegion() throws Exception { } } - @Test(dependsOnMethods = { "testGetRegion" }) - public void testListRegionZones() throws Exception { + @Test(dependsOnMethods = { "testCreatePublicAddressRange" }) + public void testGetPublicAddressRange() throws Exception { try { - ListRegionZonesOptions listRegionZonesOptions = new ListRegionZonesOptions.Builder() - .regionName("us-south") + GetPublicAddressRangeOptions getPublicAddressRangeOptions = new GetPublicAddressRangeOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listRegionZones(listRegionZonesOptions).execute(); + Response response = service.getPublicAddressRange(getPublicAddressRangeOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ZoneCollection zoneCollectionResult = response.getResult(); - assertNotNull(zoneCollectionResult); + PublicAddressRange publicAddressRangeResult = response.getResult(); + assertNotNull(publicAddressRangeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9916,22 +10500,41 @@ public void testListRegionZones() throws Exception { } } - @Test(dependsOnMethods = { "testListRegionZones" }) - public void testGetRegionZone() throws Exception { + @Test(dependsOnMethods = { "testGetPublicAddressRange" }) + public void testUpdatePublicAddressRange() throws Exception { try { - GetRegionZoneOptions getRegionZoneOptions = new GetRegionZoneOptions.Builder() - .regionName("us-south") + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); + PublicAddressRangeTargetPatch publicAddressRangeTargetPatchModel = new PublicAddressRangeTargetPatch.Builder() + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .build(); + + PublicAddressRangePatch publicAddressRangePatchModel = new PublicAddressRangePatch.Builder() + .name("my-public-address-range-updated") + .target(publicAddressRangeTargetPatchModel) + .build(); + Map publicAddressRangePatchModelAsPatch = publicAddressRangePatchModel.asPatch(); + + UpdatePublicAddressRangeOptions updatePublicAddressRangeOptions = new UpdatePublicAddressRangeOptions.Builder() + .id("testString") + .publicAddressRangePatch(publicAddressRangePatchModelAsPatch) + .build(); + // Invoke operation - Response response = service.getRegionZone(getRegionZoneOptions).execute(); + Response response = service.updatePublicAddressRange(updatePublicAddressRangeOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - Zone zoneResult = response.getResult(); - assertNotNull(zoneResult); + PublicAddressRange publicAddressRangeResult = response.getResult(); + assertNotNull(publicAddressRangeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9939,23 +10542,23 @@ public void testGetRegionZone() throws Exception { } } - @Test(dependsOnMethods = { "testGetRegionZone" }) - public void testListVirtualNetworkInterfaces() throws Exception { + @Test(dependsOnMethods = { "testUpdatePublicAddressRange" }) + public void testListPublicGateways() throws Exception { try { - ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptions = new ListVirtualNetworkInterfacesOptions.Builder() + ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") .build(); // Invoke operation - Response response = service.listVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptions).execute(); + Response response = service.listPublicGateways(listPublicGatewaysOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VirtualNetworkInterfaceCollection virtualNetworkInterfaceCollectionResult = response.getResult(); - assertNotNull(virtualNetworkInterfaceCollectionResult); + PublicGatewayCollection publicGatewayCollectionResult = response.getResult(); + assertNotNull(publicGatewayCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -9963,27 +10566,27 @@ public void testListVirtualNetworkInterfaces() throws Exception { } } - @Test(dependsOnMethods = { "testListVirtualNetworkInterfaces" }) - public void testListVirtualNetworkInterfacesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListPublicGateways" }) + public void testListPublicGatewaysWithPager() throws Exception { try { - ListVirtualNetworkInterfacesOptions options = new ListVirtualNetworkInterfacesOptions.Builder() + ListPublicGatewaysOptions options = new ListPublicGatewaysOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VirtualNetworkInterfacesPager pager = new VirtualNetworkInterfacesPager(service, options); + List allResults = new ArrayList<>(); + PublicGatewaysPager pager = new PublicGatewaysPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VirtualNetworkInterfacesPager(service, options); - List allItems = pager.getAll(); + pager = new PublicGatewaysPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -9995,50 +10598,41 @@ public void testListVirtualNetworkInterfacesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVirtualNetworkInterfaces" }) - public void testCreateVirtualNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testListPublicGateways" }) + public void testCreatePublicGateway() throws Exception { try { - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.Builder() - .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") - .build(); - - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById.Builder() - .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById publicGatewayFloatingIpPrototypeModel = new PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.Builder() + .id("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd") .build(); - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - CreateVirtualNetworkInterfaceOptions createVirtualNetworkInterfaceOptions = new CreateVirtualNetworkInterfaceOptions.Builder() - .allowIpSpoofing(false) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") + CreatePublicGatewayOptions createPublicGatewayOptions = new CreatePublicGatewayOptions.Builder() + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .floatingIp(publicGatewayFloatingIpPrototypeModel) + .name("my-public-gateway") .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) .build(); // Invoke operation - Response response = service.createVirtualNetworkInterface(createVirtualNetworkInterfaceOptions).execute(); + Response response = service.createPublicGateway(createPublicGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - VirtualNetworkInterface virtualNetworkInterfaceResult = response.getResult(); - assertNotNull(virtualNetworkInterfaceResult); + PublicGateway publicGatewayResult = response.getResult(); + assertNotNull(publicGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10046,21 +10640,21 @@ public void testCreateVirtualNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVirtualNetworkInterface" }) - public void testGetVirtualNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testCreatePublicGateway" }) + public void testGetPublicGateway() throws Exception { try { - GetVirtualNetworkInterfaceOptions getVirtualNetworkInterfaceOptions = new GetVirtualNetworkInterfaceOptions.Builder() + GetPublicGatewayOptions getPublicGatewayOptions = new GetPublicGatewayOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getVirtualNetworkInterface(getVirtualNetworkInterfaceOptions).execute(); + Response response = service.getPublicGateway(getPublicGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VirtualNetworkInterface virtualNetworkInterfaceResult = response.getResult(); - assertNotNull(virtualNetworkInterfaceResult); + PublicGateway publicGatewayResult = response.getResult(); + assertNotNull(publicGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10068,31 +10662,27 @@ public void testGetVirtualNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testGetVirtualNetworkInterface" }) - public void testUpdateVirtualNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testGetPublicGateway" }) + public void testUpdatePublicGateway() throws Exception { try { - VirtualNetworkInterfacePatch virtualNetworkInterfacePatchModel = new VirtualNetworkInterfacePatch.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .name("my-virtual-network-interface") - .protocolStateFilteringMode("auto") + PublicGatewayPatch publicGatewayPatchModel = new PublicGatewayPatch.Builder() + .name("my-public-gateway-updated") .build(); - Map virtualNetworkInterfacePatchModelAsPatch = virtualNetworkInterfacePatchModel.asPatch(); + Map publicGatewayPatchModelAsPatch = publicGatewayPatchModel.asPatch(); - UpdateVirtualNetworkInterfaceOptions updateVirtualNetworkInterfaceOptions = new UpdateVirtualNetworkInterfaceOptions.Builder() + UpdatePublicGatewayOptions updatePublicGatewayOptions = new UpdatePublicGatewayOptions.Builder() .id("testString") - .virtualNetworkInterfacePatch(virtualNetworkInterfacePatchModelAsPatch) + .publicGatewayPatch(publicGatewayPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptions).execute(); + Response response = service.updatePublicGateway(updatePublicGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VirtualNetworkInterface virtualNetworkInterfaceResult = response.getResult(); - assertNotNull(virtualNetworkInterfaceResult); + PublicGateway publicGatewayResult = response.getResult(); + assertNotNull(publicGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10100,24 +10690,27 @@ public void testUpdateVirtualNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVirtualNetworkInterface" }) - public void testListNetworkInterfaceFloatingIps() throws Exception { + @Test(dependsOnMethods = { "testUpdatePublicGateway" }) + public void testListReservations() throws Exception { try { - ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptions = new ListNetworkInterfaceFloatingIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + ListReservationsOptions listReservationsOptions = new ListReservationsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .sort("name") + .name("my-name") + .profileResourceType("testString") + .affinityPolicy("automatic") + .resourceGroupId("testString") + .zoneName("us-south-1") .build(); // Invoke operation - Response response = service.listNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptions).execute(); + Response response = service.listReservations(listReservationsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FloatingIPCollectionVirtualNetworkInterfaceContext floatingIpCollectionVirtualNetworkInterfaceContextResult = response.getResult(); - assertNotNull(floatingIpCollectionVirtualNetworkInterfaceContextResult); + ReservationCollection reservationCollectionResult = response.getResult(); + assertNotNull(reservationCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10125,55 +10718,153 @@ public void testListNetworkInterfaceFloatingIps() throws Exception { } } - @Test(dependsOnMethods = { "testListNetworkInterfaceFloatingIps" }) - public void testListNetworkInterfaceFloatingIpsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListReservations" }) + public void testListReservationsWithPager() throws Exception { try { - ListNetworkInterfaceFloatingIpsOptions options = new ListNetworkInterfaceFloatingIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + ListReservationsOptions options = new ListReservationsOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") + .name("my-name") + .profileResourceType("testString") + .affinityPolicy("automatic") + .resourceGroupId("testString") + .zoneName("us-south-1") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - NetworkInterfaceFloatingIpsPager pager = new NetworkInterfaceFloatingIpsPager(service, options); + List allResults = new ArrayList<>(); + ReservationsPager pager = new ReservationsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); - // Test getAll(); - pager = new NetworkInterfaceFloatingIpsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + // Test getAll(); + pager = new ReservationsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListReservations" }) + public void testCreateReservation() throws Exception { + try { + ReservationCapacityPrototype reservationCapacityPrototypeModel = new ReservationCapacityPrototype.Builder() + .total(Long.valueOf("10")) + .build(); + + ReservationCommittedUsePrototype reservationCommittedUsePrototypeModel = new ReservationCommittedUsePrototype.Builder() + .expirationPolicy("release") + .term("testString") + .build(); + + ReservationProfilePrototype reservationProfilePrototypeModel = new ReservationProfilePrototype.Builder() + .name("bx2-4x16") + .resourceType("bare_metal_server_profile") + .build(); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + CreateReservationOptions createReservationOptions = new CreateReservationOptions.Builder() + .capacity(reservationCapacityPrototypeModel) + .committedUse(reservationCommittedUsePrototypeModel) + .profile(reservationProfilePrototypeModel) + .zone(zoneIdentityModel) + .affinityPolicy("automatic") + .name("my-reservation") + .resourceGroup(resourceGroupIdentityModel) + .build(); + + // Invoke operation + Response response = service.createReservation(createReservationOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + Reservation reservationResult = response.getResult(); + assertNotNull(reservationResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateReservation" }) + public void testGetReservation() throws Exception { + try { + GetReservationOptions getReservationOptions = new GetReservationOptions.Builder() + .id("testString") + .build(); + + // Invoke operation + Response response = service.getReservation(getReservationOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Reservation reservationResult = response.getResult(); + assertNotNull(reservationResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListNetworkInterfaceFloatingIps" }) - public void testGetNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testGetReservation" }) + public void testUpdateReservation() throws Exception { try { - GetNetworkInterfaceFloatingIpOptions getNetworkInterfaceFloatingIpOptions = new GetNetworkInterfaceFloatingIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + ReservationCapacityPatch reservationCapacityPatchModel = new ReservationCapacityPatch.Builder() + .total(Long.valueOf("10")) + .build(); + + ReservationCommittedUsePatch reservationCommittedUsePatchModel = new ReservationCommittedUsePatch.Builder() + .expirationPolicy("release") + .term("testString") + .build(); + + ReservationProfilePatch reservationProfilePatchModel = new ReservationProfilePatch.Builder() + .name("bx2-4x16") + .resourceType("bare_metal_server_profile") + .build(); + + ReservationPatch reservationPatchModel = new ReservationPatch.Builder() + .affinityPolicy("automatic") + .capacity(reservationCapacityPatchModel) + .committedUse(reservationCommittedUsePatchModel) + .name("my-reservation") + .profile(reservationProfilePatchModel) + .build(); + Map reservationPatchModelAsPatch = reservationPatchModel.asPatch(); + + UpdateReservationOptions updateReservationOptions = new UpdateReservationOptions.Builder() .id("testString") + .reservationPatch(reservationPatchModelAsPatch) .build(); // Invoke operation - Response response = service.getNetworkInterfaceFloatingIp(getNetworkInterfaceFloatingIpOptions).execute(); + Response response = service.updateReservation(updateReservationOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FloatingIPReference floatingIpReferenceResult = response.getResult(); - assertNotNull(floatingIpReferenceResult); + Reservation reservationResult = response.getResult(); + assertNotNull(reservationResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10181,47 +10872,44 @@ public void testGetNetworkInterfaceFloatingIp() throws Exception { } } - @Test(dependsOnMethods = { "testGetNetworkInterfaceFloatingIp" }) - public void testAddNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testUpdateReservation" }) + public void testActivateReservation() throws Exception { try { - AddNetworkInterfaceFloatingIpOptions addNetworkInterfaceFloatingIpOptions = new AddNetworkInterfaceFloatingIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + ActivateReservationOptions activateReservationOptions = new ActivateReservationOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.addNetworkInterfaceFloatingIp(addNetworkInterfaceFloatingIpOptions).execute(); + Response response = service.activateReservation(activateReservationOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - FloatingIPReference floatingIpReferenceResult = response.getResult(); - assertNotNull(floatingIpReferenceResult); - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testAddNetworkInterfaceFloatingIp" }) - public void testListVirtualNetworkInterfaceIps() throws Exception { + @Test(dependsOnMethods = { "testActivateReservation" }) + public void testListSecurityGroups() throws Exception { try { - ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptions = new ListVirtualNetworkInterfaceIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .sort("name") + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); // Invoke operation - Response response = service.listVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptions).execute(); + Response response = service.listSecurityGroups(listSecurityGroupsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ReservedIPCollectionVirtualNetworkInterfaceContext reservedIpCollectionVirtualNetworkInterfaceContextResult = response.getResult(); - assertNotNull(reservedIpCollectionVirtualNetworkInterfaceContextResult); + SecurityGroupCollection securityGroupCollectionResult = response.getResult(); + assertNotNull(securityGroupCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10229,28 +10917,30 @@ public void testListVirtualNetworkInterfaceIps() throws Exception { } } - @Test(dependsOnMethods = { "testListVirtualNetworkInterfaceIps" }) - public void testListVirtualNetworkInterfaceIpsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListSecurityGroups" }) + public void testListSecurityGroupsWithPager() throws Exception { try { - ListVirtualNetworkInterfaceIpsOptions options = new ListVirtualNetworkInterfaceIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + ListSecurityGroupsOptions options = new ListSecurityGroupsOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VirtualNetworkInterfaceIpsPager pager = new VirtualNetworkInterfaceIpsPager(service, options); + List allResults = new ArrayList<>(); + SecurityGroupsPager pager = new SecurityGroupsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VirtualNetworkInterfaceIpsPager(service, options); - List allItems = pager.getAll(); + pager = new SecurityGroupsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -10262,45 +10952,49 @@ public void testListVirtualNetworkInterfaceIpsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVirtualNetworkInterfaceIps" }) - public void testGetVirtualNetworkInterfaceIp() throws Exception { + @Test(dependsOnMethods = { "testListSecurityGroups" }) + public void testCreateSecurityGroup() throws Exception { try { - GetVirtualNetworkInterfaceIpOptions getVirtualNetworkInterfaceIpOptions = new GetVirtualNetworkInterfaceIpOptions.Builder() - .virtualNetworkInterfaceId("testString") - .id("testString") + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - // Invoke operation - Response response = service.getVirtualNetworkInterfaceIp(getVirtualNetworkInterfaceIpOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); - ReservedIPReference reservedIpReferenceResult = response.getResult(); - assertNotNull(reservedIpReferenceResult); + SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() + .address("192.168.3.4") + .build(); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() + .address("192.168.3.4") + .build(); - @Test(dependsOnMethods = { "testGetVirtualNetworkInterfaceIp" }) - public void testAddVirtualNetworkInterfaceIp() throws Exception { - try { - AddVirtualNetworkInterfaceIpOptions addVirtualNetworkInterfaceIpOptions = new AddVirtualNetworkInterfaceIpOptions.Builder() - .virtualNetworkInterfaceId("testString") - .id("testString") + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Builder() + .direction("inbound") + .ipVersion("ipv4") + .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") + .remote(securityGroupRuleRemotePrototypeModel) + .protocol("any") + .build(); + + CreateSecurityGroupOptions createSecurityGroupOptions = new CreateSecurityGroupOptions.Builder() + .vpc(vpcIdentityModel) + .name("my-security-group") + .resourceGroup(resourceGroupIdentityModel) + .rules(java.util.Arrays.asList(securityGroupRulePrototypeModel)) .build(); // Invoke operation - Response response = service.addVirtualNetworkInterfaceIp(addVirtualNetworkInterfaceIpOptions).execute(); + Response response = service.createSecurityGroup(createSecurityGroupOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - ReservedIPReference reservedIpReferenceResult = response.getResult(); - assertNotNull(reservedIpReferenceResult); + SecurityGroup securityGroupResult = response.getResult(); + assertNotNull(securityGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10308,22 +11002,21 @@ public void testAddVirtualNetworkInterfaceIp() throws Exception { } } - @Test(dependsOnMethods = { "testAddVirtualNetworkInterfaceIp" }) - public void testListClusterNetworkProfiles() throws Exception { + @Test(dependsOnMethods = { "testCreateSecurityGroup" }) + public void testGetSecurityGroup() throws Exception { try { - ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptions = new ListClusterNetworkProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) + GetSecurityGroupOptions getSecurityGroupOptions = new GetSecurityGroupOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listClusterNetworkProfiles(listClusterNetworkProfilesOptions).execute(); + Response response = service.getSecurityGroup(getSecurityGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkProfileCollection clusterNetworkProfileCollectionResult = response.getResult(); - assertNotNull(clusterNetworkProfileCollectionResult); + SecurityGroup securityGroupResult = response.getResult(); + assertNotNull(securityGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10331,52 +11024,49 @@ public void testListClusterNetworkProfiles() throws Exception { } } - @Test(dependsOnMethods = { "testListClusterNetworkProfiles" }) - public void testListClusterNetworkProfilesWithPager() throws Exception { + @Test(dependsOnMethods = { "testGetSecurityGroup" }) + public void testUpdateSecurityGroup() throws Exception { try { - ListClusterNetworkProfilesOptions options = new ListClusterNetworkProfilesOptions.Builder() - .limit(Long.valueOf("10")) + SecurityGroupPatch securityGroupPatchModel = new SecurityGroupPatch.Builder() + .name("my-security-group") .build(); + Map securityGroupPatchModelAsPatch = securityGroupPatchModel.asPatch(); - // Test getNext(). - List allResults = new ArrayList<>(); - ClusterNetworkProfilesPager pager = new ClusterNetworkProfilesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + UpdateSecurityGroupOptions updateSecurityGroupOptions = new UpdateSecurityGroupOptions.Builder() + .id("testString") + .securityGroupPatch(securityGroupPatchModelAsPatch) + .build(); - // Test getAll(); - pager = new ClusterNetworkProfilesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + // Invoke operation + Response response = service.updateSecurityGroup(updateSecurityGroupOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + SecurityGroup securityGroupResult = response.getResult(); + assertNotNull(securityGroupResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListClusterNetworkProfiles" }) - public void testGetClusterNetworkProfile() throws Exception { + @Test(dependsOnMethods = { "testUpdateSecurityGroup" }) + public void testListSecurityGroupRules() throws Exception { try { - GetClusterNetworkProfileOptions getClusterNetworkProfileOptions = new GetClusterNetworkProfileOptions.Builder() - .name("h100") + ListSecurityGroupRulesOptions listSecurityGroupRulesOptions = new ListSecurityGroupRulesOptions.Builder() + .securityGroupId("testString") .build(); // Invoke operation - Response response = service.getClusterNetworkProfile(getClusterNetworkProfileOptions).execute(); + Response response = service.listSecurityGroupRules(listSecurityGroupRulesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkProfile clusterNetworkProfileResult = response.getResult(); - assertNotNull(clusterNetworkProfileResult); + SecurityGroupRuleCollection securityGroupRuleCollectionResult = response.getResult(); + assertNotNull(securityGroupRuleCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10384,28 +11074,39 @@ public void testGetClusterNetworkProfile() throws Exception { } } - @Test(dependsOnMethods = { "testGetClusterNetworkProfile" }) - public void testListClusterNetworks() throws Exception { + @Test(dependsOnMethods = { "testListSecurityGroupRules" }) + public void testCreateSecurityGroupRule() throws Exception { try { - ListClusterNetworksOptions listClusterNetworksOptions = new ListClusterNetworksOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") + SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() + .address("192.168.3.4") + .build(); + + SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() + .address("192.168.3.4") + .build(); + + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Builder() + .direction("inbound") + .ipVersion("ipv4") + .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") + .remote(securityGroupRuleRemotePrototypeModel) + .protocol("any") + .build(); + + CreateSecurityGroupRuleOptions createSecurityGroupRuleOptions = new CreateSecurityGroupRuleOptions.Builder() + .securityGroupId("testString") + .securityGroupRulePrototype(securityGroupRulePrototypeModel) .build(); // Invoke operation - Response response = service.listClusterNetworks(listClusterNetworksOptions).execute(); + Response response = service.createSecurityGroupRule(createSecurityGroupRuleOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - ClusterNetworkCollection clusterNetworkCollectionResult = response.getResult(); - assertNotNull(clusterNetworkCollectionResult); + SecurityGroupRule securityGroupRuleResult = response.getResult(); + assertNotNull(securityGroupRuleResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10413,83 +11114,67 @@ public void testListClusterNetworks() throws Exception { } } - @Test(dependsOnMethods = { "testListClusterNetworks" }) - public void testListClusterNetworksWithPager() throws Exception { + @Test(dependsOnMethods = { "testCreateSecurityGroupRule" }) + public void testGetSecurityGroupRule() throws Exception { try { - ListClusterNetworksOptions options = new ListClusterNetworksOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") + GetSecurityGroupRuleOptions getSecurityGroupRuleOptions = new GetSecurityGroupRuleOptions.Builder() + .securityGroupId("testString") + .id("testString") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - ClusterNetworksPager pager = new ClusterNetworksPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + // Invoke operation + Response response = service.getSecurityGroupRule(getSecurityGroupRuleOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - // Test getAll(); - pager = new ClusterNetworksPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + SecurityGroupRule securityGroupRuleResult = response.getResult(); + assertNotNull(securityGroupRuleResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListClusterNetworks" }) - public void testCreateClusterNetwork() throws Exception { + @Test(dependsOnMethods = { "testGetSecurityGroupRule" }) + public void testUpdateSecurityGroupRule() throws Exception { try { - ClusterNetworkProfileIdentityByName clusterNetworkProfileIdentityModel = new ClusterNetworkProfileIdentityByName.Builder() - .name("h100") - .build(); - - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + SecurityGroupRuleLocalPatchIP securityGroupRuleLocalPatchModel = new SecurityGroupRuleLocalPatchIP.Builder() + .address("192.168.3.4") .build(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + SecurityGroupRuleRemotePatchCIDR securityGroupRuleRemotePatchModel = new SecurityGroupRuleRemotePatchCIDR.Builder() + .cidrBlock("10.0.0.0/8") .build(); - ClusterNetworkSubnetPrefixPrototype clusterNetworkSubnetPrefixPrototypeModel = new ClusterNetworkSubnetPrefixPrototype.Builder() - .cidr("10.0.0.0/24") + SecurityGroupRulePatch securityGroupRulePatchModel = new SecurityGroupRulePatch.Builder() + .code(Long.valueOf("0")) + .direction("inbound") + .ipVersion("ipv4") + .local(securityGroupRuleLocalPatchModel) + .name("my-security-group-rule") + .portMax(Long.valueOf("22")) + .portMin(Long.valueOf("22")) + .remote(securityGroupRuleRemotePatchModel) + .type(Long.valueOf("8")) .build(); + Map securityGroupRulePatchModelAsPatch = securityGroupRulePatchModel.asPatch(); - CreateClusterNetworkOptions createClusterNetworkOptions = new CreateClusterNetworkOptions.Builder() - .profile(clusterNetworkProfileIdentityModel) - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) - .name("my-cluster-network") - .resourceGroup(resourceGroupIdentityModel) - .subnetPrefixes(java.util.Arrays.asList(clusterNetworkSubnetPrefixPrototypeModel)) + UpdateSecurityGroupRuleOptions updateSecurityGroupRuleOptions = new UpdateSecurityGroupRuleOptions.Builder() + .securityGroupId("testString") + .id("testString") + .securityGroupRulePatch(securityGroupRulePatchModelAsPatch) .build(); // Invoke operation - Response response = service.createClusterNetwork(createClusterNetworkOptions).execute(); + Response response = service.updateSecurityGroupRule(updateSecurityGroupRuleOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - ClusterNetwork clusterNetworkResult = response.getResult(); - assertNotNull(clusterNetworkResult); + SecurityGroupRule securityGroupRuleResult = response.getResult(); + assertNotNull(securityGroupRuleResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10497,25 +11182,23 @@ public void testCreateClusterNetwork() throws Exception { } } - @Test(dependsOnMethods = { "testCreateClusterNetwork" }) - public void testListClusterNetworkInterfaces() throws Exception { + @Test(dependsOnMethods = { "testUpdateSecurityGroupRule" }) + public void testListSecurityGroupTargets() throws Exception { try { - ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptions = new ListClusterNetworkInterfacesOptions.Builder() - .clusterNetworkId("testString") + ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() + .securityGroupId("testString") .start("testString") .limit(Long.valueOf("10")) - .name("my-name") - .sort("name") .build(); // Invoke operation - Response response = service.listClusterNetworkInterfaces(listClusterNetworkInterfacesOptions).execute(); + Response response = service.listSecurityGroupTargets(listSecurityGroupTargetsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkInterfaceCollection clusterNetworkInterfaceCollectionResult = response.getResult(); - assertNotNull(clusterNetworkInterfaceCollectionResult); + SecurityGroupTargetCollection securityGroupTargetCollectionResult = response.getResult(); + assertNotNull(securityGroupTargetCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10523,29 +11206,27 @@ public void testListClusterNetworkInterfaces() throws Exception { } } - @Test(dependsOnMethods = { "testListClusterNetworkInterfaces" }) - public void testListClusterNetworkInterfacesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListSecurityGroupTargets" }) + public void testListSecurityGroupTargetsWithPager() throws Exception { try { - ListClusterNetworkInterfacesOptions options = new ListClusterNetworkInterfacesOptions.Builder() - .clusterNetworkId("testString") + ListSecurityGroupTargetsOptions options = new ListSecurityGroupTargetsOptions.Builder() + .securityGroupId("testString") .limit(Long.valueOf("10")) - .name("my-name") - .sort("name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - ClusterNetworkInterfacesPager pager = new ClusterNetworkInterfacesPager(service, options); + List allResults = new ArrayList<>(); + SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new ClusterNetworkInterfacesPager(service, options); - List allItems = pager.getAll(); + pager = new SecurityGroupTargetsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -10557,57 +11238,22 @@ public void testListClusterNetworkInterfacesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListClusterNetworkInterfaces" }) - public void testCreateClusterNetworkInterface() throws Exception { - try { - ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") - .build(); - - ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() - .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") - .build(); - - CreateClusterNetworkInterfaceOptions createClusterNetworkInterfaceOptions = new CreateClusterNetworkInterfaceOptions.Builder() - .clusterNetworkId("testString") - .name("my-cluster-network-interface") - .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) - .subnet(clusterNetworkSubnetIdentityModel) - .build(); - - // Invoke operation - Response response = service.createClusterNetworkInterface(createClusterNetworkInterfaceOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - ClusterNetworkInterface clusterNetworkInterfaceResult = response.getResult(); - assertNotNull(clusterNetworkInterfaceResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateClusterNetworkInterface" }) - public void testGetClusterNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testListSecurityGroupTargets" }) + public void testGetSecurityGroupTarget() throws Exception { try { - GetClusterNetworkInterfaceOptions getClusterNetworkInterfaceOptions = new GetClusterNetworkInterfaceOptions.Builder() - .clusterNetworkId("testString") + GetSecurityGroupTargetOptions getSecurityGroupTargetOptions = new GetSecurityGroupTargetOptions.Builder() + .securityGroupId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getClusterNetworkInterface(getClusterNetworkInterfaceOptions).execute(); + Response response = service.getSecurityGroupTarget(getSecurityGroupTargetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkInterface clusterNetworkInterfaceResult = response.getResult(); - assertNotNull(clusterNetworkInterfaceResult); + SecurityGroupTargetReference securityGroupTargetReferenceResult = response.getResult(); + assertNotNull(securityGroupTargetReferenceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10615,30 +11261,22 @@ public void testGetClusterNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testGetClusterNetworkInterface" }) - public void testUpdateClusterNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testGetSecurityGroupTarget" }) + public void testCreateSecurityGroupTargetBinding() throws Exception { try { - ClusterNetworkInterfacePatch clusterNetworkInterfacePatchModel = new ClusterNetworkInterfacePatch.Builder() - .autoDelete(false) - .name("my-cluster-network-interface") - .build(); - Map clusterNetworkInterfacePatchModelAsPatch = clusterNetworkInterfacePatchModel.asPatch(); - - UpdateClusterNetworkInterfaceOptions updateClusterNetworkInterfaceOptions = new UpdateClusterNetworkInterfaceOptions.Builder() - .clusterNetworkId("testString") + CreateSecurityGroupTargetBindingOptions createSecurityGroupTargetBindingOptions = new CreateSecurityGroupTargetBindingOptions.Builder() + .securityGroupId("testString") .id("testString") - .clusterNetworkInterfacePatch(clusterNetworkInterfacePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updateClusterNetworkInterface(updateClusterNetworkInterfaceOptions).execute(); + Response response = service.createSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkInterface clusterNetworkInterfaceResult = response.getResult(); - assertNotNull(clusterNetworkInterfaceResult); + SecurityGroupTargetReference securityGroupTargetReferenceResult = response.getResult(); + assertNotNull(securityGroupTargetReferenceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10646,25 +11284,23 @@ public void testUpdateClusterNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateClusterNetworkInterface" }) - public void testListClusterNetworkSubnets() throws Exception { + @Test(dependsOnMethods = { "testCreateSecurityGroupTargetBinding" }) + public void testListShareProfiles() throws Exception { try { - ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptions = new ListClusterNetworkSubnetsOptions.Builder() - .clusterNetworkId("testString") + ListShareProfilesOptions listShareProfilesOptions = new ListShareProfilesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .name("my-name") .sort("name") .build(); // Invoke operation - Response response = service.listClusterNetworkSubnets(listClusterNetworkSubnetsOptions).execute(); + Response response = service.listShareProfiles(listShareProfilesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkSubnetCollection clusterNetworkSubnetCollectionResult = response.getResult(); - assertNotNull(clusterNetworkSubnetCollectionResult); + ShareProfileCollection shareProfileCollectionResult = response.getResult(); + assertNotNull(shareProfileCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10672,29 +11308,27 @@ public void testListClusterNetworkSubnets() throws Exception { } } - @Test(dependsOnMethods = { "testListClusterNetworkSubnets" }) - public void testListClusterNetworkSubnetsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListShareProfiles" }) + public void testListShareProfilesWithPager() throws Exception { try { - ListClusterNetworkSubnetsOptions options = new ListClusterNetworkSubnetsOptions.Builder() - .clusterNetworkId("testString") + ListShareProfilesOptions options = new ListShareProfilesOptions.Builder() .limit(Long.valueOf("10")) - .name("my-name") .sort("name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - ClusterNetworkSubnetsPager pager = new ClusterNetworkSubnetsPager(service, options); + List allResults = new ArrayList<>(); + ShareProfilesPager pager = new ShareProfilesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new ClusterNetworkSubnetsPager(service, options); - List allItems = pager.getAll(); + pager = new ShareProfilesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -10706,28 +11340,21 @@ public void testListClusterNetworkSubnetsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListClusterNetworkSubnets" }) - public void testCreateClusterNetworkSubnet() throws Exception { + @Test(dependsOnMethods = { "testListShareProfiles" }) + public void testGetShareProfile() throws Exception { try { - ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype clusterNetworkSubnetPrototypeModel = new ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype.Builder() - .ipVersion("ipv4") - .name("my-cluster-network-subnet") - .totalIpv4AddressCount(Long.valueOf("256")) - .build(); - - CreateClusterNetworkSubnetOptions createClusterNetworkSubnetOptions = new CreateClusterNetworkSubnetOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetPrototype(clusterNetworkSubnetPrototypeModel) + GetShareProfileOptions getShareProfileOptions = new GetShareProfileOptions.Builder() + .name("dp2") .build(); // Invoke operation - Response response = service.createClusterNetworkSubnet(createClusterNetworkSubnetOptions).execute(); + Response response = service.getShareProfile(getShareProfileOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - ClusterNetworkSubnet clusterNetworkSubnetResult = response.getResult(); - assertNotNull(clusterNetworkSubnetResult); + assertEquals(response.getStatusCode(), 200); + + ShareProfile shareProfileResult = response.getResult(); + assertNotNull(shareProfileResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10735,26 +11362,26 @@ public void testCreateClusterNetworkSubnet() throws Exception { } } - @Test(dependsOnMethods = { "testCreateClusterNetworkSubnet" }) - public void testListClusterNetworkSubnetReservedIps() throws Exception { + @Test(dependsOnMethods = { "testGetShareProfile" }) + public void testListShares() throws Exception { try { - ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptions = new ListClusterNetworkSubnetReservedIpsOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + ListSharesOptions listSharesOptions = new ListSharesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .resourceGroupId("testString") .name("my-name") .sort("name") + .replicationRole("none") .build(); // Invoke operation - Response response = service.listClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptions).execute(); + Response response = service.listShares(listSharesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkSubnetReservedIPCollection clusterNetworkSubnetReservedIpCollectionResult = response.getResult(); - assertNotNull(clusterNetworkSubnetReservedIpCollectionResult); + ShareCollection shareCollectionResult = response.getResult(); + assertNotNull(shareCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10762,30 +11389,30 @@ public void testListClusterNetworkSubnetReservedIps() throws Exception { } } - @Test(dependsOnMethods = { "testListClusterNetworkSubnetReservedIps" }) - public void testListClusterNetworkSubnetReservedIpsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListShares" }) + public void testListSharesWithPager() throws Exception { try { - ListClusterNetworkSubnetReservedIpsOptions options = new ListClusterNetworkSubnetReservedIpsOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + ListSharesOptions options = new ListSharesOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") .name("my-name") .sort("name") + .replicationRole("none") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - ClusterNetworkSubnetReservedIpsPager pager = new ClusterNetworkSubnetReservedIpsPager(service, options); + List allResults = new ArrayList<>(); + SharesPager pager = new SharesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new ClusterNetworkSubnetReservedIpsPager(service, options); - List allItems = pager.getAll(); + pager = new SharesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -10797,24 +11424,112 @@ public void testListClusterNetworkSubnetReservedIpsWithPager() throws Exception } } - @Test(dependsOnMethods = { "testListClusterNetworkSubnetReservedIps" }) - public void testCreateClusterNetworkSubnetReservedIp() throws Exception { + @Test(dependsOnMethods = { "testListShares" }) + public void testCreateShare() throws Exception { try { - CreateClusterNetworkSubnetReservedIpOptions createClusterNetworkSubnetReservedIpOptions = new CreateClusterNetworkSubnetReservedIpOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") - .address("192.168.3.4") - .name("my-cluster-network-subnet-reserved-ip") + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext shareMountTargetVirtualNetworkInterfacePrototypeModel = new ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") + .name("my-share-mount-target") + .transitEncryption("none") + .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) + .build(); + + ShareProfileIdentityByName shareProfileIdentityModel = new ShareProfileIdentityByName.Builder() + .name("tier-3iops") + .build(); + + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) + .iops(Long.valueOf("100")) + .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) + .name("my-share") + .profile(shareProfileIdentityModel) + .replicationCronSpec("0 */5 * * *") + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .zone(zoneIdentityModel) + .build(); + + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + + ShareInitialOwner shareInitialOwnerModel = new ShareInitialOwner.Builder() + .gid(Long.valueOf("50")) + .uid(Long.valueOf("50")) + .build(); + + SharePrototypeShareBySize sharePrototypeModel = new SharePrototypeShareBySize.Builder() + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) + .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) + .name("my-share") + .replicaShare(sharePrototypeShareContextModel) + .userTags(java.util.Arrays.asList()) + .accessControlMode("security_group") + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .bandwidth(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .initialOwner(shareInitialOwnerModel) + .iops(Long.valueOf("100")) + .profile(shareProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .size(Long.valueOf("200")) + .zone(zoneIdentityModel) + .build(); + + CreateShareOptions createShareOptions = new CreateShareOptions.Builder() + .sharePrototype(sharePrototypeModel) .build(); // Invoke operation - Response response = service.createClusterNetworkSubnetReservedIp(createClusterNetworkSubnetReservedIpOptions).execute(); + Response response = service.createShare(createShareOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - ClusterNetworkSubnetReservedIP clusterNetworkSubnetReservedIpResult = response.getResult(); - assertNotNull(clusterNetworkSubnetReservedIpResult); + Share shareResult = response.getResult(); + assertNotNull(shareResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10822,23 +11537,21 @@ public void testCreateClusterNetworkSubnetReservedIp() throws Exception { } } - @Test(dependsOnMethods = { "testCreateClusterNetworkSubnetReservedIp" }) - public void testGetClusterNetworkSubnetReservedIp() throws Exception { + @Test(dependsOnMethods = { "testCreateShare" }) + public void testGetShare() throws Exception { try { - GetClusterNetworkSubnetReservedIpOptions getClusterNetworkSubnetReservedIpOptions = new GetClusterNetworkSubnetReservedIpOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + GetShareOptions getShareOptions = new GetShareOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getClusterNetworkSubnetReservedIp(getClusterNetworkSubnetReservedIpOptions).execute(); + Response response = service.getShare(getShareOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkSubnetReservedIP clusterNetworkSubnetReservedIpResult = response.getResult(); - assertNotNull(clusterNetworkSubnetReservedIpResult); + Share shareResult = response.getResult(); + assertNotNull(shareResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10846,31 +11559,41 @@ public void testGetClusterNetworkSubnetReservedIp() throws Exception { } } - @Test(dependsOnMethods = { "testGetClusterNetworkSubnetReservedIp" }) - public void testUpdateClusterNetworkSubnetReservedIp() throws Exception { + @Test(dependsOnMethods = { "testGetShare" }) + public void testUpdateShare() throws Exception { try { - ClusterNetworkSubnetReservedIPPatch clusterNetworkSubnetReservedIpPatchModel = new ClusterNetworkSubnetReservedIPPatch.Builder() - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") + ShareProfileIdentityByName shareProfileIdentityModel = new ShareProfileIdentityByName.Builder() + .name("tier-3iops") .build(); - Map clusterNetworkSubnetReservedIpPatchModelAsPatch = clusterNetworkSubnetReservedIpPatchModel.asPatch(); - UpdateClusterNetworkSubnetReservedIpOptions updateClusterNetworkSubnetReservedIpOptions = new UpdateClusterNetworkSubnetReservedIpOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + SharePatch sharePatchModel = new SharePatch.Builder() + .accessControlMode("security_group") + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) + .bandwidth(Long.valueOf("1")) + .iops(Long.valueOf("100")) + .name("my-share") + .profile(shareProfileIdentityModel) + .replicationCronSpec("0 */5 * * *") + .size(Long.valueOf("8000")) + .userTags(java.util.Arrays.asList("testString")) + .build(); + Map sharePatchModelAsPatch = sharePatchModel.asPatch(); + + UpdateShareOptions updateShareOptions = new UpdateShareOptions.Builder() .id("testString") - .clusterNetworkSubnetReservedIpPatch(clusterNetworkSubnetReservedIpPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .sharePatch(sharePatchModelAsPatch) + .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") .build(); // Invoke operation - Response response = service.updateClusterNetworkSubnetReservedIp(updateClusterNetworkSubnetReservedIpOptions).execute(); + Response response = service.updateShare(updateShareOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkSubnetReservedIP clusterNetworkSubnetReservedIpResult = response.getResult(); - assertNotNull(clusterNetworkSubnetReservedIpResult); + Share shareResult = response.getResult(); + assertNotNull(shareResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10878,22 +11601,23 @@ public void testUpdateClusterNetworkSubnetReservedIp() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateClusterNetworkSubnetReservedIp" }) - public void testGetClusterNetworkSubnet() throws Exception { + @Test(dependsOnMethods = { "testUpdateShare" }) + public void testListShareAccessorBindings() throws Exception { try { - GetClusterNetworkSubnetOptions getClusterNetworkSubnetOptions = new GetClusterNetworkSubnetOptions.Builder() - .clusterNetworkId("testString") + ListShareAccessorBindingsOptions listShareAccessorBindingsOptions = new ListShareAccessorBindingsOptions.Builder() .id("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.getClusterNetworkSubnet(getClusterNetworkSubnetOptions).execute(); + Response response = service.listShareAccessorBindings(listShareAccessorBindingsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetworkSubnet clusterNetworkSubnetResult = response.getResult(); - assertNotNull(clusterNetworkSubnetResult); + ShareAccessorBindingCollection shareAccessorBindingCollectionResult = response.getResult(); + assertNotNull(shareAccessorBindingCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10901,51 +11625,54 @@ public void testGetClusterNetworkSubnet() throws Exception { } } - @Test(dependsOnMethods = { "testGetClusterNetworkSubnet" }) - public void testUpdateClusterNetworkSubnet() throws Exception { + @Test(dependsOnMethods = { "testListShareAccessorBindings" }) + public void testListShareAccessorBindingsWithPager() throws Exception { try { - ClusterNetworkSubnetPatch clusterNetworkSubnetPatchModel = new ClusterNetworkSubnetPatch.Builder() - .name("my-cluster-network-subnet") - .build(); - Map clusterNetworkSubnetPatchModelAsPatch = clusterNetworkSubnetPatchModel.asPatch(); - - UpdateClusterNetworkSubnetOptions updateClusterNetworkSubnetOptions = new UpdateClusterNetworkSubnetOptions.Builder() - .clusterNetworkId("testString") + ListShareAccessorBindingsOptions options = new ListShareAccessorBindingsOptions.Builder() .id("testString") - .clusterNetworkSubnetPatch(clusterNetworkSubnetPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.updateClusterNetworkSubnet(updateClusterNetworkSubnetOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + ShareAccessorBindingsPager pager = new ShareAccessorBindingsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - ClusterNetworkSubnet clusterNetworkSubnetResult = response.getResult(); - assertNotNull(clusterNetworkSubnetResult); + // Test getAll(); + pager = new ShareAccessorBindingsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateClusterNetworkSubnet" }) - public void testGetClusterNetwork() throws Exception { + @Test(dependsOnMethods = { "testListShareAccessorBindings" }) + public void testGetShareAccessorBinding() throws Exception { try { - GetClusterNetworkOptions getClusterNetworkOptions = new GetClusterNetworkOptions.Builder() + GetShareAccessorBindingOptions getShareAccessorBindingOptions = new GetShareAccessorBindingOptions.Builder() + .shareId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getClusterNetwork(getClusterNetworkOptions).execute(); + Response response = service.getShareAccessorBinding(getShareAccessorBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ClusterNetwork clusterNetworkResult = response.getResult(); - assertNotNull(clusterNetworkResult); + ShareAccessorBinding shareAccessorBindingResult = response.getResult(); + assertNotNull(shareAccessorBindingResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -10953,52 +11680,44 @@ public void testGetClusterNetwork() throws Exception { } } - @Test(dependsOnMethods = { "testGetClusterNetwork" }) - public void testUpdateClusterNetwork() throws Exception { + @Test(dependsOnMethods = { "testGetShareAccessorBinding" }) + public void testFailoverShare() throws Exception { try { - ClusterNetworkPatch clusterNetworkPatchModel = new ClusterNetworkPatch.Builder() - .name("my-cluster-network") - .build(); - Map clusterNetworkPatchModelAsPatch = clusterNetworkPatchModel.asPatch(); - - UpdateClusterNetworkOptions updateClusterNetworkOptions = new UpdateClusterNetworkOptions.Builder() - .id("testString") - .clusterNetworkPatch(clusterNetworkPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + FailoverShareOptions failoverShareOptions = new FailoverShareOptions.Builder() + .shareId("testString") + .fallbackPolicy("fail") + .timeout(Long.valueOf("600")) .build(); // Invoke operation - Response response = service.updateClusterNetwork(updateClusterNetworkOptions).execute(); + Response response = service.failoverShare(failoverShareOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - ClusterNetwork clusterNetworkResult = response.getResult(); - assertNotNull(clusterNetworkResult); - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateClusterNetwork" }) - public void testListPublicGateways() throws Exception { + @Test(dependsOnMethods = { "testFailoverShare" }) + public void testListShareMountTargets() throws Exception { try { - ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() + ListShareMountTargetsOptions listShareMountTargetsOptions = new ListShareMountTargetsOptions.Builder() + .shareId("testString") + .name("my-name") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .build(); // Invoke operation - Response response = service.listPublicGateways(listPublicGatewaysOptions).execute(); + Response response = service.listShareMountTargets(listShareMountTargetsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PublicGatewayCollection publicGatewayCollectionResult = response.getResult(); - assertNotNull(publicGatewayCollectionResult); + ShareMountTargetCollection shareMountTargetCollectionResult = response.getResult(); + assertNotNull(shareMountTargetCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11006,27 +11725,28 @@ public void testListPublicGateways() throws Exception { } } - @Test(dependsOnMethods = { "testListPublicGateways" }) - public void testListPublicGatewaysWithPager() throws Exception { + @Test(dependsOnMethods = { "testListShareMountTargets" }) + public void testListShareMountTargetsWithPager() throws Exception { try { - ListPublicGatewaysOptions options = new ListPublicGatewaysOptions.Builder() + ListShareMountTargetsOptions options = new ListShareMountTargetsOptions.Builder() + .shareId("testString") + .name("my-name") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - PublicGatewaysPager pager = new PublicGatewaysPager(service, options); + List allResults = new ArrayList<>(); + ShareMountTargetsPager pager = new ShareMountTargetsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new PublicGatewaysPager(service, options); - List allItems = pager.getAll(); + pager = new ShareMountTargetsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -11038,41 +11758,66 @@ public void testListPublicGatewaysWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListPublicGateways" }) - public void testCreatePublicGateway() throws Exception { + @Test(dependsOnMethods = { "testListShareMountTargets" }) + public void testCreateShareMountTarget() throws Exception { try { - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") .build(); - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById publicGatewayFloatingIpPrototypeModel = new PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.Builder() - .id("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd") + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - CreatePublicGatewayOptions createPublicGatewayOptions = new CreatePublicGatewayOptions.Builder() - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) - .floatingIp(publicGatewayFloatingIpPrototypeModel) - .name("my-public-gateway") + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext shareMountTargetVirtualNetworkInterfacePrototypeModel = new ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") + .name("my-share-mount-target") + .transitEncryption("none") + .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) + .build(); + + CreateShareMountTargetOptions createShareMountTargetOptions = new CreateShareMountTargetOptions.Builder() + .shareId("testString") + .shareMountTargetPrototype(shareMountTargetPrototypeModel) .build(); // Invoke operation - Response response = service.createPublicGateway(createPublicGatewayOptions).execute(); + Response response = service.createShareMountTarget(createShareMountTargetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - PublicGateway publicGatewayResult = response.getResult(); - assertNotNull(publicGatewayResult); + ShareMountTarget shareMountTargetResult = response.getResult(); + assertNotNull(shareMountTargetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11080,21 +11825,22 @@ public void testCreatePublicGateway() throws Exception { } } - @Test(dependsOnMethods = { "testCreatePublicGateway" }) - public void testGetPublicGateway() throws Exception { + @Test(dependsOnMethods = { "testCreateShareMountTarget" }) + public void testGetShareMountTarget() throws Exception { try { - GetPublicGatewayOptions getPublicGatewayOptions = new GetPublicGatewayOptions.Builder() + GetShareMountTargetOptions getShareMountTargetOptions = new GetShareMountTargetOptions.Builder() + .shareId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getPublicGateway(getPublicGatewayOptions).execute(); + Response response = service.getShareMountTarget(getShareMountTargetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PublicGateway publicGatewayResult = response.getResult(); - assertNotNull(publicGatewayResult); + ShareMountTarget shareMountTargetResult = response.getResult(); + assertNotNull(shareMountTargetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11102,27 +11848,28 @@ public void testGetPublicGateway() throws Exception { } } - @Test(dependsOnMethods = { "testGetPublicGateway" }) - public void testUpdatePublicGateway() throws Exception { + @Test(dependsOnMethods = { "testGetShareMountTarget" }) + public void testUpdateShareMountTarget() throws Exception { try { - PublicGatewayPatch publicGatewayPatchModel = new PublicGatewayPatch.Builder() - .name("my-public-gateway-updated") + ShareMountTargetPatch shareMountTargetPatchModel = new ShareMountTargetPatch.Builder() + .name("my-share-mount-target") .build(); - Map publicGatewayPatchModelAsPatch = publicGatewayPatchModel.asPatch(); + Map shareMountTargetPatchModelAsPatch = shareMountTargetPatchModel.asPatch(); - UpdatePublicGatewayOptions updatePublicGatewayOptions = new UpdatePublicGatewayOptions.Builder() + UpdateShareMountTargetOptions updateShareMountTargetOptions = new UpdateShareMountTargetOptions.Builder() + .shareId("testString") .id("testString") - .publicGatewayPatch(publicGatewayPatchModelAsPatch) + .shareMountTargetPatch(shareMountTargetPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updatePublicGateway(updatePublicGatewayOptions).execute(); + Response response = service.updateShareMountTarget(updateShareMountTargetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PublicGateway publicGatewayResult = response.getResult(); - assertNotNull(publicGatewayResult); + ShareMountTarget shareMountTargetResult = response.getResult(); + assertNotNull(shareMountTargetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11130,28 +11877,26 @@ public void testUpdatePublicGateway() throws Exception { } } - @Test(dependsOnMethods = { "testUpdatePublicGateway" }) - public void testListFloatingIps() throws Exception { + @Test(dependsOnMethods = { "testUpdateShareMountTarget" }) + public void testListShareSnapshots() throws Exception { try { - ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() + ListShareSnapshotsOptions listShareSnapshotsOptions = new ListShareSnapshotsOptions.Builder() + .shareId("testString") + .backupPolicyPlanId("testString") + .name("my-name") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); // Invoke operation - Response response = service.listFloatingIps(listFloatingIpsOptions).execute(); + Response response = service.listShareSnapshots(listShareSnapshotsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FloatingIPCollection floatingIpCollectionResult = response.getResult(); - assertNotNull(floatingIpCollectionResult); + ShareSnapshotCollection shareSnapshotCollectionResult = response.getResult(); + assertNotNull(shareSnapshotCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11159,32 +11904,30 @@ public void testListFloatingIps() throws Exception { } } - @Test(dependsOnMethods = { "testListFloatingIps" }) - public void testListFloatingIpsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListShareSnapshots" }) + public void testListShareSnapshotsWithPager() throws Exception { try { - ListFloatingIpsOptions options = new ListFloatingIpsOptions.Builder() + ListShareSnapshotsOptions options = new ListShareSnapshotsOptions.Builder() + .shareId("testString") + .backupPolicyPlanId("testString") + .name("my-name") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - FloatingIpsPager pager = new FloatingIpsPager(service, options); + List allResults = new ArrayList<>(); + ShareSnapshotsPager pager = new ShareSnapshotsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new FloatingIpsPager(service, options); - List allItems = pager.getAll(); + pager = new ShareSnapshotsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -11196,35 +11939,46 @@ public void testListFloatingIpsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListFloatingIps" }) - public void testCreateFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testListShareSnapshots" }) + public void testCreateShareSnapshot() throws Exception { try { - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + CreateShareSnapshotOptions createShareSnapshotOptions = new CreateShareSnapshotOptions.Builder() + .shareId("testString") + .name("my-share-snapshot") + .userTags(java.util.Arrays.asList("testString")) .build(); - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById floatingIpTargetPrototypeModel = new FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.Builder() - .id("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef") - .build(); + // Invoke operation + Response response = service.createShareSnapshot(createShareSnapshotOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); - FloatingIPPrototypeFloatingIPByTarget floatingIpPrototypeModel = new FloatingIPPrototypeFloatingIPByTarget.Builder() - .name("my-floating-ip") - .resourceGroup(resourceGroupIdentityModel) - .target(floatingIpTargetPrototypeModel) - .build(); + ShareSnapshot shareSnapshotResult = response.getResult(); + assertNotNull(shareSnapshotResult); - CreateFloatingIpOptions createFloatingIpOptions = new CreateFloatingIpOptions.Builder() - .floatingIpPrototype(floatingIpPrototypeModel) + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateShareSnapshot" }) + public void testGetShareSnapshot() throws Exception { + try { + GetShareSnapshotOptions getShareSnapshotOptions = new GetShareSnapshotOptions.Builder() + .shareId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.createFloatingIp(createFloatingIpOptions).execute(); + Response response = service.getShareSnapshot(getShareSnapshotOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - FloatingIP floatingIpResult = response.getResult(); - assertNotNull(floatingIpResult); + ShareSnapshot shareSnapshotResult = response.getResult(); + assertNotNull(shareSnapshotResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11232,21 +11986,30 @@ public void testCreateFloatingIp() throws Exception { } } - @Test(dependsOnMethods = { "testCreateFloatingIp" }) - public void testGetFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testGetShareSnapshot" }) + public void testUpdateShareSnapshot() throws Exception { try { - GetFloatingIpOptions getFloatingIpOptions = new GetFloatingIpOptions.Builder() + ShareSnapshotPatch shareSnapshotPatchModel = new ShareSnapshotPatch.Builder() + .name("my-share-snapshot") + .userTags(java.util.Arrays.asList("testString")) + .build(); + Map shareSnapshotPatchModelAsPatch = shareSnapshotPatchModel.asPatch(); + + UpdateShareSnapshotOptions updateShareSnapshotOptions = new UpdateShareSnapshotOptions.Builder() + .shareId("testString") .id("testString") + .shareSnapshotPatch(shareSnapshotPatchModelAsPatch) + .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") .build(); // Invoke operation - Response response = service.getFloatingIp(getFloatingIpOptions).execute(); + Response response = service.updateShareSnapshot(updateShareSnapshotOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FloatingIP floatingIpResult = response.getResult(); - assertNotNull(floatingIpResult); + ShareSnapshot shareSnapshotResult = response.getResult(); + assertNotNull(shareSnapshotResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11254,32 +12017,21 @@ public void testGetFloatingIp() throws Exception { } } - @Test(dependsOnMethods = { "testGetFloatingIp" }) - public void testUpdateFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testUpdateShareSnapshot" }) + public void testGetShareSource() throws Exception { try { - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById floatingIpTargetPatchModel = new FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.Builder() - .id("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6") - .build(); - - FloatingIPPatch floatingIpPatchModel = new FloatingIPPatch.Builder() - .name("my-floating-ip") - .target(floatingIpTargetPatchModel) - .build(); - Map floatingIpPatchModelAsPatch = floatingIpPatchModel.asPatch(); - - UpdateFloatingIpOptions updateFloatingIpOptions = new UpdateFloatingIpOptions.Builder() - .id("testString") - .floatingIpPatch(floatingIpPatchModelAsPatch) + GetShareSourceOptions getShareSourceOptions = new GetShareSourceOptions.Builder() + .shareId("testString") .build(); // Invoke operation - Response response = service.updateFloatingIp(updateFloatingIpOptions).execute(); + Response response = service.getShareSource(getShareSourceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FloatingIP floatingIpResult = response.getResult(); - assertNotNull(floatingIpResult); + ShareReference shareReferenceResult = response.getResult(); + assertNotNull(shareReferenceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11287,23 +12039,26 @@ public void testUpdateFloatingIp() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateFloatingIp" }) - public void testListPublicAddressRanges() throws Exception { + @Test(dependsOnMethods = { "testGetShareSource" }) + public void testListSnapshotConsistencyGroups() throws Exception { try { - ListPublicAddressRangesOptions listPublicAddressRangesOptions = new ListPublicAddressRangesOptions.Builder() + ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptions = new ListSnapshotConsistencyGroupsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .name("my-name") + .sort("name") + .backupPolicyPlanId("testString") .build(); // Invoke operation - Response response = service.listPublicAddressRanges(listPublicAddressRangesOptions).execute(); + Response response = service.listSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PublicAddressRangeCollection publicAddressRangeCollectionResult = response.getResult(); - assertNotNull(publicAddressRangeCollectionResult); + SnapshotConsistencyGroupCollection snapshotConsistencyGroupCollectionResult = response.getResult(); + assertNotNull(snapshotConsistencyGroupCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11311,27 +12066,30 @@ public void testListPublicAddressRanges() throws Exception { } } - @Test(dependsOnMethods = { "testListPublicAddressRanges" }) - public void testListPublicAddressRangesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListSnapshotConsistencyGroups" }) + public void testListSnapshotConsistencyGroupsWithPager() throws Exception { try { - ListPublicAddressRangesOptions options = new ListPublicAddressRangesOptions.Builder() + ListSnapshotConsistencyGroupsOptions options = new ListSnapshotConsistencyGroupsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") + .name("my-name") + .sort("name") + .backupPolicyPlanId("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - PublicAddressRangesPager pager = new PublicAddressRangesPager(service, options); + List allResults = new ArrayList<>(); + SnapshotConsistencyGroupsPager pager = new SnapshotConsistencyGroupsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new PublicAddressRangesPager(service, options); - List allItems = pager.getAll(); + pager = new SnapshotConsistencyGroupsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -11343,41 +12101,42 @@ public void testListPublicAddressRangesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListPublicAddressRanges" }) - public void testCreatePublicAddressRange() throws Exception { + @Test(dependsOnMethods = { "testListSnapshotConsistencyGroups" }) + public void testCreateSnapshotConsistencyGroup() throws Exception { try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() + .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + SnapshotPrototypeSnapshotConsistencyGroupContext snapshotPrototypeSnapshotConsistencyGroupContextModel = new SnapshotPrototypeSnapshotConsistencyGroupContext.Builder() + .name("my-snapshot") + .sourceVolume(volumeIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); - PublicAddressRangeTargetPrototype publicAddressRangeTargetPrototypeModel = new PublicAddressRangeTargetPrototype.Builder() - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) + SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots snapshotConsistencyGroupPrototypeModel = new SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots.Builder() + .deleteSnapshotsOnDelete(true) + .name("my-snapshot-consistency-group") + .resourceGroup(resourceGroupIdentityModel) + .snapshots(java.util.Arrays.asList(snapshotPrototypeSnapshotConsistencyGroupContextModel)) .build(); - CreatePublicAddressRangeOptions createPublicAddressRangeOptions = new CreatePublicAddressRangeOptions.Builder() - .ipv4AddressCount(Long.valueOf("8")) - .name("my-public-address-range") - .resourceGroup(resourceGroupIdentityModel) - .target(publicAddressRangeTargetPrototypeModel) + CreateSnapshotConsistencyGroupOptions createSnapshotConsistencyGroupOptions = new CreateSnapshotConsistencyGroupOptions.Builder() + .snapshotConsistencyGroupPrototype(snapshotConsistencyGroupPrototypeModel) .build(); // Invoke operation - Response response = service.createPublicAddressRange(createPublicAddressRangeOptions).execute(); + Response response = service.createSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - PublicAddressRange publicAddressRangeResult = response.getResult(); - assertNotNull(publicAddressRangeResult); + SnapshotConsistencyGroup snapshotConsistencyGroupResult = response.getResult(); + assertNotNull(snapshotConsistencyGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11385,21 +12144,21 @@ public void testCreatePublicAddressRange() throws Exception { } } - @Test(dependsOnMethods = { "testCreatePublicAddressRange" }) - public void testGetPublicAddressRange() throws Exception { + @Test(dependsOnMethods = { "testCreateSnapshotConsistencyGroup" }) + public void testGetSnapshotConsistencyGroup() throws Exception { try { - GetPublicAddressRangeOptions getPublicAddressRangeOptions = new GetPublicAddressRangeOptions.Builder() + GetSnapshotConsistencyGroupOptions getSnapshotConsistencyGroupOptions = new GetSnapshotConsistencyGroupOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getPublicAddressRange(getPublicAddressRangeOptions).execute(); + Response response = service.getSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PublicAddressRange publicAddressRangeResult = response.getResult(); - assertNotNull(publicAddressRangeResult); + SnapshotConsistencyGroup snapshotConsistencyGroupResult = response.getResult(); + assertNotNull(snapshotConsistencyGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11407,41 +12166,29 @@ public void testGetPublicAddressRange() throws Exception { } } - @Test(dependsOnMethods = { "testGetPublicAddressRange" }) - public void testUpdatePublicAddressRange() throws Exception { + @Test(dependsOnMethods = { "testGetSnapshotConsistencyGroup" }) + public void testUpdateSnapshotConsistencyGroup() throws Exception { try { - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - PublicAddressRangeTargetPatch publicAddressRangeTargetPatchModel = new PublicAddressRangeTargetPatch.Builder() - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) - .build(); - - PublicAddressRangePatch publicAddressRangePatchModel = new PublicAddressRangePatch.Builder() - .name("my-public-address-range-updated") - .target(publicAddressRangeTargetPatchModel) + SnapshotConsistencyGroupPatch snapshotConsistencyGroupPatchModel = new SnapshotConsistencyGroupPatch.Builder() + .deleteSnapshotsOnDelete(false) + .name("my-snapshot-consistency-group") .build(); - Map publicAddressRangePatchModelAsPatch = publicAddressRangePatchModel.asPatch(); + Map snapshotConsistencyGroupPatchModelAsPatch = snapshotConsistencyGroupPatchModel.asPatch(); - UpdatePublicAddressRangeOptions updatePublicAddressRangeOptions = new UpdatePublicAddressRangeOptions.Builder() + UpdateSnapshotConsistencyGroupOptions updateSnapshotConsistencyGroupOptions = new UpdateSnapshotConsistencyGroupOptions.Builder() .id("testString") - .publicAddressRangePatch(publicAddressRangePatchModelAsPatch) + .snapshotConsistencyGroupPatch(snapshotConsistencyGroupPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updatePublicAddressRange(updatePublicAddressRangeOptions).execute(); + Response response = service.updateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PublicAddressRange publicAddressRangeResult = response.getResult(); - assertNotNull(publicAddressRangeResult); + SnapshotConsistencyGroup snapshotConsistencyGroupResult = response.getResult(); + assertNotNull(snapshotConsistencyGroupResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11449,23 +12196,42 @@ public void testUpdatePublicAddressRange() throws Exception { } } - @Test(dependsOnMethods = { "testUpdatePublicAddressRange" }) - public void testListNetworkAcls() throws Exception { + @Test(dependsOnMethods = { "testUpdateSnapshotConsistencyGroup" }) + public void testListSnapshots() throws Exception { try { - ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() + ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .tag("testString") .resourceGroupId("testString") + .name("my-name") + .sourceVolumeId("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .sourceImageId("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .sort("name") + .backupPolicyPlanId("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-east") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") + .snapshotConsistencyGroupId("testString") + .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") .build(); // Invoke operation - Response response = service.listNetworkAcls(listNetworkAclsOptions).execute(); + Response response = service.listSnapshots(listSnapshotsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - NetworkACLCollection networkAclCollectionResult = response.getResult(); - assertNotNull(networkAclCollectionResult); + SnapshotCollection snapshotCollectionResult = response.getResult(); + assertNotNull(snapshotCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11473,27 +12239,46 @@ public void testListNetworkAcls() throws Exception { } } - @Test(dependsOnMethods = { "testListNetworkAcls" }) - public void testListNetworkAclsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListSnapshots" }) + public void testListSnapshotsWithPager() throws Exception { try { - ListNetworkAclsOptions options = new ListNetworkAclsOptions.Builder() + ListSnapshotsOptions options = new ListSnapshotsOptions.Builder() .limit(Long.valueOf("10")) + .tag("testString") .resourceGroupId("testString") + .name("my-name") + .sourceVolumeId("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .sourceImageId("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .sort("name") + .backupPolicyPlanId("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-east") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") + .snapshotConsistencyGroupId("testString") + .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - NetworkAclsPager pager = new NetworkAclsPager(service, options); + List allResults = new ArrayList<>(); + SnapshotsPager pager = new SnapshotsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new NetworkAclsPager(service, options); - List allItems = pager.getAll(); + pager = new SnapshotsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -11505,46 +12290,52 @@ public void testListNetworkAclsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListNetworkAcls" }) - public void testCreateNetworkAcl() throws Exception { + @Test(dependsOnMethods = { "testListSnapshots" }) + public void testCreateSnapshot() throws Exception { try { - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + SnapshotAllowedUsePrototype snapshotAllowedUsePrototypeModel = new SnapshotAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Builder() - .action("allow") - .destination("192.168.3.2/32") - .direction("inbound") - .ipVersion("ipv4") - .name("my-network-acl-rule") - .source("192.168.3.2/32") - .protocol("all") + SnapshotClonePrototype snapshotClonePrototypeModel = new SnapshotClonePrototype.Builder() + .zone(zoneIdentityModel) .build(); - NetworkACLPrototypeNetworkACLByRules networkAclPrototypeModel = new NetworkACLPrototypeNetworkACLByRules.Builder() - .name("my-network-acl") - .resourceGroup(resourceGroupIdentityModel) - .vpc(vpcIdentityModel) - .rules(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)) + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - CreateNetworkAclOptions createNetworkAclOptions = new CreateNetworkAclOptions.Builder() - .networkAclPrototype(networkAclPrototypeModel) + VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() + .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); + + SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() + .allowedUse(snapshotAllowedUsePrototypeModel) + .clones(java.util.Arrays.asList(snapshotClonePrototypeModel)) + .name("my-snapshot") + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .sourceVolume(volumeIdentityModel) + .build(); + + CreateSnapshotOptions createSnapshotOptions = new CreateSnapshotOptions.Builder() + .snapshotPrototype(snapshotPrototypeModel) .build(); // Invoke operation - Response response = service.createNetworkAcl(createNetworkAclOptions).execute(); + Response response = service.createSnapshot(createSnapshotOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - NetworkACL networkAclResult = response.getResult(); - assertNotNull(networkAclResult); + Snapshot snapshotResult = response.getResult(); + assertNotNull(snapshotResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11552,21 +12343,21 @@ public void testCreateNetworkAcl() throws Exception { } } - @Test(dependsOnMethods = { "testCreateNetworkAcl" }) - public void testGetNetworkAcl() throws Exception { + @Test(dependsOnMethods = { "testCreateSnapshot" }) + public void testGetSnapshot() throws Exception { try { - GetNetworkAclOptions getNetworkAclOptions = new GetNetworkAclOptions.Builder() + GetSnapshotOptions getSnapshotOptions = new GetSnapshotOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getNetworkAcl(getNetworkAclOptions).execute(); + Response response = service.getSnapshot(getSnapshotOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - NetworkACL networkAclResult = response.getResult(); - assertNotNull(networkAclResult); + Snapshot snapshotResult = response.getResult(); + assertNotNull(snapshotResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11574,27 +12365,36 @@ public void testGetNetworkAcl() throws Exception { } } - @Test(dependsOnMethods = { "testGetNetworkAcl" }) - public void testUpdateNetworkAcl() throws Exception { + @Test(dependsOnMethods = { "testGetSnapshot" }) + public void testUpdateSnapshot() throws Exception { try { - NetworkACLPatch networkAclPatchModel = new NetworkACLPatch.Builder() - .name("my-network-acl-updated") + SnapshotAllowedUsePatch snapshotAllowedUsePatchModel = new SnapshotAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - Map networkAclPatchModelAsPatch = networkAclPatchModel.asPatch(); - UpdateNetworkAclOptions updateNetworkAclOptions = new UpdateNetworkAclOptions.Builder() + SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() + .allowedUse(snapshotAllowedUsePatchModel) + .name("my-snapshot-updated") + .userTags(java.util.Arrays.asList("testString")) + .build(); + Map snapshotPatchModelAsPatch = snapshotPatchModel.asPatch(); + + UpdateSnapshotOptions updateSnapshotOptions = new UpdateSnapshotOptions.Builder() .id("testString") - .networkAclPatch(networkAclPatchModelAsPatch) + .snapshotPatch(snapshotPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updateNetworkAcl(updateNetworkAclOptions).execute(); + Response response = service.updateSnapshot(updateSnapshotOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - NetworkACL networkAclResult = response.getResult(); - assertNotNull(networkAclResult); + Snapshot snapshotResult = response.getResult(); + assertNotNull(snapshotResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11602,24 +12402,21 @@ public void testUpdateNetworkAcl() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateNetworkAcl" }) - public void testListNetworkAclRules() throws Exception { + @Test(dependsOnMethods = { "testUpdateSnapshot" }) + public void testListSnapshotClones() throws Exception { try { - ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() - .networkAclId("testString") - .start("testString") - .limit(Long.valueOf("10")) - .direction("inbound") + ListSnapshotClonesOptions listSnapshotClonesOptions = new ListSnapshotClonesOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listNetworkAclRules(listNetworkAclRulesOptions).execute(); + Response response = service.listSnapshotClones(listSnapshotClonesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - NetworkACLRuleCollection networkAclRuleCollectionResult = response.getResult(); - assertNotNull(networkAclRuleCollectionResult); + SnapshotCloneCollection snapshotCloneCollectionResult = response.getResult(); + assertNotNull(snapshotCloneCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11627,70 +12424,45 @@ public void testListNetworkAclRules() throws Exception { } } - @Test(dependsOnMethods = { "testListNetworkAclRules" }) - public void testListNetworkAclRulesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListSnapshotClones" }) + public void testGetSnapshotClone() throws Exception { try { - ListNetworkAclRulesOptions options = new ListNetworkAclRulesOptions.Builder() - .networkAclId("testString") - .limit(Long.valueOf("10")) - .direction("inbound") + GetSnapshotCloneOptions getSnapshotCloneOptions = new GetSnapshotCloneOptions.Builder() + .id("testString") + .zoneName("us-south-1") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - NetworkAclRulesPager pager = new NetworkAclRulesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + // Invoke operation + Response response = service.getSnapshotClone(getSnapshotCloneOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - // Test getAll(); - pager = new NetworkAclRulesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + SnapshotClone snapshotCloneResult = response.getResult(); + assertNotNull(snapshotCloneResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListNetworkAclRules" }) - public void testCreateNetworkAclRule() throws Exception { + @Test(dependsOnMethods = { "testGetSnapshotClone" }) + public void testCreateSnapshotClone() throws Exception { try { - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() - .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") - .build(); - - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Builder() - .action("allow") - .before(networkAclRuleBeforePrototypeModel) - .destination("192.168.3.2/32") - .direction("inbound") - .ipVersion("ipv4") - .name("my-network-acl-rule") - .source("192.168.3.2/32") - .protocol("all") - .build(); - - CreateNetworkAclRuleOptions createNetworkAclRuleOptions = new CreateNetworkAclRuleOptions.Builder() - .networkAclId("testString") - .networkAclRulePrototype(networkAclRulePrototypeModel) + CreateSnapshotCloneOptions createSnapshotCloneOptions = new CreateSnapshotCloneOptions.Builder() + .id("testString") + .zoneName("us-south-1") .build(); // Invoke operation - Response response = service.createNetworkAclRule(createNetworkAclRuleOptions).execute(); + Response response = service.createSnapshotClone(createSnapshotCloneOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - NetworkACLRule networkAclRuleResult = response.getResult(); - assertNotNull(networkAclRuleResult); + SnapshotClone snapshotCloneResult = response.getResult(); + assertNotNull(snapshotCloneResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11698,22 +12470,23 @@ public void testCreateNetworkAclRule() throws Exception { } } - @Test(dependsOnMethods = { "testCreateNetworkAclRule" }) - public void testGetNetworkAclRule() throws Exception { + @Test(dependsOnMethods = { "testCreateSnapshotClone" }) + public void testListSnapshotInstanceProfiles() throws Exception { try { - GetNetworkAclRuleOptions getNetworkAclRuleOptions = new GetNetworkAclRuleOptions.Builder() - .networkAclId("testString") + ListSnapshotInstanceProfilesOptions listSnapshotInstanceProfilesOptions = new ListSnapshotInstanceProfilesOptions.Builder() .id("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.getNetworkAclRule(getNetworkAclRuleOptions).execute(); + Response response = service.listSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - NetworkACLRule networkAclRuleResult = response.getResult(); - assertNotNull(networkAclRuleResult); + SnapshotInstanceProfileCollection snapshotInstanceProfileCollectionResult = response.getResult(); + assertNotNull(snapshotInstanceProfileCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11721,70 +12494,61 @@ public void testGetNetworkAclRule() throws Exception { } } - @Test(dependsOnMethods = { "testGetNetworkAclRule" }) - public void testUpdateNetworkAclRule() throws Exception { + @Test(dependsOnMethods = { "testListSnapshotInstanceProfiles" }) + public void testListSnapshotInstanceProfilesWithPager() throws Exception { try { - NetworkACLRuleBeforePatchNetworkACLRuleIdentityById networkAclRuleBeforePatchModel = new NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.Builder() - .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") - .build(); - - NetworkACLRulePatch networkAclRulePatchModel = new NetworkACLRulePatch.Builder() - .action("allow") - .before(networkAclRuleBeforePatchModel) - .code(Long.valueOf("0")) - .destination("192.168.3.2/32") - .destinationPortMax(Long.valueOf("22")) - .destinationPortMin(Long.valueOf("22")) - .direction("inbound") - .name("my-network-acl-rule") - .source("10.0.0.0/0") - .sourcePortMax(Long.valueOf("65535")) - .sourcePortMin(Long.valueOf("49152")) - .type(Long.valueOf("8")) - .build(); - Map networkAclRulePatchModelAsPatch = networkAclRulePatchModel.asPatch(); - - UpdateNetworkAclRuleOptions updateNetworkAclRuleOptions = new UpdateNetworkAclRuleOptions.Builder() - .networkAclId("testString") + ListSnapshotInstanceProfilesOptions options = new ListSnapshotInstanceProfilesOptions.Builder() .id("testString") - .networkAclRulePatch(networkAclRulePatchModelAsPatch) + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.updateNetworkAclRule(updateNetworkAclRuleOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + SnapshotInstanceProfilesPager pager = new SnapshotInstanceProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - NetworkACLRule networkAclRuleResult = response.getResult(); - assertNotNull(networkAclRuleResult); + // Test getAll(); + pager = new SnapshotInstanceProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateNetworkAclRule" }) - public void testListSecurityGroups() throws Exception { + @Test(dependsOnMethods = { "testListSnapshotInstanceProfiles" }) + public void testListSubnets() throws Exception { try { - ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() + ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") + .routingTableId("testString") + .routingTableName("my-routing-table") .build(); // Invoke operation - Response response = service.listSecurityGroups(listSecurityGroupsOptions).execute(); + Response response = service.listSubnets(listSubnetsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SecurityGroupCollection securityGroupCollectionResult = response.getResult(); - assertNotNull(securityGroupCollectionResult); + SubnetCollection subnetCollectionResult = response.getResult(); + assertNotNull(subnetCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11792,30 +12556,33 @@ public void testListSecurityGroups() throws Exception { } } - @Test(dependsOnMethods = { "testListSecurityGroups" }) - public void testListSecurityGroupsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListSubnets" }) + public void testListSubnetsWithPager() throws Exception { try { - ListSecurityGroupsOptions options = new ListSecurityGroupsOptions.Builder() + ListSubnetsOptions options = new ListSubnetsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") + .routingTableId("testString") + .routingTableName("my-routing-table") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - SecurityGroupsPager pager = new SecurityGroupsPager(service, options); + List allResults = new ArrayList<>(); + SubnetsPager pager = new SubnetsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new SecurityGroupsPager(service, options); - List allItems = pager.getAll(); + pager = new SubnetsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -11827,48 +12594,57 @@ public void testListSecurityGroupsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListSecurityGroups" }) - public void testCreateSecurityGroup() throws Exception { + @Test(dependsOnMethods = { "testListSubnets" }) + public void testCreateSubnet() throws Exception { try { - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() + .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") + .build(); + + PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() + .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() - .address("192.168.3.4") + RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") .build(); - SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() - .address("192.168.3.4") + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() - .direction("inbound") - .ipVersion("ipv4") - .local(securityGroupRuleLocalPrototypeModel) - .remote(securityGroupRuleRemotePrototypeModel) - .protocol("all") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - CreateSecurityGroupOptions createSecurityGroupOptions = new CreateSecurityGroupOptions.Builder() - .vpc(vpcIdentityModel) - .name("my-security-group") + SubnetPrototypeSubnetByTotalCount subnetPrototypeModel = new SubnetPrototypeSubnetByTotalCount.Builder() + .ipVersion("ipv4") + .name("my-subnet") + .networkAcl(networkAclIdentityModel) + .publicGateway(publicGatewayIdentityModel) .resourceGroup(resourceGroupIdentityModel) - .rules(java.util.Arrays.asList(securityGroupRulePrototypeModel)) + .routingTable(routingTableIdentityModel) + .vpc(vpcIdentityModel) + .totalIpv4AddressCount(Long.valueOf("256")) + .zone(zoneIdentityModel) + .build(); + + CreateSubnetOptions createSubnetOptions = new CreateSubnetOptions.Builder() + .subnetPrototype(subnetPrototypeModel) .build(); // Invoke operation - Response response = service.createSecurityGroup(createSecurityGroupOptions).execute(); + Response response = service.createSubnet(createSubnetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - SecurityGroup securityGroupResult = response.getResult(); - assertNotNull(securityGroupResult); + Subnet subnetResult = response.getResult(); + assertNotNull(subnetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11876,21 +12652,21 @@ public void testCreateSecurityGroup() throws Exception { } } - @Test(dependsOnMethods = { "testCreateSecurityGroup" }) - public void testGetSecurityGroup() throws Exception { + @Test(dependsOnMethods = { "testCreateSubnet" }) + public void testGetSubnet() throws Exception { try { - GetSecurityGroupOptions getSecurityGroupOptions = new GetSecurityGroupOptions.Builder() + GetSubnetOptions getSubnetOptions = new GetSubnetOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getSecurityGroup(getSecurityGroupOptions).execute(); + Response response = service.getSubnet(getSubnetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SecurityGroup securityGroupResult = response.getResult(); - assertNotNull(securityGroupResult); + Subnet subnetResult = response.getResult(); + assertNotNull(subnetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11898,27 +12674,42 @@ public void testGetSecurityGroup() throws Exception { } } - @Test(dependsOnMethods = { "testGetSecurityGroup" }) - public void testUpdateSecurityGroup() throws Exception { + @Test(dependsOnMethods = { "testGetSubnet" }) + public void testUpdateSubnet() throws Exception { try { - SecurityGroupPatch securityGroupPatchModel = new SecurityGroupPatch.Builder() - .name("my-security-group") + NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() + .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") .build(); - Map securityGroupPatchModelAsPatch = securityGroupPatchModel.asPatch(); - UpdateSecurityGroupOptions updateSecurityGroupOptions = new UpdateSecurityGroupOptions.Builder() + SubnetPublicGatewayPatchPublicGatewayIdentityById subnetPublicGatewayPatchModel = new SubnetPublicGatewayPatchPublicGatewayIdentityById.Builder() + .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") + .build(); + + RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") + .build(); + + SubnetPatch subnetPatchModel = new SubnetPatch.Builder() + .name("my-subnet") + .networkAcl(networkAclIdentityModel) + .publicGateway(subnetPublicGatewayPatchModel) + .routingTable(routingTableIdentityModel) + .build(); + Map subnetPatchModelAsPatch = subnetPatchModel.asPatch(); + + UpdateSubnetOptions updateSubnetOptions = new UpdateSubnetOptions.Builder() .id("testString") - .securityGroupPatch(securityGroupPatchModelAsPatch) + .subnetPatch(subnetPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateSecurityGroup(updateSecurityGroupOptions).execute(); + Response response = service.updateSubnet(updateSubnetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SecurityGroup securityGroupResult = response.getResult(); - assertNotNull(securityGroupResult); + Subnet subnetResult = response.getResult(); + assertNotNull(subnetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11926,21 +12717,21 @@ public void testUpdateSecurityGroup() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateSecurityGroup" }) - public void testListSecurityGroupRules() throws Exception { + @Test(dependsOnMethods = { "testUpdateSubnet" }) + public void testGetSubnetNetworkAcl() throws Exception { try { - ListSecurityGroupRulesOptions listSecurityGroupRulesOptions = new ListSecurityGroupRulesOptions.Builder() - .securityGroupId("testString") + GetSubnetNetworkAclOptions getSubnetNetworkAclOptions = new GetSubnetNetworkAclOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listSecurityGroupRules(listSecurityGroupRulesOptions).execute(); + Response response = service.getSubnetNetworkAcl(getSubnetNetworkAclOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SecurityGroupRuleCollection securityGroupRuleCollectionResult = response.getResult(); - assertNotNull(securityGroupRuleCollectionResult); + NetworkACL networkAclResult = response.getResult(); + assertNotNull(networkAclResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11948,38 +12739,26 @@ public void testListSecurityGroupRules() throws Exception { } } - @Test(dependsOnMethods = { "testListSecurityGroupRules" }) - public void testCreateSecurityGroupRule() throws Exception { + @Test(dependsOnMethods = { "testGetSubnetNetworkAcl" }) + public void testReplaceSubnetNetworkAcl() throws Exception { try { - SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() - .address("192.168.3.4") - .build(); - - SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() - .address("192.168.3.4") - .build(); - - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() - .direction("inbound") - .ipVersion("ipv4") - .local(securityGroupRuleLocalPrototypeModel) - .remote(securityGroupRuleRemotePrototypeModel) - .protocol("all") + NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() + .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") .build(); - CreateSecurityGroupRuleOptions createSecurityGroupRuleOptions = new CreateSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") - .securityGroupRulePrototype(securityGroupRulePrototypeModel) + ReplaceSubnetNetworkAclOptions replaceSubnetNetworkAclOptions = new ReplaceSubnetNetworkAclOptions.Builder() + .id("testString") + .networkAclIdentity(networkAclIdentityModel) .build(); // Invoke operation - Response response = service.createSecurityGroupRule(createSecurityGroupRuleOptions).execute(); + Response response = service.replaceSubnetNetworkAcl(replaceSubnetNetworkAclOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - SecurityGroupRule securityGroupRuleResult = response.getResult(); - assertNotNull(securityGroupRuleResult); + NetworkACL networkAclResult = response.getResult(); + assertNotNull(networkAclResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -11987,22 +12766,21 @@ public void testCreateSecurityGroupRule() throws Exception { } } - @Test(dependsOnMethods = { "testCreateSecurityGroupRule" }) - public void testGetSecurityGroupRule() throws Exception { + @Test(dependsOnMethods = { "testReplaceSubnetNetworkAcl" }) + public void testGetSubnetPublicGateway() throws Exception { try { - GetSecurityGroupRuleOptions getSecurityGroupRuleOptions = new GetSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") + GetSubnetPublicGatewayOptions getSubnetPublicGatewayOptions = new GetSubnetPublicGatewayOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getSecurityGroupRule(getSecurityGroupRuleOptions).execute(); + Response response = service.getSubnetPublicGateway(getSubnetPublicGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SecurityGroupRule securityGroupRuleResult = response.getResult(); - assertNotNull(securityGroupRuleResult); + PublicGateway publicGatewayResult = response.getResult(); + assertNotNull(publicGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12010,43 +12788,26 @@ public void testGetSecurityGroupRule() throws Exception { } } - @Test(dependsOnMethods = { "testGetSecurityGroupRule" }) - public void testUpdateSecurityGroupRule() throws Exception { + @Test(dependsOnMethods = { "testGetSubnetPublicGateway" }) + public void testSetSubnetPublicGateway() throws Exception { try { - SecurityGroupRuleLocalPatchIP securityGroupRuleLocalPatchModel = new SecurityGroupRuleLocalPatchIP.Builder() - .address("192.168.3.4") - .build(); - - SecurityGroupRuleRemotePatchCIDR securityGroupRuleRemotePatchModel = new SecurityGroupRuleRemotePatchCIDR.Builder() - .cidrBlock("10.0.0.0/8") - .build(); - - SecurityGroupRulePatch securityGroupRulePatchModel = new SecurityGroupRulePatch.Builder() - .code(Long.valueOf("0")) - .direction("inbound") - .ipVersion("ipv4") - .local(securityGroupRuleLocalPatchModel) - .portMax(Long.valueOf("22")) - .portMin(Long.valueOf("22")) - .remote(securityGroupRuleRemotePatchModel) - .type(Long.valueOf("8")) + PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() + .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") .build(); - Map securityGroupRulePatchModelAsPatch = securityGroupRulePatchModel.asPatch(); - UpdateSecurityGroupRuleOptions updateSecurityGroupRuleOptions = new UpdateSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") + SetSubnetPublicGatewayOptions setSubnetPublicGatewayOptions = new SetSubnetPublicGatewayOptions.Builder() .id("testString") - .securityGroupRulePatch(securityGroupRulePatchModelAsPatch) + .publicGatewayIdentity(publicGatewayIdentityModel) .build(); // Invoke operation - Response response = service.updateSecurityGroupRule(updateSecurityGroupRuleOptions).execute(); + Response response = service.setSubnetPublicGateway(setSubnetPublicGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - SecurityGroupRule securityGroupRuleResult = response.getResult(); - assertNotNull(securityGroupRuleResult); + PublicGateway publicGatewayResult = response.getResult(); + assertNotNull(publicGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12054,101 +12815,48 @@ public void testUpdateSecurityGroupRule() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateSecurityGroupRule" }) - public void testListSecurityGroupTargets() throws Exception { + @Test(dependsOnMethods = { "testSetSubnetPublicGateway" }) + public void testGetSubnetRoutingTable() throws Exception { try { - ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() - .securityGroupId("testString") - .start("testString") - .limit(Long.valueOf("10")) + GetSubnetRoutingTableOptions getSubnetRoutingTableOptions = new GetSubnetRoutingTableOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listSecurityGroupTargets(listSecurityGroupTargetsOptions).execute(); + Response response = service.getSubnetRoutingTable(getSubnetRoutingTableOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - SecurityGroupTargetCollection securityGroupTargetCollectionResult = response.getResult(); - assertNotNull(securityGroupTargetCollectionResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListSecurityGroupTargets" }) - public void testListSecurityGroupTargetsWithPager() throws Exception { - try { - ListSecurityGroupTargetsOptions options = new ListSecurityGroupTargetsOptions.Builder() - .securityGroupId("testString") - .limit(Long.valueOf("10")) - .build(); - - // Test getNext(). - List allResults = new ArrayList<>(); - SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); - - // Test getAll(); - pager = new SecurityGroupTargetsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + RoutingTable routingTableResult = response.getResult(); + assertNotNull(routingTableResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListSecurityGroupTargets" }) - public void testGetSecurityGroupTarget() throws Exception { + @Test(dependsOnMethods = { "testGetSubnetRoutingTable" }) + public void testReplaceSubnetRoutingTable() throws Exception { try { - GetSecurityGroupTargetOptions getSecurityGroupTargetOptions = new GetSecurityGroupTargetOptions.Builder() - .securityGroupId("testString") - .id("testString") + RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") .build(); - // Invoke operation - Response response = service.getSecurityGroupTarget(getSecurityGroupTargetOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - SecurityGroupTargetReference securityGroupTargetReferenceResult = response.getResult(); - assertNotNull(securityGroupTargetReferenceResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testGetSecurityGroupTarget" }) - public void testCreateSecurityGroupTargetBinding() throws Exception { - try { - CreateSecurityGroupTargetBindingOptions createSecurityGroupTargetBindingOptions = new CreateSecurityGroupTargetBindingOptions.Builder() - .securityGroupId("testString") + ReplaceSubnetRoutingTableOptions replaceSubnetRoutingTableOptions = new ReplaceSubnetRoutingTableOptions.Builder() .id("testString") + .routingTableIdentity(routingTableIdentityModel) .build(); // Invoke operation - Response response = service.createSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptions).execute(); + Response response = service.replaceSubnetRoutingTable(replaceSubnetRoutingTableOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - SecurityGroupTargetReference securityGroupTargetReferenceResult = response.getResult(); - assertNotNull(securityGroupTargetReferenceResult); + RoutingTable routingTableResult = response.getResult(); + assertNotNull(routingTableResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12156,49 +12864,61 @@ public void testCreateSecurityGroupTargetBinding() throws Exception { } } - @Test(dependsOnMethods = { "testCreateSecurityGroupTargetBinding" }) - public void testListIkePolicies() throws Exception { + @Test(dependsOnMethods = { "testReplaceSubnetRoutingTable" }) + public void testListSubnetReservedIps() throws Exception { try { - ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() + ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() + .subnetId("testString") .start("testString") .limit(Long.valueOf("10")) + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); // Invoke operation - Response response = service.listIkePolicies(listIkePoliciesOptions).execute(); + Response response = service.listSubnetReservedIps(listSubnetReservedIpsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - IKEPolicyCollection ikePolicyCollectionResult = response.getResult(); - assertNotNull(ikePolicyCollectionResult); + ReservedIPCollection reservedIpCollectionResult = response.getResult(); + assertNotNull(reservedIpCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - - @Test(dependsOnMethods = { "testListIkePolicies" }) - public void testListIkePoliciesWithPager() throws Exception { + + @Test(dependsOnMethods = { "testListSubnetReservedIps" }) + public void testListSubnetReservedIpsWithPager() throws Exception { try { - ListIkePoliciesOptions options = new ListIkePoliciesOptions.Builder() + ListSubnetReservedIpsOptions options = new ListSubnetReservedIpsOptions.Builder() + .subnetId("testString") .limit(Long.valueOf("10")) + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - IkePoliciesPager pager = new IkePoliciesPager(service, options); + List allResults = new ArrayList<>(); + SubnetReservedIpsPager pager = new SubnetReservedIpsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new IkePoliciesPager(service, options); - List allItems = pager.getAll(); + pager = new SubnetReservedIpsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -12210,31 +12930,29 @@ public void testListIkePoliciesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListIkePolicies" }) - public void testCreateIkePolicy() throws Exception { + @Test(dependsOnMethods = { "testListSubnetReservedIps" }) + public void testCreateSubnetReservedIp() throws Exception { try { - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById reservedIpTargetPrototypeModel = new ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.Builder() + .id("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0") .build(); - CreateIkePolicyOptions createIkePolicyOptions = new CreateIkePolicyOptions.Builder() - .authenticationAlgorithm("sha256") - .dhGroup(Long.valueOf("14")) - .encryptionAlgorithm("aes128") - .ikeVersion(Long.valueOf("1")) - .keyLifetime(Long.valueOf("28800")) - .name("my-ike-policy") - .resourceGroup(resourceGroupIdentityModel) + CreateSubnetReservedIpOptions createSubnetReservedIpOptions = new CreateSubnetReservedIpOptions.Builder() + .subnetId("testString") + .address("192.168.3.4") + .autoDelete(false) + .name("my-reserved-ip") + .target(reservedIpTargetPrototypeModel) .build(); // Invoke operation - Response response = service.createIkePolicy(createIkePolicyOptions).execute(); + Response response = service.createSubnetReservedIp(createSubnetReservedIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - IKEPolicy ikePolicyResult = response.getResult(); - assertNotNull(ikePolicyResult); + ReservedIP reservedIpResult = response.getResult(); + assertNotNull(reservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12242,21 +12960,22 @@ public void testCreateIkePolicy() throws Exception { } } - @Test(dependsOnMethods = { "testCreateIkePolicy" }) - public void testGetIkePolicy() throws Exception { + @Test(dependsOnMethods = { "testCreateSubnetReservedIp" }) + public void testGetSubnetReservedIp() throws Exception { try { - GetIkePolicyOptions getIkePolicyOptions = new GetIkePolicyOptions.Builder() + GetSubnetReservedIpOptions getSubnetReservedIpOptions = new GetSubnetReservedIpOptions.Builder() + .subnetId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getIkePolicy(getIkePolicyOptions).execute(); + Response response = service.getSubnetReservedIp(getSubnetReservedIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - IKEPolicy ikePolicyResult = response.getResult(); - assertNotNull(ikePolicyResult); + ReservedIP reservedIpResult = response.getResult(); + assertNotNull(reservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12264,32 +12983,29 @@ public void testGetIkePolicy() throws Exception { } } - @Test(dependsOnMethods = { "testGetIkePolicy" }) - public void testUpdateIkePolicy() throws Exception { + @Test(dependsOnMethods = { "testGetSubnetReservedIp" }) + public void testUpdateSubnetReservedIp() throws Exception { try { - IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() - .authenticationAlgorithm("sha256") - .dhGroup(Long.valueOf("14")) - .encryptionAlgorithm("aes128") - .ikeVersion(Long.valueOf("1")) - .keyLifetime(Long.valueOf("86400")) - .name("my-ike-policy") + ReservedIPPatch reservedIpPatchModel = new ReservedIPPatch.Builder() + .autoDelete(false) + .name("my-reserved-ip-updated") .build(); - Map ikePolicyPatchModelAsPatch = ikePolicyPatchModel.asPatch(); + Map reservedIpPatchModelAsPatch = reservedIpPatchModel.asPatch(); - UpdateIkePolicyOptions updateIkePolicyOptions = new UpdateIkePolicyOptions.Builder() + UpdateSubnetReservedIpOptions updateSubnetReservedIpOptions = new UpdateSubnetReservedIpOptions.Builder() + .subnetId("testString") .id("testString") - .ikePolicyPatch(ikePolicyPatchModelAsPatch) + .reservedIpPatch(reservedIpPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateIkePolicy(updateIkePolicyOptions).execute(); + Response response = service.updateSubnetReservedIp(updateSubnetReservedIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - IKEPolicy ikePolicyResult = response.getResult(); - assertNotNull(ikePolicyResult); + ReservedIP reservedIpResult = response.getResult(); + assertNotNull(reservedIpResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12297,23 +13013,23 @@ public void testUpdateIkePolicy() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateIkePolicy" }) - public void testListIkePolicyConnections() throws Exception { + @Test(dependsOnMethods = { "testUpdateSubnetReservedIp" }) + public void testListVirtualNetworkInterfaces() throws Exception { try { - ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions = new ListIkePolicyConnectionsOptions.Builder() - .id("testString") + ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptions = new ListVirtualNetworkInterfacesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); // Invoke operation - Response response = service.listIkePolicyConnections(listIkePolicyConnectionsOptions).execute(); + Response response = service.listVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - IKEPolicyConnectionCollection ikePolicyConnectionCollectionResult = response.getResult(); - assertNotNull(ikePolicyConnectionCollectionResult); + VirtualNetworkInterfaceCollection virtualNetworkInterfaceCollectionResult = response.getResult(); + assertNotNull(virtualNetworkInterfaceCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12321,27 +13037,27 @@ public void testListIkePolicyConnections() throws Exception { } } - @Test(dependsOnMethods = { "testListIkePolicyConnections" }) - public void testListIkePolicyConnectionsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVirtualNetworkInterfaces" }) + public void testListVirtualNetworkInterfacesWithPager() throws Exception { try { - ListIkePolicyConnectionsOptions options = new ListIkePolicyConnectionsOptions.Builder() - .id("testString") + ListVirtualNetworkInterfacesOptions options = new ListVirtualNetworkInterfacesOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - IkePolicyConnectionsPager pager = new IkePolicyConnectionsPager(service, options); + List allResults = new ArrayList<>(); + VirtualNetworkInterfacesPager pager = new VirtualNetworkInterfacesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new IkePolicyConnectionsPager(service, options); - List allItems = pager.getAll(); + pager = new VirtualNetworkInterfacesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -12353,84 +13069,50 @@ public void testListIkePolicyConnectionsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListIkePolicyConnections" }) - public void testListIpsecPolicies() throws Exception { + @Test(dependsOnMethods = { "testListVirtualNetworkInterfaces" }) + public void testCreateVirtualNetworkInterface() throws Exception { try { - ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) + VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.Builder() + .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") .build(); - // Invoke operation - Response response = service.listIpsecPolicies(listIpsecPoliciesOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - IPsecPolicyCollection iPsecPolicyCollectionResult = response.getResult(); - assertNotNull(iPsecPolicyCollectionResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListIpsecPolicies" }) - public void testListIpsecPoliciesWithPager() throws Exception { - try { - ListIpsecPoliciesOptions options = new ListIpsecPoliciesOptions.Builder() - .limit(Long.valueOf("10")) + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById.Builder() + .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - IpsecPoliciesPager pager = new IpsecPoliciesPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); - - // Test getAll(); - pager = new IpsecPoliciesPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); - - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListIpsecPolicies" }) - public void testCreateIpsecPolicy() throws Exception { - try { ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - CreateIpsecPolicyOptions createIpsecPolicyOptions = new CreateIpsecPolicyOptions.Builder() - .authenticationAlgorithm("disabled") - .encryptionAlgorithm("aes128") - .pfs("disabled") - .keyLifetime(Long.valueOf("3600")) - .name("my-ipsec-policy") + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793") + .build(); + + CreateVirtualNetworkInterfaceOptions createVirtualNetworkInterfaceOptions = new CreateVirtualNetworkInterfaceOptions.Builder() + .allowIpSpoofing(false) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) .build(); // Invoke operation - Response response = service.createIpsecPolicy(createIpsecPolicyOptions).execute(); + Response response = service.createVirtualNetworkInterface(createVirtualNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - IPsecPolicy iPsecPolicyResult = response.getResult(); - assertNotNull(iPsecPolicyResult); + VirtualNetworkInterface virtualNetworkInterfaceResult = response.getResult(); + assertNotNull(virtualNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12438,21 +13120,21 @@ public void testCreateIpsecPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testCreateIpsecPolicy" }) - public void testGetIpsecPolicy() throws Exception { + @Test(dependsOnMethods = { "testCreateVirtualNetworkInterface" }) + public void testGetVirtualNetworkInterface() throws Exception { try { - GetIpsecPolicyOptions getIpsecPolicyOptions = new GetIpsecPolicyOptions.Builder() + GetVirtualNetworkInterfaceOptions getVirtualNetworkInterfaceOptions = new GetVirtualNetworkInterfaceOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getIpsecPolicy(getIpsecPolicyOptions).execute(); + Response response = service.getVirtualNetworkInterface(getVirtualNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - IPsecPolicy iPsecPolicyResult = response.getResult(); - assertNotNull(iPsecPolicyResult); + VirtualNetworkInterface virtualNetworkInterfaceResult = response.getResult(); + assertNotNull(virtualNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12460,31 +13142,32 @@ public void testGetIpsecPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testGetIpsecPolicy" }) - public void testUpdateIpsecPolicy() throws Exception { + @Test(dependsOnMethods = { "testGetVirtualNetworkInterface" }) + public void testUpdateVirtualNetworkInterface() throws Exception { try { - IPsecPolicyPatch iPsecPolicyPatchModel = new IPsecPolicyPatch.Builder() - .authenticationAlgorithm("disabled") - .encryptionAlgorithm("aes128") - .keyLifetime(Long.valueOf("3600")) - .name("my-ipsec-policy") - .pfs("disabled") + VirtualNetworkInterfacePatch virtualNetworkInterfacePatchModel = new VirtualNetworkInterfacePatch.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .name("my-virtual-network-interface") + .protocolStateFilteringMode("auto") .build(); - Map iPsecPolicyPatchModelAsPatch = iPsecPolicyPatchModel.asPatch(); + Map virtualNetworkInterfacePatchModelAsPatch = virtualNetworkInterfacePatchModel.asPatch(); - UpdateIpsecPolicyOptions updateIpsecPolicyOptions = new UpdateIpsecPolicyOptions.Builder() + UpdateVirtualNetworkInterfaceOptions updateVirtualNetworkInterfaceOptions = new UpdateVirtualNetworkInterfaceOptions.Builder() .id("testString") - .iPsecPolicyPatch(iPsecPolicyPatchModelAsPatch) + .virtualNetworkInterfacePatch(virtualNetworkInterfacePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updateIpsecPolicy(updateIpsecPolicyOptions).execute(); + Response response = service.updateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - IPsecPolicy iPsecPolicyResult = response.getResult(); - assertNotNull(iPsecPolicyResult); + VirtualNetworkInterface virtualNetworkInterfaceResult = response.getResult(); + assertNotNull(virtualNetworkInterfaceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12492,23 +13175,24 @@ public void testUpdateIpsecPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateIpsecPolicy" }) - public void testListIpsecPolicyConnections() throws Exception { + @Test(dependsOnMethods = { "testUpdateVirtualNetworkInterface" }) + public void testListNetworkInterfaceFloatingIps() throws Exception { try { - ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions = new ListIpsecPolicyConnectionsOptions.Builder() - .id("testString") + ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptions = new ListNetworkInterfaceFloatingIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .start("testString") .limit(Long.valueOf("10")) + .sort("name") .build(); // Invoke operation - Response response = service.listIpsecPolicyConnections(listIpsecPolicyConnectionsOptions).execute(); + Response response = service.listNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - IPsecPolicyConnectionCollection iPsecPolicyConnectionCollectionResult = response.getResult(); - assertNotNull(iPsecPolicyConnectionCollectionResult); + FloatingIPCollectionVirtualNetworkInterfaceContext floatingIpCollectionVirtualNetworkInterfaceContextResult = response.getResult(); + assertNotNull(floatingIpCollectionVirtualNetworkInterfaceContextResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12516,27 +13200,28 @@ public void testListIpsecPolicyConnections() throws Exception { } } - @Test(dependsOnMethods = { "testListIpsecPolicyConnections" }) - public void testListIpsecPolicyConnectionsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListNetworkInterfaceFloatingIps" }) + public void testListNetworkInterfaceFloatingIpsWithPager() throws Exception { try { - ListIpsecPolicyConnectionsOptions options = new ListIpsecPolicyConnectionsOptions.Builder() - .id("testString") + ListNetworkInterfaceFloatingIpsOptions options = new ListNetworkInterfaceFloatingIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .limit(Long.valueOf("10")) + .sort("name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - IpsecPolicyConnectionsPager pager = new IpsecPolicyConnectionsPager(service, options); + List allResults = new ArrayList<>(); + NetworkInterfaceFloatingIpsPager pager = new NetworkInterfaceFloatingIpsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new IpsecPolicyConnectionsPager(service, options); - List allItems = pager.getAll(); + pager = new NetworkInterfaceFloatingIpsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -12548,25 +13233,70 @@ public void testListIpsecPolicyConnectionsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListIpsecPolicyConnections" }) - public void testListVpnGateways() throws Exception { + @Test(dependsOnMethods = { "testListNetworkInterfaceFloatingIps" }) + public void testGetNetworkInterfaceFloatingIp() throws Exception { try { - ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() + GetNetworkInterfaceFloatingIpOptions getNetworkInterfaceFloatingIpOptions = new GetNetworkInterfaceFloatingIpOptions.Builder() + .virtualNetworkInterfaceId("testString") + .id("testString") + .build(); + + // Invoke operation + Response response = service.getNetworkInterfaceFloatingIp(getNetworkInterfaceFloatingIpOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + FloatingIPReference floatingIpReferenceResult = response.getResult(); + assertNotNull(floatingIpReferenceResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetNetworkInterfaceFloatingIp" }) + public void testAddNetworkInterfaceFloatingIp() throws Exception { + try { + AddNetworkInterfaceFloatingIpOptions addNetworkInterfaceFloatingIpOptions = new AddNetworkInterfaceFloatingIpOptions.Builder() + .virtualNetworkInterfaceId("testString") + .id("testString") + .build(); + + // Invoke operation + Response response = service.addNetworkInterfaceFloatingIp(addNetworkInterfaceFloatingIpOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + FloatingIPReference floatingIpReferenceResult = response.getResult(); + assertNotNull(floatingIpReferenceResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testAddNetworkInterfaceFloatingIp" }) + public void testListVirtualNetworkInterfaceIps() throws Exception { + try { + ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptions = new ListVirtualNetworkInterfaceIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .sort("name") - .mode("policy") .build(); // Invoke operation - Response response = service.listVpnGateways(listVpnGatewaysOptions).execute(); + Response response = service.listVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNGatewayCollection vpnGatewayCollectionResult = response.getResult(); - assertNotNull(vpnGatewayCollectionResult); + ReservedIPCollectionVirtualNetworkInterfaceContext reservedIpCollectionVirtualNetworkInterfaceContextResult = response.getResult(); + assertNotNull(reservedIpCollectionVirtualNetworkInterfaceContextResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12574,29 +13304,28 @@ public void testListVpnGateways() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnGateways" }) - public void testListVpnGatewaysWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVirtualNetworkInterfaceIps" }) + public void testListVirtualNetworkInterfaceIpsWithPager() throws Exception { try { - ListVpnGatewaysOptions options = new ListVpnGatewaysOptions.Builder() + ListVirtualNetworkInterfaceIpsOptions options = new ListVirtualNetworkInterfaceIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .sort("name") - .mode("policy") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpnGatewaysPager pager = new VpnGatewaysPager(service, options); + List allResults = new ArrayList<>(); + VirtualNetworkInterfaceIpsPager pager = new VirtualNetworkInterfaceIpsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpnGatewaysPager(service, options); - List allItems = pager.getAll(); + pager = new VirtualNetworkInterfaceIpsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -12608,58 +13337,22 @@ public void testListVpnGatewaysWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnGateways" }) - public void testCreateVpnGateway() throws Exception { - try { - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - VPNGatewayPrototypeVPNGatewayRouteModePrototype vpnGatewayPrototypeModel = new VPNGatewayPrototypeVPNGatewayRouteModePrototype.Builder() - .name("my-vpn-gateway") - .resourceGroup(resourceGroupIdentityModel) - .subnet(subnetIdentityModel) - .mode("route") - .build(); - - CreateVpnGatewayOptions createVpnGatewayOptions = new CreateVpnGatewayOptions.Builder() - .vpnGatewayPrototype(vpnGatewayPrototypeModel) - .build(); - - // Invoke operation - Response response = service.createVpnGateway(createVpnGatewayOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - VPNGateway vpnGatewayResult = response.getResult(); - assertNotNull(vpnGatewayResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateVpnGateway" }) - public void testGetVpnGateway() throws Exception { + @Test(dependsOnMethods = { "testListVirtualNetworkInterfaceIps" }) + public void testGetVirtualNetworkInterfaceIp() throws Exception { try { - GetVpnGatewayOptions getVpnGatewayOptions = new GetVpnGatewayOptions.Builder() + GetVirtualNetworkInterfaceIpOptions getVirtualNetworkInterfaceIpOptions = new GetVirtualNetworkInterfaceIpOptions.Builder() + .virtualNetworkInterfaceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getVpnGateway(getVpnGatewayOptions).execute(); + Response response = service.getVirtualNetworkInterfaceIp(getVirtualNetworkInterfaceIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNGateway vpnGatewayResult = response.getResult(); - assertNotNull(vpnGatewayResult); + ReservedIPReference reservedIpReferenceResult = response.getResult(); + assertNotNull(reservedIpReferenceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12667,27 +13360,22 @@ public void testGetVpnGateway() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpnGateway" }) - public void testUpdateVpnGateway() throws Exception { + @Test(dependsOnMethods = { "testGetVirtualNetworkInterfaceIp" }) + public void testAddVirtualNetworkInterfaceIp() throws Exception { try { - VPNGatewayPatch vpnGatewayPatchModel = new VPNGatewayPatch.Builder() - .name("my-vpn-gateway-updated") - .build(); - Map vpnGatewayPatchModelAsPatch = vpnGatewayPatchModel.asPatch(); - - UpdateVpnGatewayOptions updateVpnGatewayOptions = new UpdateVpnGatewayOptions.Builder() + AddVirtualNetworkInterfaceIpOptions addVirtualNetworkInterfaceIpOptions = new AddVirtualNetworkInterfaceIpOptions.Builder() + .virtualNetworkInterfaceId("testString") .id("testString") - .vpnGatewayPatch(vpnGatewayPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateVpnGateway(updateVpnGatewayOptions).execute(); + Response response = service.addVirtualNetworkInterfaceIp(addVirtualNetworkInterfaceIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNGateway vpnGatewayResult = response.getResult(); - assertNotNull(vpnGatewayResult); + ReservedIPReference reservedIpReferenceResult = response.getResult(); + assertNotNull(reservedIpReferenceResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12695,24 +13383,22 @@ public void testUpdateVpnGateway() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpnGateway" }) - public void testListVpnGatewayConnections() throws Exception { + @Test(dependsOnMethods = { "testAddVirtualNetworkInterfaceIp" }) + public void testListVolumeProfiles() throws Exception { try { - ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions = new ListVpnGatewayConnectionsOptions.Builder() - .vpnGatewayId("testString") + ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .status("down") .build(); // Invoke operation - Response response = service.listVpnGatewayConnections(listVpnGatewayConnectionsOptions).execute(); + Response response = service.listVolumeProfiles(listVolumeProfilesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNGatewayConnectionCollection vpnGatewayConnectionCollectionResult = response.getResult(); - assertNotNull(vpnGatewayConnectionCollectionResult); + VolumeProfileCollection volumeProfileCollectionResult = response.getResult(); + assertNotNull(volumeProfileCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12720,28 +13406,26 @@ public void testListVpnGatewayConnections() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnGatewayConnections" }) - public void testListVpnGatewayConnectionsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVolumeProfiles" }) + public void testListVolumeProfilesWithPager() throws Exception { try { - ListVpnGatewayConnectionsOptions options = new ListVpnGatewayConnectionsOptions.Builder() - .vpnGatewayId("testString") + ListVolumeProfilesOptions options = new ListVolumeProfilesOptions.Builder() .limit(Long.valueOf("10")) - .status("down") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpnGatewayConnectionsPager pager = new VpnGatewayConnectionsPager(service, options); + List allResults = new ArrayList<>(); + VolumeProfilesPager pager = new VolumeProfilesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpnGatewayConnectionsPager(service, options); - List allItems = pager.getAll(); + pager = new VolumeProfilesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -12750,67 +13434,24 @@ public void testListVpnGatewayConnectionsWithPager() throws Exception { } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListVpnGatewayConnections" }) - public void testCreateVpnGatewayConnection() throws Exception { - try { - VPNGatewayConnectionDPDPrototype vpnGatewayConnectionDpdPrototypeModel = new VPNGatewayConnectionDPDPrototype.Builder() - .action("restart") - .interval(Long.valueOf("30")) - .timeout(Long.valueOf("120")) - .build(); - - VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPrototypeModel = new VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.Builder() - .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") - .build(); - - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPrototypeModel = new VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.Builder() - .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") - .build(); - - VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN vpnGatewayConnectionIkeIdentityPrototypeModel = new VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN.Builder() - .type("fqdn") - .value("my-service.example.com") - .build(); - - VPNGatewayConnectionStaticRouteModeLocalPrototype vpnGatewayConnectionStaticRouteModeLocalPrototypeModel = new VPNGatewayConnectionStaticRouteModeLocalPrototype.Builder() - .ikeIdentities(java.util.Arrays.asList(vpnGatewayConnectionIkeIdentityPrototypeModel)) - .build(); - - VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress vpnGatewayConnectionStaticRouteModePeerPrototypeModel = new VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.Builder() - .ikeIdentity(vpnGatewayConnectionIkeIdentityPrototypeModel) - .address("192.0.2.5") - .build(); - - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype vpnGatewayConnectionPrototypeModel = new VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.Builder() - .adminStateUp(true) - .deadPeerDetection(vpnGatewayConnectionDpdPrototypeModel) - .establishMode("bidirectional") - .ikePolicy(vpnGatewayConnectionIkePolicyPrototypeModel) - .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPrototypeModel) - .name("my-vpn-gateway-connection") - .psk("lkj14b1oi0alcniejkso") - .distributeTraffic(false) - .local(vpnGatewayConnectionStaticRouteModeLocalPrototypeModel) - .peer(vpnGatewayConnectionStaticRouteModePeerPrototypeModel) - .routingProtocol("none") - .build(); + } + } - CreateVpnGatewayConnectionOptions createVpnGatewayConnectionOptions = new CreateVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") - .vpnGatewayConnectionPrototype(vpnGatewayConnectionPrototypeModel) + @Test(dependsOnMethods = { "testListVolumeProfiles" }) + public void testGetVolumeProfile() throws Exception { + try { + GetVolumeProfileOptions getVolumeProfileOptions = new GetVolumeProfileOptions.Builder() + .name("10iops-tier") .build(); // Invoke operation - Response response = service.createVpnGatewayConnection(createVpnGatewayConnectionOptions).execute(); + Response response = service.getVolumeProfile(getVolumeProfileOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); - assertNotNull(vpnGatewayConnectionResult); + VolumeProfile volumeProfileResult = response.getResult(); + assertNotNull(volumeProfileResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12818,22 +13459,29 @@ public void testCreateVpnGatewayConnection() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVpnGatewayConnection" }) - public void testGetVpnGatewayConnection() throws Exception { + @Test(dependsOnMethods = { "testGetVolumeProfile" }) + public void testListVolumes() throws Exception { try { - GetVpnGatewayConnectionOptions getVpnGatewayConnectionOptions = new GetVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") - .id("testString") + ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .attachmentState("attached") + .encryption("provider_managed") + .name("my-name") + .operatingSystemFamily("Ubuntu Server") + .operatingSystemArchitecture("amd64") + .tag("testString") + .zoneName("us-south-1") .build(); // Invoke operation - Response response = service.getVpnGatewayConnection(getVpnGatewayConnectionOptions).execute(); + Response response = service.listVolumes(listVolumesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); - assertNotNull(vpnGatewayConnectionResult); + VolumeCollection volumeCollectionResult = response.getResult(); + assertNotNull(volumeCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12841,54 +13489,87 @@ public void testGetVpnGatewayConnection() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpnGatewayConnection" }) - public void testUpdateVpnGatewayConnection() throws Exception { + @Test(dependsOnMethods = { "testListVolumes" }) + public void testListVolumesWithPager() throws Exception { try { - VPNGatewayConnectionDPDPatch vpnGatewayConnectionDpdPatchModel = new VPNGatewayConnectionDPDPatch.Builder() - .action("restart") - .interval(Long.valueOf("30")) - .timeout(Long.valueOf("120")) + ListVolumesOptions options = new ListVolumesOptions.Builder() + .limit(Long.valueOf("10")) + .attachmentState("attached") + .encryption("provider_managed") + .name("my-name") + .operatingSystemFamily("Ubuntu Server") + .operatingSystemArchitecture("amd64") + .tag("testString") + .zoneName("us-south-1") .build(); - VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPatchModel = new VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.Builder() - .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") + // Test getNext(). + List allResults = new ArrayList<>(); + VolumesPager pager = new VolumesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new VolumesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVolumes" }) + public void testCreateVolume() throws Exception { + try { + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("custom") .build(); - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPatchModel = new VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.Builder() - .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch vpnGatewayConnectionPeerPatchModel = new VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch.Builder() - .address("192.0.2.5") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - VPNGatewayConnectionPatch vpnGatewayConnectionPatchModel = new VPNGatewayConnectionPatch.Builder() - .adminStateUp(true) - .deadPeerDetection(vpnGatewayConnectionDpdPatchModel) - .distributeTraffic(true) - .establishMode("bidirectional") - .ikePolicy(vpnGatewayConnectionIkePolicyPatchModel) - .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPatchModel) - .name("my-vpn-gateway-connection") - .peer(vpnGatewayConnectionPeerPatchModel) - .psk("lkj14b1oi0alcniejkso") + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); - Map vpnGatewayConnectionPatchModelAsPatch = vpnGatewayConnectionPatchModel.asPatch(); - UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOptions = new UpdateVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .vpnGatewayConnectionPatch(vpnGatewayConnectionPatchModelAsPatch) + VolumePrototypeVolumeByCapacity volumePrototypeModel = new VolumePrototypeVolumeByCapacity.Builder() + .bandwidth(Long.valueOf("1000")) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .zone(zoneIdentityModel) + .capacity(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .build(); + + CreateVolumeOptions createVolumeOptions = new CreateVolumeOptions.Builder() + .volumePrototype(volumePrototypeModel) .build(); // Invoke operation - Response response = service.updateVpnGatewayConnection(updateVpnGatewayConnectionOptions).execute(); + Response response = service.createVolume(createVolumeOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); - assertNotNull(vpnGatewayConnectionResult); + Volume volumeResult = response.getResult(); + assertNotNull(volumeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12896,22 +13577,21 @@ public void testUpdateVpnGatewayConnection() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpnGatewayConnection" }) - public void testListVpnGatewayConnectionsLocalCidrs() throws Exception { + @Test(dependsOnMethods = { "testCreateVolume" }) + public void testGetVolume() throws Exception { try { - ListVpnGatewayConnectionsLocalCidrsOptions listVpnGatewayConnectionsLocalCidrsOptions = new ListVpnGatewayConnectionsLocalCidrsOptions.Builder() - .vpnGatewayId("testString") + GetVolumeOptions getVolumeOptions = new GetVolumeOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.listVpnGatewayConnectionsLocalCidrs(listVpnGatewayConnectionsLocalCidrsOptions).execute(); + Response response = service.getVolume(getVolumeOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNGatewayConnectionCIDRs vpnGatewayConnectionCidRsResult = response.getResult(); - assertNotNull(vpnGatewayConnectionCidRsResult); + Volume volumeResult = response.getResult(); + assertNotNull(volumeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12919,62 +13599,44 @@ public void testListVpnGatewayConnectionsLocalCidrs() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnGatewayConnectionsLocalCidrs" }) - public void testCheckVpnGatewayConnectionsLocalCidr() throws Exception { + @Test(dependsOnMethods = { "testGetVolume" }) + public void testUpdateVolume() throws Exception { try { - CheckVpnGatewayConnectionsLocalCidrOptions checkVpnGatewayConnectionsLocalCidrOptions = new CheckVpnGatewayConnectionsLocalCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidr("192.168.1.0/24") + VolumeAllowedUsePatch volumeAllowedUsePatchModel = new VolumeAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - // Invoke operation - Response response = service.checkVpnGatewayConnectionsLocalCidr(checkVpnGatewayConnectionsLocalCidrOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCheckVpnGatewayConnectionsLocalCidr" }) - public void testAddVpnGatewayConnectionsLocalCidr() throws Exception { - try { - AddVpnGatewayConnectionsLocalCidrOptions addVpnGatewayConnectionsLocalCidrOptions = new AddVpnGatewayConnectionsLocalCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidr("192.168.1.0/24") + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("general-purpose") .build(); - // Invoke operation - Response response = service.addVpnGatewayConnectionsLocalCidr(addVpnGatewayConnectionsLocalCidrOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + VolumePatch volumePatchModel = new VolumePatch.Builder() + .allowedUse(volumeAllowedUsePatchModel) + .bandwidth(Long.valueOf("1000")) + .capacity(Long.valueOf("100")) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) + .build(); + Map volumePatchModelAsPatch = volumePatchModel.asPatch(); - @Test(dependsOnMethods = { "testAddVpnGatewayConnectionsLocalCidr" }) - public void testListVpnGatewayConnectionsPeerCidrs() throws Exception { - try { - ListVpnGatewayConnectionsPeerCidrsOptions listVpnGatewayConnectionsPeerCidrsOptions = new ListVpnGatewayConnectionsPeerCidrsOptions.Builder() - .vpnGatewayId("testString") + UpdateVolumeOptions updateVolumeOptions = new UpdateVolumeOptions.Builder() .id("testString") + .volumePatch(volumePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.listVpnGatewayConnectionsPeerCidrs(listVpnGatewayConnectionsPeerCidrsOptions).execute(); + Response response = service.updateVolume(updateVolumeOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNGatewayConnectionCIDRs vpnGatewayConnectionCidRsResult = response.getResult(); - assertNotNull(vpnGatewayConnectionCidRsResult); + Volume volumeResult = response.getResult(); + assertNotNull(volumeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -12982,65 +13644,80 @@ public void testListVpnGatewayConnectionsPeerCidrs() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnGatewayConnectionsPeerCidrs" }) - public void testCheckVpnGatewayConnectionsPeerCidr() throws Exception { + @Test(dependsOnMethods = { "testUpdateVolume" }) + public void testListVolumeInstanceProfiles() throws Exception { try { - CheckVpnGatewayConnectionsPeerCidrOptions checkVpnGatewayConnectionsPeerCidrOptions = new CheckVpnGatewayConnectionsPeerCidrOptions.Builder() - .vpnGatewayId("testString") + ListVolumeInstanceProfilesOptions listVolumeInstanceProfilesOptions = new ListVolumeInstanceProfilesOptions.Builder() .id("testString") - .cidr("192.168.1.0/24") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.checkVpnGatewayConnectionsPeerCidr(checkVpnGatewayConnectionsPeerCidrOptions).execute(); + Response response = service.listVolumeInstanceProfiles(listVolumeInstanceProfilesOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 200); + + VolumeInstanceProfileCollection volumeInstanceProfileCollectionResult = response.getResult(); + assertNotNull(volumeInstanceProfileCollectionResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testCheckVpnGatewayConnectionsPeerCidr" }) - public void testAddVpnGatewayConnectionsPeerCidr() throws Exception { + @Test(dependsOnMethods = { "testListVolumeInstanceProfiles" }) + public void testListVolumeInstanceProfilesWithPager() throws Exception { try { - AddVpnGatewayConnectionsPeerCidrOptions addVpnGatewayConnectionsPeerCidrOptions = new AddVpnGatewayConnectionsPeerCidrOptions.Builder() - .vpnGatewayId("testString") + ListVolumeInstanceProfilesOptions options = new ListVolumeInstanceProfilesOptions.Builder() .id("testString") - .cidr("192.168.1.0/24") + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.addVpnGatewayConnectionsPeerCidr(addVpnGatewayConnectionsPeerCidrOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + // Test getNext(). + List allResults = new ArrayList<>(); + VolumeInstanceProfilesPager pager = new VolumeInstanceProfilesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new VolumeInstanceProfilesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testAddVpnGatewayConnectionsPeerCidr" }) - public void testListVpnServers() throws Exception { + @Test(dependsOnMethods = { "testListVolumeInstanceProfiles" }) + public void testListVpcs() throws Exception { try { - ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() - .name("my-name") + ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .sort("name") + .classicAccess(true) .build(); // Invoke operation - Response response = service.listVpnServers(listVpnServersOptions).execute(); + Response response = service.listVpcs(listVpcsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNServerCollection vpnServerCollectionResult = response.getResult(); - assertNotNull(vpnServerCollectionResult); + VPCCollection vpcCollectionResult = response.getResult(); + assertNotNull(vpcCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13048,29 +13725,28 @@ public void testListVpnServers() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnServers" }) - public void testListVpnServersWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpcs" }) + public void testListVpcsWithPager() throws Exception { try { - ListVpnServersOptions options = new ListVpnServersOptions.Builder() - .name("my-name") + ListVpcsOptions options = new ListVpcsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .sort("name") + .classicAccess(true) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpnServersPager pager = new VpnServersPager(service, options); + List allResults = new ArrayList<>(); + VpcsPager pager = new VpcsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpnServersPager(service, options); - List allItems = pager.getAll(); + pager = new VpcsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -13082,61 +13758,48 @@ public void testListVpnServersWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnServers" }) - public void testCreateVpnServer() throws Exception { + @Test(dependsOnMethods = { "testListVpcs" }) + public void testCreateVpc() throws Exception { try { - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() - .providerType("iam") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() - .method("certificate") - .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) + DNSServerPrototype dnsServerPrototypeModel = new DNSServerPrototype.Builder() + .address("192.168.3.4") + .zoneAffinity(zoneIdentityModel) .build(); - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype vpcdnsResolverPrototypeModel = new VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype.Builder() + .manualServers(java.util.Arrays.asList(dnsServerPrototypeModel)) + .type("manual") .build(); - IP ipModel = new IP.Builder() - .address("192.168.3.4") + VPCDNSPrototype vpcdnsPrototypeModel = new VPCDNSPrototype.Builder() + .enableHub(false) + .resolver(vpcdnsResolverPrototypeModel) .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - CreateVpnServerOptions createVpnServerOptions = new CreateVpnServerOptions.Builder() - .certificate(certificateInstanceIdentityModel) - .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) - .clientIpPool("172.16.0.0/16") - .subnets(java.util.Arrays.asList(subnetIdentityModel)) - .clientDnsServerIps(java.util.Arrays.asList(ipModel)) - .clientIdleTimeout(Long.valueOf("600")) - .enableSplitTunneling(false) - .name("my-vpn-server") - .port(Long.valueOf("443")) - .protocol("udp") + CreateVpcOptions createVpcOptions = new CreateVpcOptions.Builder() + .addressPrefixManagement("auto") + .classicAccess(false) + .dns(vpcdnsPrototypeModel) + .name("my-vpc") .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke operation - Response response = service.createVpnServer(createVpnServerOptions).execute(); + Response response = service.createVpc(createVpcOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - VPNServer vpnServerResult = response.getResult(); - assertNotNull(vpnServerResult); + VPC vpcResult = response.getResult(); + assertNotNull(vpcResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13144,21 +13807,21 @@ public void testCreateVpnServer() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVpnServer" }) - public void testGetVpnServer() throws Exception { + @Test(dependsOnMethods = { "testCreateVpc" }) + public void testGetVpc() throws Exception { try { - GetVpnServerOptions getVpnServerOptions = new GetVpnServerOptions.Builder() + GetVpcOptions getVpcOptions = new GetVpcOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getVpnServer(getVpnServerOptions).execute(); + Response response = service.getVpc(getVpcOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNServer vpnServerResult = response.getResult(); - assertNotNull(vpnServerResult); + VPC vpcResult = response.getResult(); + assertNotNull(vpcResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13166,58 +13829,53 @@ public void testGetVpnServer() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpnServer" }) - public void testUpdateVpnServer() throws Exception { + @Test(dependsOnMethods = { "testGetVpc" }) + public void testUpdateVpc() throws Exception { try { - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() - .providerType("iam") + DNSServerPrototype dnsServerPrototypeModel = new DNSServerPrototype.Builder() + .address("192.168.3.4") + .zoneAffinity(zoneIdentityModel) .build(); - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() - .method("certificate") - .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) + VPCDNSResolverVPCPatchVPCIdentityById vpcdnsResolverVpcPatchModel = new VPCDNSResolverVPCPatchVPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - IP ipModel = new IP.Builder() - .address("192.168.3.4") + VPCDNSResolverPatch vpcdnsResolverPatchModel = new VPCDNSResolverPatch.Builder() + .manualServers(java.util.Arrays.asList(dnsServerPrototypeModel)) + .type("delegated") + .vpc(vpcdnsResolverVpcPatchModel) .build(); - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + VPCDNSPatch vpcdnsPatchModel = new VPCDNSPatch.Builder() + .enableHub(true) + .resolver(vpcdnsResolverPatchModel) .build(); - VPNServerPatch vpnServerPatchModel = new VPNServerPatch.Builder() - .certificate(certificateInstanceIdentityModel) - .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) - .clientDnsServerIps(java.util.Arrays.asList(ipModel)) - .clientIdleTimeout(Long.valueOf("600")) - .clientIpPool("172.16.0.0/16") - .enableSplitTunneling(true) - .name("my-vpn-server-updated") - .port(Long.valueOf("443")) - .protocol("tcp") - .subnets(java.util.Arrays.asList(subnetIdentityModel)) + VPCPatch vpcPatchModel = new VPCPatch.Builder() + .dns(vpcdnsPatchModel) + .name("my-vpc") .build(); - Map vpnServerPatchModelAsPatch = vpnServerPatchModel.asPatch(); + Map vpcPatchModelAsPatch = vpcPatchModel.asPatch(); - UpdateVpnServerOptions updateVpnServerOptions = new UpdateVpnServerOptions.Builder() + UpdateVpcOptions updateVpcOptions = new UpdateVpcOptions.Builder() .id("testString") - .vpnServerPatch(vpnServerPatchModelAsPatch) + .vpcPatch(vpcPatchModelAsPatch) .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updateVpnServer(updateVpnServerOptions).execute(); + Response response = service.updateVpc(updateVpcOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNServer vpnServerResult = response.getResult(); - assertNotNull(vpnServerResult); + VPC vpcResult = response.getResult(); + assertNotNull(vpcResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13225,21 +13883,21 @@ public void testUpdateVpnServer() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpnServer" }) - public void testGetVpnServerClientConfiguration() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpc" }) + public void testGetVpcDefaultNetworkAcl() throws Exception { try { - GetVpnServerClientConfigurationOptions getVpnServerClientConfigurationOptions = new GetVpnServerClientConfigurationOptions.Builder() + GetVpcDefaultNetworkAclOptions getVpcDefaultNetworkAclOptions = new GetVpcDefaultNetworkAclOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getVpnServerClientConfiguration(getVpnServerClientConfigurationOptions).execute(); + Response response = service.getVpcDefaultNetworkAcl(getVpcDefaultNetworkAclOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - String resultResult = response.getResult(); - assertNotNull(resultResult); + DefaultNetworkACL defaultNetworkAclResult = response.getResult(); + assertNotNull(defaultNetworkAclResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13247,24 +13905,67 @@ public void testGetVpnServerClientConfiguration() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpnServerClientConfiguration" }) - public void testListVpnServerClients() throws Exception { + @Test(dependsOnMethods = { "testGetVpcDefaultNetworkAcl" }) + public void testGetVpcDefaultRoutingTable() throws Exception { try { - ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() - .vpnServerId("testString") + GetVpcDefaultRoutingTableOptions getVpcDefaultRoutingTableOptions = new GetVpcDefaultRoutingTableOptions.Builder() + .id("testString") + .build(); + + // Invoke operation + Response response = service.getVpcDefaultRoutingTable(getVpcDefaultRoutingTableOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + DefaultRoutingTable defaultRoutingTableResult = response.getResult(); + assertNotNull(defaultRoutingTableResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetVpcDefaultRoutingTable" }) + public void testGetVpcDefaultSecurityGroup() throws Exception { + try { + GetVpcDefaultSecurityGroupOptions getVpcDefaultSecurityGroupOptions = new GetVpcDefaultSecurityGroupOptions.Builder() + .id("testString") + .build(); + + // Invoke operation + Response response = service.getVpcDefaultSecurityGroup(getVpcDefaultSecurityGroupOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + DefaultSecurityGroup defaultSecurityGroupResult = response.getResult(); + assertNotNull(defaultSecurityGroupResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetVpcDefaultSecurityGroup" }) + public void testListVpcAddressPrefixes() throws Exception { + try { + ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() + .vpcId("testString") .start("testString") .limit(Long.valueOf("10")) - .sort("created_at") .build(); // Invoke operation - Response response = service.listVpnServerClients(listVpnServerClientsOptions).execute(); + Response response = service.listVpcAddressPrefixes(listVpcAddressPrefixesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNServerClientCollection vpnServerClientCollectionResult = response.getResult(); - assertNotNull(vpnServerClientCollectionResult); + AddressPrefixCollection addressPrefixCollectionResult = response.getResult(); + assertNotNull(addressPrefixCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13272,55 +13973,84 @@ public void testListVpnServerClients() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnServerClients" }) - public void testListVpnServerClientsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpcAddressPrefixes" }) + public void testListVpcAddressPrefixesWithPager() throws Exception { try { - ListVpnServerClientsOptions options = new ListVpnServerClientsOptions.Builder() - .vpnServerId("testString") + ListVpcAddressPrefixesOptions options = new ListVpcAddressPrefixesOptions.Builder() + .vpcId("testString") .limit(Long.valueOf("10")) - .sort("created_at") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpnServerClientsPager pager = new VpnServerClientsPager(service, options); + List allResults = new ArrayList<>(); + VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); - // Test getAll(); - pager = new VpnServerClientsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + // Test getAll(); + pager = new VpcAddressPrefixesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVpcAddressPrefixes" }) + public void testCreateVpcAddressPrefix() throws Exception { + try { + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + CreateVpcAddressPrefixOptions createVpcAddressPrefixOptions = new CreateVpcAddressPrefixOptions.Builder() + .vpcId("testString") + .cidr("10.240.0.0/18") + .zone(zoneIdentityModel) + .isDefault(true) + .name("my-vpc-address-prefix-zone-1") + .build(); + + // Invoke operation + Response response = service.createVpcAddressPrefix(createVpcAddressPrefixOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + AddressPrefix addressPrefixResult = response.getResult(); + assertNotNull(addressPrefixResult); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListVpnServerClients" }) - public void testGetVpnServerClient() throws Exception { + @Test(dependsOnMethods = { "testCreateVpcAddressPrefix" }) + public void testGetVpcAddressPrefix() throws Exception { try { - GetVpnServerClientOptions getVpnServerClientOptions = new GetVpnServerClientOptions.Builder() - .vpnServerId("testString") + GetVpcAddressPrefixOptions getVpcAddressPrefixOptions = new GetVpcAddressPrefixOptions.Builder() + .vpcId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getVpnServerClient(getVpnServerClientOptions).execute(); + Response response = service.getVpcAddressPrefix(getVpcAddressPrefixOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNServerClient vpnServerClientResult = response.getResult(); - assertNotNull(vpnServerClientResult); + AddressPrefix addressPrefixResult = response.getResult(); + assertNotNull(addressPrefixResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13328,43 +14058,58 @@ public void testGetVpnServerClient() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpnServerClient" }) - public void testDisconnectVpnClient() throws Exception { + @Test(dependsOnMethods = { "testGetVpcAddressPrefix" }) + public void testUpdateVpcAddressPrefix() throws Exception { try { - DisconnectVpnClientOptions disconnectVpnClientOptions = new DisconnectVpnClientOptions.Builder() - .vpnServerId("testString") + AddressPrefixPatch addressPrefixPatchModel = new AddressPrefixPatch.Builder() + .isDefault(false) + .name("my-vpc-address-prefix-updated") + .build(); + Map addressPrefixPatchModelAsPatch = addressPrefixPatchModel.asPatch(); + + UpdateVpcAddressPrefixOptions updateVpcAddressPrefixOptions = new UpdateVpcAddressPrefixOptions.Builder() + .vpcId("testString") .id("testString") + .addressPrefixPatch(addressPrefixPatchModelAsPatch) .build(); // Invoke operation - Response response = service.disconnectVpnClient(disconnectVpnClientOptions).execute(); + Response response = service.updateVpcAddressPrefix(updateVpcAddressPrefixOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 200); + + AddressPrefix addressPrefixResult = response.getResult(); + assertNotNull(addressPrefixResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDisconnectVpnClient" }) - public void testListVpnServerRoutes() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpcAddressPrefix" }) + public void testListVpcDnsResolutionBindings() throws Exception { try { - ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() - .vpnServerId("testString") + ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptions = new ListVpcDnsResolutionBindingsOptions.Builder() + .vpcId("testString") + .sort("name") .start("testString") .limit(Long.valueOf("10")) - .sort("name") + .name("my-name") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); // Invoke operation - Response response = service.listVpnServerRoutes(listVpnServerRoutesOptions).execute(); + Response response = service.listVpcDnsResolutionBindings(listVpcDnsResolutionBindingsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNServerRouteCollection vpnServerRouteCollectionResult = response.getResult(); - assertNotNull(vpnServerRouteCollectionResult); + VPCDNSResolutionBindingCollection vpcdnsResolutionBindingCollectionResult = response.getResult(); + assertNotNull(vpcdnsResolutionBindingCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13372,28 +14117,32 @@ public void testListVpnServerRoutes() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnServerRoutes" }) - public void testListVpnServerRoutesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpcDnsResolutionBindings" }) + public void testListVpcDnsResolutionBindingsWithPager() throws Exception { try { - ListVpnServerRoutesOptions options = new ListVpnServerRoutesOptions.Builder() - .vpnServerId("testString") - .limit(Long.valueOf("10")) + ListVpcDnsResolutionBindingsOptions options = new ListVpcDnsResolutionBindingsOptions.Builder() + .vpcId("testString") .sort("name") + .limit(Long.valueOf("10")) + .name("my-name") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - VpnServerRoutesPager pager = new VpnServerRoutesPager(service, options); + List allResults = new ArrayList<>(); + VpcDnsResolutionBindingsPager pager = new VpcDnsResolutionBindingsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new VpnServerRoutesPager(service, options); - List allItems = pager.getAll(); + pager = new VpcDnsResolutionBindingsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -13405,24 +14154,27 @@ public void testListVpnServerRoutesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListVpnServerRoutes" }) - public void testCreateVpnServerRoute() throws Exception { + @Test(dependsOnMethods = { "testListVpcDnsResolutionBindings" }) + public void testCreateVpcDnsResolutionBinding() throws Exception { try { - CreateVpnServerRouteOptions createVpnServerRouteOptions = new CreateVpnServerRouteOptions.Builder() - .vpnServerId("testString") - .destination("172.16.0.0/16") - .action("deliver") - .name("my-vpn-route-2") + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + CreateVpcDnsResolutionBindingOptions createVpcDnsResolutionBindingOptions = new CreateVpcDnsResolutionBindingOptions.Builder() + .vpcId("testString") + .vpc(vpcIdentityModel) + .name("my-dns-resolution-binding") .build(); // Invoke operation - Response response = service.createVpnServerRoute(createVpnServerRouteOptions).execute(); + Response response = service.createVpcDnsResolutionBinding(createVpcDnsResolutionBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - VPNServerRoute vpnServerRouteResult = response.getResult(); - assertNotNull(vpnServerRouteResult); + VPCDNSResolutionBinding vpcdnsResolutionBindingResult = response.getResult(); + assertNotNull(vpcdnsResolutionBindingResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13430,22 +14182,22 @@ public void testCreateVpnServerRoute() throws Exception { } } - @Test(dependsOnMethods = { "testCreateVpnServerRoute" }) - public void testGetVpnServerRoute() throws Exception { + @Test(dependsOnMethods = { "testCreateVpcDnsResolutionBinding" }) + public void testGetVpcDnsResolutionBinding() throws Exception { try { - GetVpnServerRouteOptions getVpnServerRouteOptions = new GetVpnServerRouteOptions.Builder() - .vpnServerId("testString") + GetVpcDnsResolutionBindingOptions getVpcDnsResolutionBindingOptions = new GetVpcDnsResolutionBindingOptions.Builder() + .vpcId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getVpnServerRoute(getVpnServerRouteOptions).execute(); + Response response = service.getVpcDnsResolutionBinding(getVpcDnsResolutionBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNServerRoute vpnServerRouteResult = response.getResult(); - assertNotNull(vpnServerRouteResult); + VPCDNSResolutionBinding vpcdnsResolutionBindingResult = response.getResult(); + assertNotNull(vpcdnsResolutionBindingResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13453,28 +14205,28 @@ public void testGetVpnServerRoute() throws Exception { } } - @Test(dependsOnMethods = { "testGetVpnServerRoute" }) - public void testUpdateVpnServerRoute() throws Exception { + @Test(dependsOnMethods = { "testGetVpcDnsResolutionBinding" }) + public void testUpdateVpcDnsResolutionBinding() throws Exception { try { - VPNServerRoutePatch vpnServerRoutePatchModel = new VPNServerRoutePatch.Builder() - .name("my-vpn-server-route-updated") + VPCDNSResolutionBindingPatch vpcdnsResolutionBindingPatchModel = new VPCDNSResolutionBindingPatch.Builder() + .name("my-dns-resolution-binding-updated") .build(); - Map vpnServerRoutePatchModelAsPatch = vpnServerRoutePatchModel.asPatch(); + Map vpcdnsResolutionBindingPatchModelAsPatch = vpcdnsResolutionBindingPatchModel.asPatch(); - UpdateVpnServerRouteOptions updateVpnServerRouteOptions = new UpdateVpnServerRouteOptions.Builder() - .vpnServerId("testString") + UpdateVpcDnsResolutionBindingOptions updateVpcDnsResolutionBindingOptions = new UpdateVpcDnsResolutionBindingOptions.Builder() + .vpcId("testString") .id("testString") - .vpnServerRoutePatch(vpnServerRoutePatchModelAsPatch) + .vpcdnsResolutionBindingPatch(vpcdnsResolutionBindingPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateVpnServerRoute(updateVpnServerRouteOptions).execute(); + Response response = service.updateVpcDnsResolutionBinding(updateVpcDnsResolutionBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - VPNServerRoute vpnServerRouteResult = response.getResult(); - assertNotNull(vpnServerRouteResult); + VPCDNSResolutionBinding vpcdnsResolutionBindingResult = response.getResult(); + assertNotNull(vpcdnsResolutionBindingResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13482,22 +14234,24 @@ public void testUpdateVpnServerRoute() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateVpnServerRoute" }) - public void testListLoadBalancerProfiles() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpcDnsResolutionBinding" }) + public void testListVpcRoutes() throws Exception { try { - ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() + ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() + .vpcId("testString") + .zoneName("us-south-1") .start("testString") .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listLoadBalancerProfiles(listLoadBalancerProfilesOptions).execute(); + Response response = service.listVpcRoutes(listVpcRoutesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerProfileCollection loadBalancerProfileCollectionResult = response.getResult(); - assertNotNull(loadBalancerProfileCollectionResult); + RouteCollectionVPCContext routeCollectionVpcContextResult = response.getResult(); + assertNotNull(routeCollectionVpcContextResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13505,26 +14259,28 @@ public void testListLoadBalancerProfiles() throws Exception { } } - @Test(dependsOnMethods = { "testListLoadBalancerProfiles" }) - public void testListLoadBalancerProfilesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpcRoutes" }) + public void testListVpcRoutesWithPager() throws Exception { try { - ListLoadBalancerProfilesOptions options = new ListLoadBalancerProfilesOptions.Builder() + ListVpcRoutesOptions options = new ListVpcRoutesOptions.Builder() + .vpcId("testString") + .zoneName("us-south-1") .limit(Long.valueOf("10")) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(service, options); + List allResults = new ArrayList<>(); + VpcRoutesPager pager = new VpcRoutesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new LoadBalancerProfilesPager(service, options); - List allItems = pager.getAll(); + pager = new VpcRoutesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -13536,21 +14292,95 @@ public void testListLoadBalancerProfilesWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListLoadBalancerProfiles" }) - public void testGetLoadBalancerProfile() throws Exception { - try { - GetLoadBalancerProfileOptions getLoadBalancerProfileOptions = new GetLoadBalancerProfileOptions.Builder() - .name("network-fixed") + @Test(dependsOnMethods = { "testListVpcRoutes" }) + public void testCreateVpcRoute() throws Exception { + try { + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("0.0.0.0") + .build(); + + CreateVpcRouteOptions createVpcRouteOptions = new CreateVpcRouteOptions.Builder() + .vpcId("testString") + .destination("192.168.3.0/24") + .zone(zoneIdentityModel) + .action("deliver") + .advertise(false) + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPrototypeModel) + .priority(Long.valueOf("1")) + .build(); + + // Invoke operation + Response response = service.createVpcRoute(createVpcRouteOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 201); + + Route routeResult = response.getResult(); + assertNotNull(routeResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testCreateVpcRoute" }) + public void testGetVpcRoute() throws Exception { + try { + GetVpcRouteOptions getVpcRouteOptions = new GetVpcRouteOptions.Builder() + .vpcId("testString") + .id("testString") + .build(); + + // Invoke operation + Response response = service.getVpcRoute(getVpcRouteOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + Route routeResult = response.getResult(); + assertNotNull(routeResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetVpcRoute" }) + public void testUpdateVpcRoute() throws Exception { + try { + RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPatchModel = new RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("10.240.0.12") + .build(); + + RoutePatch routePatchModel = new RoutePatch.Builder() + .advertise(true) + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPatchModel) + .priority(Long.valueOf("1")) + .build(); + Map routePatchModelAsPatch = routePatchModel.asPatch(); + + UpdateVpcRouteOptions updateVpcRouteOptions = new UpdateVpcRouteOptions.Builder() + .vpcId("testString") + .id("testString") + .routePatch(routePatchModelAsPatch) .build(); // Invoke operation - Response response = service.getLoadBalancerProfile(getLoadBalancerProfileOptions).execute(); + Response response = service.updateVpcRoute(updateVpcRouteOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerProfile loadBalancerProfileResult = response.getResult(); - assertNotNull(loadBalancerProfileResult); + Route routeResult = response.getResult(); + assertNotNull(routeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13558,22 +14388,24 @@ public void testGetLoadBalancerProfile() throws Exception { } } - @Test(dependsOnMethods = { "testGetLoadBalancerProfile" }) - public void testListLoadBalancers() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpcRoute" }) + public void testListVpcRoutingTables() throws Exception { try { - ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() + ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() + .vpcId("testString") .start("testString") .limit(Long.valueOf("10")) + .isDefault(true) .build(); // Invoke operation - Response response = service.listLoadBalancers(listLoadBalancersOptions).execute(); + Response response = service.listVpcRoutingTables(listVpcRoutingTablesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerCollection loadBalancerCollectionResult = response.getResult(); - assertNotNull(loadBalancerCollectionResult); + RoutingTableCollection routingTableCollectionResult = response.getResult(); + assertNotNull(routingTableCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13581,26 +14413,28 @@ public void testListLoadBalancers() throws Exception { } } - @Test(dependsOnMethods = { "testListLoadBalancers" }) - public void testListLoadBalancersWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpcRoutingTables" }) + public void testListVpcRoutingTablesWithPager() throws Exception { try { - ListLoadBalancersOptions options = new ListLoadBalancersOptions.Builder() + ListVpcRoutingTablesOptions options = new ListVpcRoutingTablesOptions.Builder() + .vpcId("testString") .limit(Long.valueOf("10")) + .isDefault(true) .build(); // Test getNext(). - List allResults = new ArrayList<>(); - LoadBalancersPager pager = new LoadBalancersPager(service, options); + List allResults = new ArrayList<>(); + VpcRoutingTablesPager pager = new VpcRoutingTablesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new LoadBalancersPager(service, options); - List allItems = pager.getAll(); + pager = new VpcRoutingTablesPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -13612,133 +14446,51 @@ public void testListLoadBalancersWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListLoadBalancers" }) - public void testCreateLoadBalancer() throws Exception { + @Test(dependsOnMethods = { "testListVpcRoutingTables" }) + public void testCreateVpcRoutingTable() throws Exception { try { - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - DNSInstanceIdentityByCRN dnsInstanceIdentityModel = new DNSInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::") - .build(); - - DNSZoneIdentityById dnsZoneIdentityModel = new DNSZoneIdentityById.Builder() - .id("d66662cc-aa23-4fe1-9987-858487a61f45") - .build(); - - LoadBalancerDNSPrototype loadBalancerDnsPrototypeModel = new LoadBalancerDNSPrototype.Builder() - .instance(dnsInstanceIdentityModel) - .zone(dnsZoneIdentityModel) - .build(); - - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByNameModel = new LoadBalancerPoolIdentityByName.Builder() - .name("my-load-balancer-pool") - .build(); - - LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() - .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") - .build(); - - LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() - .httpStatusCode(Long.valueOf("301")) - .listener(loadBalancerListenerIdentityModel) - .uri("/example?doc=get") - .build(); - - LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModel = new LoadBalancerListenerPrototypeLoadBalancerContext.Builder() - .acceptProxyProtocol(true) - .certificateInstance(certificateInstanceIdentityModel) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerPoolIdentityByNameModel) - .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) - .idleConnectionTimeout(Long.valueOf("100")) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) - .protocol("http") - .build(); - - LoadBalancerLoggingDatapathPrototype loadBalancerLoggingDatapathPrototypeModel = new LoadBalancerLoggingDatapathPrototype.Builder() - .active(true) - .build(); - - LoadBalancerLoggingPrototype loadBalancerLoggingPrototypeModel = new LoadBalancerLoggingPrototype.Builder() - .datapath(loadBalancerLoggingDatapathPrototypeModel) - .build(); - - LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("tcp") - .build(); - - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") - .build(); - - LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); - - LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") - .build(); - - LoadBalancerPoolPrototypeLoadBalancerContext loadBalancerPoolPrototypeLoadBalancerContextModel = new LoadBalancerPoolPrototypeLoadBalancerContext.Builder() - .algorithm("least_connections") - .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) - .name("my-load-balancer-pool") - .protocol("http") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + ResourceFilter resourceFilterModel = new ResourceFilter.Builder() + .resourceType("vpn_server") .build(); - LoadBalancerProfileIdentityByName loadBalancerProfileIdentityModel = new LoadBalancerProfileIdentityByName.Builder() - .name("network-fixed") + RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("0.0.0.0") .build(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + RoutePrototype routePrototypeModel = new RoutePrototype.Builder() + .action("deliver") + .advertise(false) + .destination("192.168.3.0/24") + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPrototypeModel) + .priority(Long.valueOf("1")) + .zone(zoneIdentityModel) .build(); - CreateLoadBalancerOptions createLoadBalancerOptions = new CreateLoadBalancerOptions.Builder() - .isPublic(true) - .subnets(java.util.Arrays.asList(subnetIdentityModel)) - .dns(loadBalancerDnsPrototypeModel) - .isPrivatePath(true) - .listeners(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel)) - .logging(loadBalancerLoggingPrototypeModel) - .name("my-load-balancer") - .pools(java.util.Arrays.asList(loadBalancerPoolPrototypeLoadBalancerContextModel)) - .profile(loadBalancerProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .routeMode(true) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + CreateVpcRoutingTableOptions createVpcRoutingTableOptions = new CreateVpcRoutingTableOptions.Builder() + .vpcId("testString") + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) + .advertiseRoutesTo(java.util.Arrays.asList()) + .name("my-routing-table-1") + .routeDirectLinkIngress(false) + .routeInternetIngress(false) + .routeTransitGatewayIngress(false) + .routeVpcZoneIngress(false) + .routes(java.util.Arrays.asList(routePrototypeModel)) .build(); // Invoke operation - Response response = service.createLoadBalancer(createLoadBalancerOptions).execute(); + Response response = service.createVpcRoutingTable(createVpcRoutingTableOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - LoadBalancer loadBalancerResult = response.getResult(); - assertNotNull(loadBalancerResult); + RoutingTable routingTableResult = response.getResult(); + assertNotNull(routingTableResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13746,21 +14498,22 @@ public void testCreateLoadBalancer() throws Exception { } } - @Test(dependsOnMethods = { "testCreateLoadBalancer" }) - public void testGetLoadBalancer() throws Exception { + @Test(dependsOnMethods = { "testCreateVpcRoutingTable" }) + public void testGetVpcRoutingTable() throws Exception { try { - GetLoadBalancerOptions getLoadBalancerOptions = new GetLoadBalancerOptions.Builder() + GetVpcRoutingTableOptions getVpcRoutingTableOptions = new GetVpcRoutingTableOptions.Builder() + .vpcId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getLoadBalancer(getLoadBalancerOptions).execute(); + Response response = service.getVpcRoutingTable(getVpcRoutingTableOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancer loadBalancerResult = response.getResult(); - assertNotNull(loadBalancerResult); + RoutingTable routingTableResult = response.getResult(); + assertNotNull(routingTableResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13768,56 +14521,39 @@ public void testGetLoadBalancer() throws Exception { } } - @Test(dependsOnMethods = { "testGetLoadBalancer" }) - public void testUpdateLoadBalancer() throws Exception { + @Test(dependsOnMethods = { "testGetVpcRoutingTable" }) + public void testUpdateVpcRoutingTable() throws Exception { try { - DNSInstanceIdentityByCRN dnsInstanceIdentityModel = new DNSInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::") - .build(); - - DNSZoneIdentityById dnsZoneIdentityModel = new DNSZoneIdentityById.Builder() - .id("d66662cc-aa23-4fe1-9987-858487a61f45") - .build(); - - LoadBalancerDNSPatch loadBalancerDnsPatchModel = new LoadBalancerDNSPatch.Builder() - .instance(dnsInstanceIdentityModel) - .zone(dnsZoneIdentityModel) - .build(); - - LoadBalancerLoggingDatapathPatch loadBalancerLoggingDatapathPatchModel = new LoadBalancerLoggingDatapathPatch.Builder() - .active(true) - .build(); - - LoadBalancerLoggingPatch loadBalancerLoggingPatchModel = new LoadBalancerLoggingPatch.Builder() - .datapath(loadBalancerLoggingDatapathPatchModel) - .build(); - - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + ResourceFilter resourceFilterModel = new ResourceFilter.Builder() + .resourceType("vpn_server") .build(); - LoadBalancerPatch loadBalancerPatchModel = new LoadBalancerPatch.Builder() - .dns(loadBalancerDnsPatchModel) - .logging(loadBalancerLoggingPatchModel) - .name("my-load-balancer") - .subnets(java.util.Arrays.asList(subnetIdentityModel)) + RoutingTablePatch routingTablePatchModel = new RoutingTablePatch.Builder() + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) + .advertiseRoutesTo(java.util.Arrays.asList("transit_gateway")) + .name("my-routing-table-2") + .routeDirectLinkIngress(true) + .routeInternetIngress(true) + .routeTransitGatewayIngress(true) + .routeVpcZoneIngress(true) .build(); - Map loadBalancerPatchModelAsPatch = loadBalancerPatchModel.asPatch(); + Map routingTablePatchModelAsPatch = routingTablePatchModel.asPatch(); - UpdateLoadBalancerOptions updateLoadBalancerOptions = new UpdateLoadBalancerOptions.Builder() + UpdateVpcRoutingTableOptions updateVpcRoutingTableOptions = new UpdateVpcRoutingTableOptions.Builder() + .vpcId("testString") .id("testString") - .loadBalancerPatch(loadBalancerPatchModelAsPatch) + .routingTablePatch(routingTablePatchModelAsPatch) .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updateLoadBalancer(updateLoadBalancerOptions).execute(); + Response response = service.updateVpcRoutingTable(updateVpcRoutingTableOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancer loadBalancerResult = response.getResult(); - assertNotNull(loadBalancerResult); + RoutingTable routingTableResult = response.getResult(); + assertNotNull(routingTableResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13825,21 +14561,24 @@ public void testUpdateLoadBalancer() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateLoadBalancer" }) - public void testGetLoadBalancerStatistics() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpcRoutingTable" }) + public void testListVpcRoutingTableRoutes() throws Exception { try { - GetLoadBalancerStatisticsOptions getLoadBalancerStatisticsOptions = new GetLoadBalancerStatisticsOptions.Builder() - .id("testString") + ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.getLoadBalancerStatistics(getLoadBalancerStatisticsOptions).execute(); + Response response = service.listVpcRoutingTableRoutes(listVpcRoutingTableRoutesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerStatistics loadBalancerStatisticsResult = response.getResult(); - assertNotNull(loadBalancerStatisticsResult); + RouteCollection routeCollectionResult = response.getResult(); + assertNotNull(routeCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13847,91 +14586,70 @@ public void testGetLoadBalancerStatistics() throws Exception { } } - @Test(dependsOnMethods = { "testGetLoadBalancerStatistics" }) - public void testListLoadBalancerListeners() throws Exception { + @Test(dependsOnMethods = { "testListVpcRoutingTableRoutes" }) + public void testListVpcRoutingTableRoutesWithPager() throws Exception { try { - ListLoadBalancerListenersOptions listLoadBalancerListenersOptions = new ListLoadBalancerListenersOptions.Builder() - .loadBalancerId("testString") + ListVpcRoutingTableRoutesOptions options = new ListVpcRoutingTableRoutesOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.listLoadBalancerListeners(listLoadBalancerListenersOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - LoadBalancerListenerCollection loadBalancerListenerCollectionResult = response.getResult(); - assertNotNull(loadBalancerListenerCollectionResult); + // Test getAll(); + pager = new VpcRoutingTableRoutesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListLoadBalancerListeners" }) - public void testCreateLoadBalancerListener() throws Exception { + @Test(dependsOnMethods = { "testListVpcRoutingTableRoutes" }) + public void testCreateVpcRoutingTableRoute() throws Exception { try { - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() - .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") - .build(); - - LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() - .httpStatusCode(Long.valueOf("301")) - .listener(loadBalancerListenerIdentityModel) - .uri("/example?doc=get") - .build(); - - LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("testString") - .build(); - - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - LoadBalancerListenerPolicyPrototype loadBalancerListenerPolicyPrototypeModel = new LoadBalancerListenerPolicyPrototype.Builder() - .action("forward_to_listener") - .name("my-load-balancer-listener-policy") - .priority(Long.valueOf("5")) - .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) - .target(loadBalancerListenerPolicyTargetPrototypeModel) + RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("0.0.0.0") .build(); - CreateLoadBalancerListenerOptions createLoadBalancerListenerOptions = new CreateLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") - .protocol("http") - .acceptProxyProtocol(true) - .certificateInstance(certificateInstanceIdentityModel) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerPoolIdentityModel) - .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) - .idleConnectionTimeout(Long.valueOf("100")) - .policies(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel)) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) + CreateVpcRoutingTableRouteOptions createVpcRoutingTableRouteOptions = new CreateVpcRoutingTableRouteOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .destination("192.168.3.0/24") + .zone(zoneIdentityModel) + .action("deliver") + .advertise(false) + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPrototypeModel) + .priority(Long.valueOf("1")) .build(); // Invoke operation - Response response = service.createLoadBalancerListener(createLoadBalancerListenerOptions).execute(); + Response response = service.createVpcRoutingTableRoute(createVpcRoutingTableRouteOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - LoadBalancerListener loadBalancerListenerResult = response.getResult(); - assertNotNull(loadBalancerListenerResult); + Route routeResult = response.getResult(); + assertNotNull(routeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13939,22 +14657,23 @@ public void testCreateLoadBalancerListener() throws Exception { } } - @Test(dependsOnMethods = { "testCreateLoadBalancerListener" }) - public void testGetLoadBalancerListener() throws Exception { + @Test(dependsOnMethods = { "testCreateVpcRoutingTableRoute" }) + public void testGetVpcRoutingTableRoute() throws Exception { try { - GetLoadBalancerListenerOptions getLoadBalancerListenerOptions = new GetLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") + GetVpcRoutingTableRouteOptions getVpcRoutingTableRouteOptions = new GetVpcRoutingTableRouteOptions.Builder() + .vpcId("testString") + .routingTableId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getLoadBalancerListener(getLoadBalancerListenerOptions).execute(); + Response response = service.getVpcRoutingTableRoute(getVpcRoutingTableRouteOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerListener loadBalancerListenerResult = response.getResult(); - assertNotNull(loadBalancerListenerResult); + Route routeResult = response.getResult(); + assertNotNull(routeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -13962,55 +14681,36 @@ public void testGetLoadBalancerListener() throws Exception { } } - @Test(dependsOnMethods = { "testGetLoadBalancerListener" }) - public void testUpdateLoadBalancerListener() throws Exception { + @Test(dependsOnMethods = { "testGetVpcRoutingTableRoute" }) + public void testUpdateVpcRoutingTableRoute() throws Exception { try { - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById loadBalancerListenerDefaultPoolPatchModel = new LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() - .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") - .build(); - - LoadBalancerListenerHTTPSRedirectPatch loadBalancerListenerHttpsRedirectPatchModel = new LoadBalancerListenerHTTPSRedirectPatch.Builder() - .httpStatusCode(Long.valueOf("301")) - .listener(loadBalancerListenerIdentityModel) - .uri("/example?doc=get") + RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPatchModel = new RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("0.0.0.0") .build(); - LoadBalancerListenerPatch loadBalancerListenerPatchModel = new LoadBalancerListenerPatch.Builder() - .acceptProxyProtocol(true) - .certificateInstance(certificateInstanceIdentityModel) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerListenerDefaultPoolPatchModel) - .httpsRedirect(loadBalancerListenerHttpsRedirectPatchModel) - .idleConnectionTimeout(Long.valueOf("100")) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) - .protocol("http") + RoutePatch routePatchModel = new RoutePatch.Builder() + .advertise(false) + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPatchModel) + .priority(Long.valueOf("1")) .build(); - Map loadBalancerListenerPatchModelAsPatch = loadBalancerListenerPatchModel.asPatch(); + Map routePatchModelAsPatch = routePatchModel.asPatch(); - UpdateLoadBalancerListenerOptions updateLoadBalancerListenerOptions = new UpdateLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") + UpdateVpcRoutingTableRouteOptions updateVpcRoutingTableRouteOptions = new UpdateVpcRoutingTableRouteOptions.Builder() + .vpcId("testString") + .routingTableId("testString") .id("testString") - .loadBalancerListenerPatch(loadBalancerListenerPatchModelAsPatch) + .routePatch(routePatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateLoadBalancerListener(updateLoadBalancerListenerOptions).execute(); + Response response = service.updateVpcRoutingTableRoute(updateVpcRoutingTableRouteOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerListener loadBalancerListenerResult = response.getResult(); - assertNotNull(loadBalancerListenerResult); + Route routeResult = response.getResult(); + assertNotNull(routeResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14018,22 +14718,22 @@ public void testUpdateLoadBalancerListener() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateLoadBalancerListener" }) - public void testListLoadBalancerListenerPolicies() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpcRoutingTableRoute" }) + public void testListIkePolicies() throws Exception { try { - ListLoadBalancerListenerPoliciesOptions listLoadBalancerListenerPoliciesOptions = new ListLoadBalancerListenerPoliciesOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") + ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptions).execute(); + Response response = service.listIkePolicies(listIkePoliciesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerListenerPolicyCollection loadBalancerListenerPolicyCollectionResult = response.getResult(); - assertNotNull(loadBalancerListenerPolicyCollectionResult); + IKEPolicyCollection ikePolicyCollectionResult = response.getResult(); + assertNotNull(ikePolicyCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14041,38 +14741,62 @@ public void testListLoadBalancerListenerPolicies() throws Exception { } } - @Test(dependsOnMethods = { "testListLoadBalancerListenerPolicies" }) - public void testCreateLoadBalancerListenerPolicy() throws Exception { + @Test(dependsOnMethods = { "testListIkePolicies" }) + public void testListIkePoliciesWithPager() throws Exception { try { - LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("testString") + ListIkePoliciesOptions options = new ListIkePoliciesOptions.Builder() + .limit(Long.valueOf("10")) .build(); - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); + // Test getNext(). + List allResults = new ArrayList<>(); + IkePoliciesPager pager = new IkePoliciesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - CreateLoadBalancerListenerPolicyOptions createLoadBalancerListenerPolicyOptions = new CreateLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .action("forward_to_listener") - .priority(Long.valueOf("5")) - .name("my-load-balancer-listener-policy") - .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) - .target(loadBalancerListenerPolicyTargetPrototypeModel) + // Test getAll(); + pager = new IkePoliciesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListIkePolicies" }) + public void testCreateIkePolicy() throws Exception { + try { + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + CreateIkePolicyOptions createIkePolicyOptions = new CreateIkePolicyOptions.Builder() + .authenticationAlgorithm("sha256") + .dhGroup(Long.valueOf("14")) + .encryptionAlgorithm("aes128") + .ikeVersion(Long.valueOf("1")) + .keyLifetime(Long.valueOf("28800")) + .name("my-ike-policy") + .resourceGroup(resourceGroupIdentityModel) .build(); // Invoke operation - Response response = service.createLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptions).execute(); + Response response = service.createIkePolicy(createIkePolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); - assertNotNull(loadBalancerListenerPolicyResult); + IKEPolicy ikePolicyResult = response.getResult(); + assertNotNull(ikePolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14080,23 +14804,21 @@ public void testCreateLoadBalancerListenerPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testCreateLoadBalancerListenerPolicy" }) - public void testGetLoadBalancerListenerPolicy() throws Exception { + @Test(dependsOnMethods = { "testCreateIkePolicy" }) + public void testGetIkePolicy() throws Exception { try { - GetLoadBalancerListenerPolicyOptions getLoadBalancerListenerPolicyOptions = new GetLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") + GetIkePolicyOptions getIkePolicyOptions = new GetIkePolicyOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptions).execute(); + Response response = service.getIkePolicy(getIkePolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); - assertNotNull(loadBalancerListenerPolicyResult); + IKEPolicy ikePolicyResult = response.getResult(); + assertNotNull(ikePolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14104,35 +14826,32 @@ public void testGetLoadBalancerListenerPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testGetLoadBalancerListenerPolicy" }) - public void testUpdateLoadBalancerListenerPolicy() throws Exception { + @Test(dependsOnMethods = { "testGetIkePolicy" }) + public void testUpdateIkePolicy() throws Exception { try { - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPatchModel = new LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - LoadBalancerListenerPolicyPatch loadBalancerListenerPolicyPatchModel = new LoadBalancerListenerPolicyPatch.Builder() - .name("my-load-balancer-listener-policy-updated") - .priority(Long.valueOf("5")) - .target(loadBalancerListenerPolicyTargetPatchModel) + IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() + .authenticationAlgorithm("sha256") + .dhGroup(Long.valueOf("14")) + .encryptionAlgorithm("aes128") + .ikeVersion(Long.valueOf("1")) + .keyLifetime(Long.valueOf("86400")) + .name("my-ike-policy") .build(); - Map loadBalancerListenerPolicyPatchModelAsPatch = loadBalancerListenerPolicyPatchModel.asPatch(); + Map ikePolicyPatchModelAsPatch = ikePolicyPatchModel.asPatch(); - UpdateLoadBalancerListenerPolicyOptions updateLoadBalancerListenerPolicyOptions = new UpdateLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") + UpdateIkePolicyOptions updateIkePolicyOptions = new UpdateIkePolicyOptions.Builder() .id("testString") - .loadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatchModelAsPatch) + .ikePolicyPatch(ikePolicyPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptions).execute(); + Response response = service.updateIkePolicy(updateIkePolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerListenerPolicy loadBalancerListenerPolicyResult = response.getResult(); - assertNotNull(loadBalancerListenerPolicyResult); + IKEPolicy ikePolicyResult = response.getResult(); + assertNotNull(ikePolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14140,23 +14859,23 @@ public void testUpdateLoadBalancerListenerPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateLoadBalancerListenerPolicy" }) - public void testListLoadBalancerListenerPolicyRules() throws Exception { + @Test(dependsOnMethods = { "testUpdateIkePolicy" }) + public void testListIkePolicyConnections() throws Exception { try { - ListLoadBalancerListenerPolicyRulesOptions listLoadBalancerListenerPolicyRulesOptions = new ListLoadBalancerListenerPolicyRulesOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") + ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions = new ListIkePolicyConnectionsOptions.Builder() + .id("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.listLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptions).execute(); + Response response = service.listIkePolicyConnections(listIkePolicyConnectionsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerListenerPolicyRuleCollection loadBalancerListenerPolicyRuleCollectionResult = response.getResult(); - assertNotNull(loadBalancerListenerPolicyRuleCollectionResult); + IKEPolicyConnectionCollection ikePolicyConnectionCollectionResult = response.getResult(); + assertNotNull(ikePolicyConnectionCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14164,52 +14883,54 @@ public void testListLoadBalancerListenerPolicyRules() throws Exception { } } - @Test(dependsOnMethods = { "testListLoadBalancerListenerPolicyRules" }) - public void testCreateLoadBalancerListenerPolicyRule() throws Exception { + @Test(dependsOnMethods = { "testListIkePolicyConnections" }) + public void testListIkePolicyConnectionsWithPager() throws Exception { try { - CreateLoadBalancerListenerPolicyRuleOptions createLoadBalancerListenerPolicyRuleOptions = new CreateLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .condition("contains") - .type("body") - .value("testString") - .field("MY-APP-HEADER") + ListIkePolicyConnectionsOptions options = new ListIkePolicyConnectionsOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke operation - Response response = service.createLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + // Test getNext(). + List allResults = new ArrayList<>(); + IkePolicyConnectionsPager pager = new IkePolicyConnectionsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); - assertNotNull(loadBalancerListenerPolicyRuleResult); + // Test getAll(); + pager = new IkePolicyConnectionsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testCreateLoadBalancerListenerPolicyRule" }) - public void testGetLoadBalancerListenerPolicyRule() throws Exception { + @Test(dependsOnMethods = { "testListIkePolicyConnections" }) + public void testListIpsecPolicies() throws Exception { try { - GetLoadBalancerListenerPolicyRuleOptions getLoadBalancerListenerPolicyRuleOptions = new GetLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .id("testString") + ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.getLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptions).execute(); + Response response = service.listIpsecPolicies(listIpsecPoliciesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); - assertNotNull(loadBalancerListenerPolicyRuleResult); + IPsecPolicyCollection iPsecPolicyCollectionResult = response.getResult(); + assertNotNull(iPsecPolicyCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14217,33 +14938,61 @@ public void testGetLoadBalancerListenerPolicyRule() throws Exception { } } - @Test(dependsOnMethods = { "testGetLoadBalancerListenerPolicyRule" }) - public void testUpdateLoadBalancerListenerPolicyRule() throws Exception { + @Test(dependsOnMethods = { "testListIpsecPolicies" }) + public void testListIpsecPoliciesWithPager() throws Exception { try { - LoadBalancerListenerPolicyRulePatch loadBalancerListenerPolicyRulePatchModel = new LoadBalancerListenerPolicyRulePatch.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("my-example-hostname-updated") + ListIpsecPoliciesOptions options = new ListIpsecPoliciesOptions.Builder() + .limit(Long.valueOf("10")) .build(); - Map loadBalancerListenerPolicyRulePatchModelAsPatch = loadBalancerListenerPolicyRulePatchModel.asPatch(); - UpdateLoadBalancerListenerPolicyRuleOptions updateLoadBalancerListenerPolicyRuleOptions = new UpdateLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .id("testString") - .loadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatchModelAsPatch) + // Test getNext(). + List allResults = new ArrayList<>(); + IpsecPoliciesPager pager = new IpsecPoliciesPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); + + // Test getAll(); + pager = new IpsecPoliciesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListIpsecPolicies" }) + public void testCreateIpsecPolicy() throws Exception { + try { + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + CreateIpsecPolicyOptions createIpsecPolicyOptions = new CreateIpsecPolicyOptions.Builder() + .authenticationAlgorithm("disabled") + .encryptionAlgorithm("aes128") + .pfs("disabled") + .keyLifetime(Long.valueOf("3600")) + .name("my-ipsec-policy") + .resourceGroup(resourceGroupIdentityModel) .build(); // Invoke operation - Response response = service.updateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptions).execute(); + Response response = service.createIpsecPolicy(createIpsecPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 201); - LoadBalancerListenerPolicyRule loadBalancerListenerPolicyRuleResult = response.getResult(); - assertNotNull(loadBalancerListenerPolicyRuleResult); + IPsecPolicy iPsecPolicyResult = response.getResult(); + assertNotNull(iPsecPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14251,21 +15000,21 @@ public void testUpdateLoadBalancerListenerPolicyRule() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateLoadBalancerListenerPolicyRule" }) - public void testListLoadBalancerPools() throws Exception { + @Test(dependsOnMethods = { "testCreateIpsecPolicy" }) + public void testGetIpsecPolicy() throws Exception { try { - ListLoadBalancerPoolsOptions listLoadBalancerPoolsOptions = new ListLoadBalancerPoolsOptions.Builder() - .loadBalancerId("testString") + GetIpsecPolicyOptions getIpsecPolicyOptions = new GetIpsecPolicyOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.listLoadBalancerPools(listLoadBalancerPoolsOptions).execute(); + Response response = service.getIpsecPolicy(getIpsecPolicyOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerPoolCollection loadBalancerPoolCollectionResult = response.getResult(); - assertNotNull(loadBalancerPoolCollectionResult); + IPsecPolicy iPsecPolicyResult = response.getResult(); + assertNotNull(iPsecPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14273,61 +15022,31 @@ public void testListLoadBalancerPools() throws Exception { } } - @Test(dependsOnMethods = { "testListLoadBalancerPools" }) - public void testCreateLoadBalancerPool() throws Exception { + @Test(dependsOnMethods = { "testGetIpsecPolicy" }) + public void testUpdateIpsecPolicy() throws Exception { try { - LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("tcp") - .build(); - - LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - LoadBalancerPoolFailsafePolicyPrototype loadBalancerPoolFailsafePolicyPrototypeModel = new LoadBalancerPoolFailsafePolicyPrototype.Builder() - .action("forward") - .target(loadBalancerPoolIdentityModel) - .build(); - - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") - .build(); - - LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); - - LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") + IPsecPolicyPatch iPsecPolicyPatchModel = new IPsecPolicyPatch.Builder() + .authenticationAlgorithm("disabled") + .encryptionAlgorithm("aes128") + .keyLifetime(Long.valueOf("3600")) + .name("my-ipsec-policy") + .pfs("disabled") .build(); + Map iPsecPolicyPatchModelAsPatch = iPsecPolicyPatchModel.asPatch(); - CreateLoadBalancerPoolOptions createLoadBalancerPoolOptions = new CreateLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .algorithm("least_connections") - .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .protocol("http") - .failsafePolicy(loadBalancerPoolFailsafePolicyPrototypeModel) - .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) - .name("my-load-balancer-pool") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + UpdateIpsecPolicyOptions updateIpsecPolicyOptions = new UpdateIpsecPolicyOptions.Builder() + .id("testString") + .iPsecPolicyPatch(iPsecPolicyPatchModelAsPatch) .build(); // Invoke operation - Response response = service.createLoadBalancerPool(createLoadBalancerPoolOptions).execute(); + Response response = service.updateIpsecPolicy(updateIpsecPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - LoadBalancerPool loadBalancerPoolResult = response.getResult(); - assertNotNull(loadBalancerPoolResult); + IPsecPolicy iPsecPolicyResult = response.getResult(); + assertNotNull(iPsecPolicyResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14335,22 +15054,23 @@ public void testCreateLoadBalancerPool() throws Exception { } } - @Test(dependsOnMethods = { "testCreateLoadBalancerPool" }) - public void testGetLoadBalancerPool() throws Exception { + @Test(dependsOnMethods = { "testUpdateIpsecPolicy" }) + public void testListIpsecPolicyConnections() throws Exception { try { - GetLoadBalancerPoolOptions getLoadBalancerPoolOptions = new GetLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") + ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions = new ListIpsecPolicyConnectionsOptions.Builder() .id("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); // Invoke operation - Response response = service.getLoadBalancerPool(getLoadBalancerPoolOptions).execute(); + Response response = service.listIpsecPolicyConnections(listIpsecPolicyConnectionsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerPool loadBalancerPoolResult = response.getResult(); - assertNotNull(loadBalancerPoolResult); + IPsecPolicyConnectionCollection iPsecPolicyConnectionCollectionResult = response.getResult(); + assertNotNull(iPsecPolicyConnectionCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14358,57 +15078,57 @@ public void testGetLoadBalancerPool() throws Exception { } } - @Test(dependsOnMethods = { "testGetLoadBalancerPool" }) - public void testUpdateLoadBalancerPool() throws Exception { + @Test(dependsOnMethods = { "testListIpsecPolicyConnections" }) + public void testListIpsecPolicyConnectionsWithPager() throws Exception { try { - LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById loadBalancerPoolFailsafePolicyTargetPatchModel = new LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - LoadBalancerPoolFailsafePolicyPatch loadBalancerPoolFailsafePolicyPatchModel = new LoadBalancerPoolFailsafePolicyPatch.Builder() - .action("forward") - .target(loadBalancerPoolFailsafePolicyTargetPatchModel) + ListIpsecPolicyConnectionsOptions options = new ListIpsecPolicyConnectionsOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) .build(); - LoadBalancerPoolHealthMonitorPatch loadBalancerPoolHealthMonitorPatchModel = new LoadBalancerPoolHealthMonitorPatch.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("http") - .urlPath("/") - .build(); + // Test getNext(). + List allResults = new ArrayList<>(); + IpsecPolicyConnectionsPager pager = new IpsecPolicyConnectionsPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - LoadBalancerPoolSessionPersistencePatch loadBalancerPoolSessionPersistencePatchModel = new LoadBalancerPoolSessionPersistencePatch.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") - .build(); + // Test getAll(); + pager = new IpsecPolicyConnectionsPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); - LoadBalancerPoolPatch loadBalancerPoolPatchModel = new LoadBalancerPoolPatch.Builder() - .algorithm("weighted_round_robin") - .failsafePolicy(loadBalancerPoolFailsafePolicyPatchModel) - .healthMonitor(loadBalancerPoolHealthMonitorPatchModel) - .name("my-load-balancer-pool") - .protocol("http") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePatchModel) - .build(); - Map loadBalancerPoolPatchModelAsPatch = loadBalancerPoolPatchModel.asPatch(); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - UpdateLoadBalancerPoolOptions updateLoadBalancerPoolOptions = new UpdateLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .id("testString") - .loadBalancerPoolPatch(loadBalancerPoolPatchModelAsPatch) + @Test(dependsOnMethods = { "testListIpsecPolicyConnections" }) + public void testListVpnGateways() throws Exception { + try { + ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("policy") .build(); // Invoke operation - Response response = service.updateLoadBalancerPool(updateLoadBalancerPoolOptions).execute(); + Response response = service.listVpnGateways(listVpnGatewaysOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerPool loadBalancerPoolResult = response.getResult(); - assertNotNull(loadBalancerPoolResult); + VPNGatewayCollection vpnGatewayCollectionResult = response.getResult(); + assertNotNull(vpnGatewayCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14416,52 +15136,72 @@ public void testUpdateLoadBalancerPool() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateLoadBalancerPool" }) - public void testListLoadBalancerPoolMembers() throws Exception { + @Test(dependsOnMethods = { "testListVpnGateways" }) + public void testListVpnGatewaysWithPager() throws Exception { try { - ListLoadBalancerPoolMembersOptions listLoadBalancerPoolMembersOptions = new ListLoadBalancerPoolMembersOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") + ListVpnGatewaysOptions options = new ListVpnGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("policy") .build(); - // Invoke operation - Response response = service.listLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + // Test getNext(). + List allResults = new ArrayList<>(); + VpnGatewaysPager pager = new VpnGatewaysPager(service, options); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertFalse(allResults.isEmpty()); - LoadBalancerPoolMemberCollection loadBalancerPoolMemberCollectionResult = response.getResult(); - assertNotNull(loadBalancerPoolMemberCollectionResult); + // Test getAll(); + pager = new VpnGatewaysPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListLoadBalancerPoolMembers" }) - public void testCreateLoadBalancerPoolMember() throws Exception { + @Test(dependsOnMethods = { "testListVpnGateways" }) + public void testCreateVpnGateway() throws Exception { try { - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - CreateLoadBalancerPoolMemberOptions createLoadBalancerPoolMemberOptions = new CreateLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + VPNGatewayPrototypeVPNGatewayRouteModePrototype vpnGatewayPrototypeModel = new VPNGatewayPrototypeVPNGatewayRouteModePrototype.Builder() + .name("my-vpn-gateway") + .resourceGroup(resourceGroupIdentityModel) + .subnet(subnetIdentityModel) + .advertisedCidrs(java.util.Arrays.asList("192.168.3.0/24")) + .localAsn(Long.valueOf("64520")) + .mode("route") + .build(); + + CreateVpnGatewayOptions createVpnGatewayOptions = new CreateVpnGatewayOptions.Builder() + .vpnGatewayPrototype(vpnGatewayPrototypeModel) .build(); // Invoke operation - Response response = service.createLoadBalancerPoolMember(createLoadBalancerPoolMemberOptions).execute(); + Response response = service.createVpnGateway(createVpnGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); - assertNotNull(loadBalancerPoolMemberResult); + VPNGateway vpnGatewayResult = response.getResult(); + assertNotNull(vpnGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14469,33 +15209,21 @@ public void testCreateLoadBalancerPoolMember() throws Exception { } } - @Test(dependsOnMethods = { "testCreateLoadBalancerPoolMember" }) - public void testReplaceLoadBalancerPoolMembers() throws Exception { + @Test(dependsOnMethods = { "testCreateVpnGateway" }) + public void testGetVpnGateway() throws Exception { try { - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") - .build(); - - LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); - - ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptions = new ReplaceLoadBalancerPoolMembersOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + GetVpnGatewayOptions getVpnGatewayOptions = new GetVpnGatewayOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.replaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptions).execute(); + Response response = service.getVpnGateway(getVpnGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerPoolMemberCollection loadBalancerPoolMemberCollectionResult = response.getResult(); - assertNotNull(loadBalancerPoolMemberCollectionResult); + VPNGateway vpnGatewayResult = response.getResult(); + assertNotNull(vpnGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14503,23 +15231,28 @@ public void testReplaceLoadBalancerPoolMembers() throws Exception { } } - @Test(dependsOnMethods = { "testReplaceLoadBalancerPoolMembers" }) - public void testGetLoadBalancerPoolMember() throws Exception { + @Test(dependsOnMethods = { "testGetVpnGateway" }) + public void testUpdateVpnGateway() throws Exception { try { - GetLoadBalancerPoolMemberOptions getLoadBalancerPoolMemberOptions = new GetLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") + VPNGatewayPatch vpnGatewayPatchModel = new VPNGatewayPatch.Builder() + .localAsn(Long.valueOf("64520")) + .name("my-vpn-gateway-updated") + .build(); + Map vpnGatewayPatchModelAsPatch = vpnGatewayPatchModel.asPatch(); + + UpdateVpnGatewayOptions updateVpnGatewayOptions = new UpdateVpnGatewayOptions.Builder() .id("testString") + .vpnGatewayPatch(vpnGatewayPatchModelAsPatch) .build(); // Invoke operation - Response response = service.getLoadBalancerPoolMember(getLoadBalancerPoolMemberOptions).execute(); + Response response = service.updateVpnGateway(updateVpnGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); - assertNotNull(loadBalancerPoolMemberResult); + VPNGateway vpnGatewayResult = response.getResult(); + assertNotNull(vpnGatewayResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14527,65 +15260,84 @@ public void testGetLoadBalancerPoolMember() throws Exception { } } - @Test(dependsOnMethods = { "testGetLoadBalancerPoolMember" }) - public void testUpdateLoadBalancerPoolMember() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpnGateway" }) + public void testListVpnGatewayAdvertisedCidrs() throws Exception { try { - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") + ListVpnGatewayAdvertisedCidrsOptions listVpnGatewayAdvertisedCidrsOptions = new ListVpnGatewayAdvertisedCidrsOptions.Builder() + .vpnGatewayId("testString") .build(); - LoadBalancerPoolMemberPatch loadBalancerPoolMemberPatchModel = new LoadBalancerPoolMemberPatch.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("99")) - .build(); - Map loadBalancerPoolMemberPatchModelAsPatch = loadBalancerPoolMemberPatchModel.asPatch(); + // Invoke operation + Response response = service.listVpnGatewayAdvertisedCidrs(listVpnGatewayAdvertisedCidrsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); - UpdateLoadBalancerPoolMemberOptions updateLoadBalancerPoolMemberOptions = new UpdateLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .id("testString") - .loadBalancerPoolMemberPatch(loadBalancerPoolMemberPatchModelAsPatch) + VPNGatewayAdvertisedCIDRCollection vpnGatewayAdvertisedCidrCollectionResult = response.getResult(); + assertNotNull(vpnGatewayAdvertisedCidrCollectionResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVpnGatewayAdvertisedCidrs" }) + public void testCheckVpnGatewayAdvertisedCidr() throws Exception { + try { + CheckVpnGatewayAdvertisedCidrOptions checkVpnGatewayAdvertisedCidrOptions = new CheckVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.3.0/24") .build(); // Invoke operation - Response response = service.updateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptions).execute(); + Response response = service.checkVpnGatewayAdvertisedCidr(checkVpnGatewayAdvertisedCidrOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - LoadBalancerPoolMember loadBalancerPoolMemberResult = response.getResult(); - assertNotNull(loadBalancerPoolMemberResult); + @Test(dependsOnMethods = { "testCheckVpnGatewayAdvertisedCidr" }) + public void testAddVpnGatewayAdvertisedCidr() throws Exception { + try { + AddVpnGatewayAdvertisedCidrOptions addVpnGatewayAdvertisedCidrOptions = new AddVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.3.0/24") + .build(); + // Invoke operation + Response response = service.addVpnGatewayAdvertisedCidr(addVpnGatewayAdvertisedCidrOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateLoadBalancerPoolMember" }) - public void testListEndpointGateways() throws Exception { + @Test(dependsOnMethods = { "testAddVpnGatewayAdvertisedCidr" }) + public void testListVpnGatewayConnections() throws Exception { try { - ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() - .name("my-name") + ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions = new ListVpnGatewayConnectionsOptions.Builder() + .vpnGatewayId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .lifecycleState(java.util.Arrays.asList("stable")) - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .allowDnsResolutionBinding(true) + .status("down") .build(); // Invoke operation - Response response = service.listEndpointGateways(listEndpointGatewaysOptions).execute(); + Response response = service.listVpnGatewayConnections(listVpnGatewayConnectionsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - EndpointGatewayCollection endpointGatewayCollectionResult = response.getResult(); - assertNotNull(endpointGatewayCollectionResult); + VPNGatewayConnectionCollection vpnGatewayConnectionCollectionResult = response.getResult(); + assertNotNull(vpnGatewayConnectionCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14593,33 +15345,28 @@ public void testListEndpointGateways() throws Exception { } } - @Test(dependsOnMethods = { "testListEndpointGateways" }) - public void testListEndpointGatewaysWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpnGatewayConnections" }) + public void testListVpnGatewayConnectionsWithPager() throws Exception { try { - ListEndpointGatewaysOptions options = new ListEndpointGatewaysOptions.Builder() - .name("my-name") + ListVpnGatewayConnectionsOptions options = new ListVpnGatewayConnectionsOptions.Builder() + .vpnGatewayId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .lifecycleState(java.util.Arrays.asList("stable")) - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .allowDnsResolutionBinding(true) + .status("down") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - EndpointGatewaysPager pager = new EndpointGatewaysPager(service, options); + List allResults = new ArrayList<>(); + VpnGatewayConnectionsPager pager = new VpnGatewayConnectionsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new EndpointGatewaysPager(service, options); - List allItems = pager.getAll(); + pager = new VpnGatewayConnectionsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -14631,48 +15378,64 @@ public void testListEndpointGatewaysWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListEndpointGateways" }) - public void testCreateEndpointGateway() throws Exception { + @Test(dependsOnMethods = { "testListVpnGatewayConnections" }) + public void testCreateVpnGatewayConnection() throws Exception { try { - EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype endpointGatewayTargetPrototypeModel = new EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype.Builder() - .name("ibm-ntp-server") - .resourceType("provider_infrastructure_service") + VPNGatewayConnectionDPDPrototype vpnGatewayConnectionDpdPrototypeModel = new VPNGatewayConnectionDPDPrototype.Builder() + .action("restart") + .interval(Long.valueOf("30")) + .timeout(Long.valueOf("120")) .build(); - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPrototypeModel = new VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.Builder() + .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") .build(); - EndpointGatewayReservedIPReservedIPIdentityById endpointGatewayReservedIpModel = new EndpointGatewayReservedIPReservedIPIdentityById.Builder() - .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPrototypeModel = new VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.Builder() + .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") .build(); - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN vpnGatewayConnectionIkeIdentityPrototypeModel = new VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN.Builder() + .type("fqdn") + .value("my-service.example.com") .build(); - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + VPNGatewayConnectionStaticRouteModeLocalPrototype vpnGatewayConnectionStaticRouteModeLocalPrototypeModel = new VPNGatewayConnectionStaticRouteModeLocalPrototype.Builder() + .ikeIdentities(java.util.Arrays.asList(vpnGatewayConnectionIkeIdentityPrototypeModel)) .build(); - CreateEndpointGatewayOptions createEndpointGatewayOptions = new CreateEndpointGatewayOptions.Builder() - .target(endpointGatewayTargetPrototypeModel) - .vpc(vpcIdentityModel) - .allowDnsResolutionBinding(true) - .ips(java.util.Arrays.asList(endpointGatewayReservedIpModel)) - .name("testString") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress vpnGatewayConnectionStaticRouteModePeerPrototypeModel = new VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.Builder() + .ikeIdentity(vpnGatewayConnectionIkeIdentityPrototypeModel) + .address("192.0.2.5") + .build(); + + VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype vpnGatewayConnectionPrototypeModel = new VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.Builder() + .adminStateUp(true) + .deadPeerDetection(vpnGatewayConnectionDpdPrototypeModel) + .establishMode("bidirectional") + .ikePolicy(vpnGatewayConnectionIkePolicyPrototypeModel) + .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPrototypeModel) + .name("my-vpn-gateway-connection") + .psk("lkj14b1oi0alcniejkso") + .distributeTraffic(false) + .local(vpnGatewayConnectionStaticRouteModeLocalPrototypeModel) + .peer(vpnGatewayConnectionStaticRouteModePeerPrototypeModel) + .routingProtocol("none") + .build(); + + CreateVpnGatewayConnectionOptions createVpnGatewayConnectionOptions = new CreateVpnGatewayConnectionOptions.Builder() + .vpnGatewayId("testString") + .vpnGatewayConnectionPrototype(vpnGatewayConnectionPrototypeModel) .build(); // Invoke operation - Response response = service.createEndpointGateway(createEndpointGatewayOptions).execute(); + Response response = service.createVpnGatewayConnection(createVpnGatewayConnectionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - EndpointGateway endpointGatewayResult = response.getResult(); - assertNotNull(endpointGatewayResult); + VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); + assertNotNull(vpnGatewayConnectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14680,24 +15443,22 @@ public void testCreateEndpointGateway() throws Exception { } } - @Test(dependsOnMethods = { "testCreateEndpointGateway" }) - public void testListEndpointGatewayIps() throws Exception { + @Test(dependsOnMethods = { "testCreateVpnGatewayConnection" }) + public void testGetVpnGatewayConnection() throws Exception { try { - ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() - .endpointGatewayId("testString") - .start("testString") - .limit(Long.valueOf("10")) - .sort("name") + GetVpnGatewayConnectionOptions getVpnGatewayConnectionOptions = new GetVpnGatewayConnectionOptions.Builder() + .vpnGatewayId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.listEndpointGatewayIps(listEndpointGatewayIpsOptions).execute(); + Response response = service.getVpnGatewayConnection(getVpnGatewayConnectionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - ReservedIPCollectionEndpointGatewayContext reservedIpCollectionEndpointGatewayContextResult = response.getResult(); - assertNotNull(reservedIpCollectionEndpointGatewayContextResult); + VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); + assertNotNull(vpnGatewayConnectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14705,78 +15466,152 @@ public void testListEndpointGatewayIps() throws Exception { } } - @Test(dependsOnMethods = { "testListEndpointGatewayIps" }) - public void testListEndpointGatewayIpsWithPager() throws Exception { + @Test(dependsOnMethods = { "testGetVpnGatewayConnection" }) + public void testUpdateVpnGatewayConnection() throws Exception { try { - ListEndpointGatewayIpsOptions options = new ListEndpointGatewayIpsOptions.Builder() - .endpointGatewayId("testString") - .limit(Long.valueOf("10")) - .sort("name") + VPNGatewayConnectionDPDPatch vpnGatewayConnectionDpdPatchModel = new VPNGatewayConnectionDPDPatch.Builder() + .action("restart") + .interval(Long.valueOf("30")) + .timeout(Long.valueOf("120")) .build(); - // Test getNext(). - List allResults = new ArrayList<>(); - EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(service, options); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertFalse(allResults.isEmpty()); + VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPatchModel = new VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.Builder() + .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") + .build(); - // Test getAll(); - pager = new EndpointGatewayIpsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); + VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPatchModel = new VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.Builder() + .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") + .build(); - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); + VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch vpnGatewayConnectionPeerPatchModel = new VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch.Builder() + .address("192.0.2.5") + .build(); + + IP ipModel = new IP.Builder() + .address("169.254.0.2") + .build(); + + VPNGatewayConnectionTunnel vpnGatewayConnectionTunnelModel = new VPNGatewayConnectionTunnel.Builder() + .neighborIp(ipModel) + .tunnelInterfaceIp(ipModel) + .build(); + + VPNGatewayConnectionPatch vpnGatewayConnectionPatchModel = new VPNGatewayConnectionPatch.Builder() + .adminStateUp(true) + .deadPeerDetection(vpnGatewayConnectionDpdPatchModel) + .distributeTraffic(true) + .establishMode("bidirectional") + .ikePolicy(vpnGatewayConnectionIkePolicyPatchModel) + .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPatchModel) + .name("my-vpn-gateway-connection") + .peer(vpnGatewayConnectionPeerPatchModel) + .psk("lkj14b1oi0alcniejkso") + .routingProtocol("bgp") + .tunnels(java.util.Arrays.asList(vpnGatewayConnectionTunnelModel)) + .build(); + Map vpnGatewayConnectionPatchModelAsPatch = vpnGatewayConnectionPatchModel.asPatch(); + + UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOptions = new UpdateVpnGatewayConnectionOptions.Builder() + .vpnGatewayId("testString") + .id("testString") + .vpnGatewayConnectionPatch(vpnGatewayConnectionPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); + + // Invoke operation + Response response = service.updateVpnGatewayConnection(updateVpnGatewayConnectionOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + VPNGatewayConnection vpnGatewayConnectionResult = response.getResult(); + assertNotNull(vpnGatewayConnectionResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testUpdateVpnGatewayConnection" }) + public void testListVpnGatewayConnectionsLocalCidrs() throws Exception { + try { + ListVpnGatewayConnectionsLocalCidrsOptions listVpnGatewayConnectionsLocalCidrsOptions = new ListVpnGatewayConnectionsLocalCidrsOptions.Builder() + .vpnGatewayId("testString") + .id("testString") + .build(); + + // Invoke operation + Response response = service.listVpnGatewayConnectionsLocalCidrs(listVpnGatewayConnectionsLocalCidrsOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + VPNGatewayConnectionCIDRs vpnGatewayConnectionCidRsResult = response.getResult(); + assertNotNull(vpnGatewayConnectionCidRsResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testListVpnGatewayConnectionsLocalCidrs" }) + public void testCheckVpnGatewayConnectionsLocalCidr() throws Exception { + try { + CheckVpnGatewayConnectionsLocalCidrOptions checkVpnGatewayConnectionsLocalCidrOptions = new CheckVpnGatewayConnectionsLocalCidrOptions.Builder() + .vpnGatewayId("testString") + .id("testString") + .cidr("192.168.3.0/24") + .build(); + + // Invoke operation + Response response = service.checkVpnGatewayConnectionsLocalCidr(checkVpnGatewayConnectionsLocalCidrOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testListEndpointGatewayIps" }) - public void testGetEndpointGatewayIp() throws Exception { + @Test(dependsOnMethods = { "testCheckVpnGatewayConnectionsLocalCidr" }) + public void testAddVpnGatewayConnectionsLocalCidr() throws Exception { try { - GetEndpointGatewayIpOptions getEndpointGatewayIpOptions = new GetEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") + AddVpnGatewayConnectionsLocalCidrOptions addVpnGatewayConnectionsLocalCidrOptions = new AddVpnGatewayConnectionsLocalCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .cidr("192.168.3.0/24") .build(); // Invoke operation - Response response = service.getEndpointGatewayIp(getEndpointGatewayIpOptions).execute(); + Response response = service.addVpnGatewayConnectionsLocalCidr(addVpnGatewayConnectionsLocalCidrOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - ReservedIP reservedIpResult = response.getResult(); - assertNotNull(reservedIpResult); - + assertEquals(response.getStatusCode(), 201); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetEndpointGatewayIp" }) - public void testAddEndpointGatewayIp() throws Exception { + @Test(dependsOnMethods = { "testAddVpnGatewayConnectionsLocalCidr" }) + public void testListVpnGatewayConnectionsPeerCidrs() throws Exception { try { - AddEndpointGatewayIpOptions addEndpointGatewayIpOptions = new AddEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") + ListVpnGatewayConnectionsPeerCidrsOptions listVpnGatewayConnectionsPeerCidrsOptions = new ListVpnGatewayConnectionsPeerCidrsOptions.Builder() + .vpnGatewayId("testString") .id("testString") .build(); // Invoke operation - Response response = service.addEndpointGatewayIp(addEndpointGatewayIpOptions).execute(); + Response response = service.listVpnGatewayConnectionsPeerCidrs(listVpnGatewayConnectionsPeerCidrsOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 201); + assertEquals(response.getStatusCode(), 200); - ReservedIP reservedIpResult = response.getResult(); - assertNotNull(reservedIpResult); + VPNGatewayConnectionCIDRs vpnGatewayConnectionCidRsResult = response.getResult(); + assertNotNull(vpnGatewayConnectionCidRsResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14784,80 +15619,63 @@ public void testAddEndpointGatewayIp() throws Exception { } } - @Test(dependsOnMethods = { "testAddEndpointGatewayIp" }) - public void testGetEndpointGateway() throws Exception { + @Test(dependsOnMethods = { "testListVpnGatewayConnectionsPeerCidrs" }) + public void testCheckVpnGatewayConnectionsPeerCidr() throws Exception { try { - GetEndpointGatewayOptions getEndpointGatewayOptions = new GetEndpointGatewayOptions.Builder() + CheckVpnGatewayConnectionsPeerCidrOptions checkVpnGatewayConnectionsPeerCidrOptions = new CheckVpnGatewayConnectionsPeerCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .cidr("192.168.3.0/24") .build(); // Invoke operation - Response response = service.getEndpointGateway(getEndpointGatewayOptions).execute(); + Response response = service.checkVpnGatewayConnectionsPeerCidr(checkVpnGatewayConnectionsPeerCidrOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - EndpointGateway endpointGatewayResult = response.getResult(); - assertNotNull(endpointGatewayResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetEndpointGateway" }) - public void testUpdateEndpointGateway() throws Exception { + @Test(dependsOnMethods = { "testCheckVpnGatewayConnectionsPeerCidr" }) + public void testAddVpnGatewayConnectionsPeerCidr() throws Exception { try { - EndpointGatewayPatch endpointGatewayPatchModel = new EndpointGatewayPatch.Builder() - .allowDnsResolutionBinding(false) - .name("my-endpoint-gateway") - .build(); - Map endpointGatewayPatchModelAsPatch = endpointGatewayPatchModel.asPatch(); - - UpdateEndpointGatewayOptions updateEndpointGatewayOptions = new UpdateEndpointGatewayOptions.Builder() + AddVpnGatewayConnectionsPeerCidrOptions addVpnGatewayConnectionsPeerCidrOptions = new AddVpnGatewayConnectionsPeerCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") - .endpointGatewayPatch(endpointGatewayPatchModelAsPatch) + .cidr("192.168.3.0/24") .build(); // Invoke operation - Response response = service.updateEndpointGateway(updateEndpointGatewayOptions).execute(); + Response response = service.addVpnGatewayConnectionsPeerCidr(addVpnGatewayConnectionsPeerCidrOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - EndpointGateway endpointGatewayResult = response.getResult(); - assertNotNull(endpointGatewayResult); - + assertEquals(response.getStatusCode(), 201); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdateEndpointGateway" }) - public void testListFlowLogCollectors() throws Exception { + @Test(dependsOnMethods = { "testAddVpnGatewayConnectionsPeerCidr" }) + public void testListVpnGatewayServiceConnections() throws Exception { try { - ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() + ListVpnGatewayServiceConnectionsOptions listVpnGatewayServiceConnectionsOptions = new ListVpnGatewayServiceConnectionsOptions.Builder() + .vpnGatewayId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .targetId("testString") - .targetResourceType("testString") .build(); // Invoke operation - Response response = service.listFlowLogCollectors(listFlowLogCollectorsOptions).execute(); + Response response = service.listVpnGatewayServiceConnections(listVpnGatewayServiceConnectionsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FlowLogCollectorCollection flowLogCollectorCollectionResult = response.getResult(); - assertNotNull(flowLogCollectorCollectionResult); + VPNGatewayServiceConnectionCollection vpnGatewayServiceConnectionCollectionResult = response.getResult(); + assertNotNull(vpnGatewayServiceConnectionCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14865,33 +15683,27 @@ public void testListFlowLogCollectors() throws Exception { } } - @Test(dependsOnMethods = { "testListFlowLogCollectors" }) - public void testListFlowLogCollectorsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpnGatewayServiceConnections" }) + public void testListVpnGatewayServiceConnectionsWithPager() throws Exception { try { - ListFlowLogCollectorsOptions options = new ListFlowLogCollectorsOptions.Builder() + ListVpnGatewayServiceConnectionsOptions options = new ListVpnGatewayServiceConnectionsOptions.Builder() + .vpnGatewayId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .targetId("testString") - .targetResourceType("testString") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - FlowLogCollectorsPager pager = new FlowLogCollectorsPager(service, options); + List allResults = new ArrayList<>(); + VpnGatewayServiceConnectionsPager pager = new VpnGatewayServiceConnectionsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new FlowLogCollectorsPager(service, options); - List allItems = pager.getAll(); + pager = new VpnGatewayServiceConnectionsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -14903,88 +15715,22 @@ public void testListFlowLogCollectorsWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListFlowLogCollectors" }) - public void testCreateFlowLogCollector() throws Exception { - try { - LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName legacyCloudObjectStorageBucketIdentityModel = new LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() - .name("bucket-27200-lwx4cfvcue") - .build(); - - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById flowLogCollectorTargetPrototypeModel = new FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.Builder() - .id("0717-d54eb633-98ea-459d-aa00-6a8e780175a7") - .build(); - - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - CreateFlowLogCollectorOptions createFlowLogCollectorOptions = new CreateFlowLogCollectorOptions.Builder() - .storageBucket(legacyCloudObjectStorageBucketIdentityModel) - .target(flowLogCollectorTargetPrototypeModel) - .active(false) - .name("my-flow-log-collector") - .resourceGroup(resourceGroupIdentityModel) - .build(); - - // Invoke operation - Response response = service.createFlowLogCollector(createFlowLogCollectorOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - FlowLogCollector flowLogCollectorResult = response.getResult(); - assertNotNull(flowLogCollectorResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreateFlowLogCollector" }) - public void testGetFlowLogCollector() throws Exception { - try { - GetFlowLogCollectorOptions getFlowLogCollectorOptions = new GetFlowLogCollectorOptions.Builder() - .id("testString") - .build(); - - // Invoke operation - Response response = service.getFlowLogCollector(getFlowLogCollectorOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - FlowLogCollector flowLogCollectorResult = response.getResult(); - assertNotNull(flowLogCollectorResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testGetFlowLogCollector" }) - public void testUpdateFlowLogCollector() throws Exception { + @Test(dependsOnMethods = { "testListVpnGatewayServiceConnections" }) + public void testGetVpnGatewayServiceConnection() throws Exception { try { - FlowLogCollectorPatch flowLogCollectorPatchModel = new FlowLogCollectorPatch.Builder() - .active(false) - .name("my-flow-log-collector") - .build(); - Map flowLogCollectorPatchModelAsPatch = flowLogCollectorPatchModel.asPatch(); - - UpdateFlowLogCollectorOptions updateFlowLogCollectorOptions = new UpdateFlowLogCollectorOptions.Builder() + GetVpnGatewayServiceConnectionOptions getVpnGatewayServiceConnectionOptions = new GetVpnGatewayServiceConnectionOptions.Builder() + .vpnGatewayId("testString") .id("testString") - .flowLogCollectorPatch(flowLogCollectorPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updateFlowLogCollector(updateFlowLogCollectorOptions).execute(); + Response response = service.getVpnGatewayServiceConnection(getVpnGatewayServiceConnectionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - FlowLogCollector flowLogCollectorResult = response.getResult(); - assertNotNull(flowLogCollectorResult); + VPNGatewayServiceConnection vpnGatewayServiceConnectionResult = response.getResult(); + assertNotNull(vpnGatewayServiceConnectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -14992,23 +15738,25 @@ public void testUpdateFlowLogCollector() throws Exception { } } - @Test(dependsOnMethods = { "testUpdateFlowLogCollector" }) - public void testListPrivatePathServiceGateways() throws Exception { + @Test(dependsOnMethods = { "testGetVpnGatewayServiceConnection" }) + public void testListVpnServers() throws Exception { try { - ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptions = new ListPrivatePathServiceGatewaysOptions.Builder() + ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() + .name("my-name") .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .sort("name") .build(); // Invoke operation - Response response = service.listPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptions).execute(); + Response response = service.listVpnServers(listVpnServersOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PrivatePathServiceGatewayCollection privatePathServiceGatewayCollectionResult = response.getResult(); - assertNotNull(privatePathServiceGatewayCollectionResult); + VPNServerCollection vpnServerCollectionResult = response.getResult(); + assertNotNull(vpnServerCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -15016,27 +15764,29 @@ public void testListPrivatePathServiceGateways() throws Exception { } } - @Test(dependsOnMethods = { "testListPrivatePathServiceGateways" }) - public void testListPrivatePathServiceGatewaysWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpnServers" }) + public void testListVpnServersWithPager() throws Exception { try { - ListPrivatePathServiceGatewaysOptions options = new ListPrivatePathServiceGatewaysOptions.Builder() + ListVpnServersOptions options = new ListVpnServersOptions.Builder() + .name("my-name") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .sort("name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - PrivatePathServiceGatewaysPager pager = new PrivatePathServiceGatewaysPager(service, options); + List allResults = new ArrayList<>(); + VpnServersPager pager = new VpnServersPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new PrivatePathServiceGatewaysPager(service, options); - List allItems = pager.getAll(); + pager = new VpnServersPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -15048,34 +15798,61 @@ public void testListPrivatePathServiceGatewaysWithPager() throws Exception { } } - @Test(dependsOnMethods = { "testListPrivatePathServiceGateways" }) - public void testCreatePrivatePathServiceGateway() throws Exception { + @Test(dependsOnMethods = { "testListVpnServers" }) + public void testCreateVpnServer() throws Exception { try { - LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() - .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); + + VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() + .providerType("iam") + .build(); + + VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() + .method("certificate") + .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + IP ipModel = new IP.Builder() + .address("192.168.3.4") .build(); ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - CreatePrivatePathServiceGatewayOptions createPrivatePathServiceGatewayOptions = new CreatePrivatePathServiceGatewayOptions.Builder() - .loadBalancer(loadBalancerIdentityModel) - .serviceEndpoints(java.util.Arrays.asList("*.example.com")) - .defaultAccessPolicy("deny") - .name("my-private-path-service-gateway") + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + CreateVpnServerOptions createVpnServerOptions = new CreateVpnServerOptions.Builder() + .certificate(certificateInstanceIdentityModel) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientIpPool("172.16.0.0/16") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) + .clientIdleTimeout(Long.valueOf("600")) + .enableSplitTunneling(false) + .name("my-vpn-server") + .port(Long.valueOf("443")) + .protocol("udp") .resourceGroup(resourceGroupIdentityModel) - .zonalAffinity(false) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); // Invoke operation - Response response = service.createPrivatePathServiceGateway(createPrivatePathServiceGatewayOptions).execute(); + Response response = service.createVpnServer(createVpnServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 201); - PrivatePathServiceGateway privatePathServiceGatewayResult = response.getResult(); - assertNotNull(privatePathServiceGatewayResult); + VPNServer vpnServerResult = response.getResult(); + assertNotNull(vpnServerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -15083,21 +15860,21 @@ public void testCreatePrivatePathServiceGateway() throws Exception { } } - @Test(dependsOnMethods = { "testCreatePrivatePathServiceGateway" }) - public void testGetPrivatePathServiceGateway() throws Exception { + @Test(dependsOnMethods = { "testCreateVpnServer" }) + public void testGetVpnServer() throws Exception { try { - GetPrivatePathServiceGatewayOptions getPrivatePathServiceGatewayOptions = new GetPrivatePathServiceGatewayOptions.Builder() + GetVpnServerOptions getVpnServerOptions = new GetVpnServerOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.getPrivatePathServiceGateway(getPrivatePathServiceGatewayOptions).execute(); + Response response = service.getVpnServer(getVpnServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PrivatePathServiceGateway privatePathServiceGatewayResult = response.getResult(); - assertNotNull(privatePathServiceGatewayResult); + VPNServer vpnServerResult = response.getResult(); + assertNotNull(vpnServerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -15105,34 +15882,58 @@ public void testGetPrivatePathServiceGateway() throws Exception { } } - @Test(dependsOnMethods = { "testGetPrivatePathServiceGateway" }) - public void testUpdatePrivatePathServiceGateway() throws Exception { + @Test(dependsOnMethods = { "testGetVpnServer" }) + public void testUpdateVpnServer() throws Exception { try { - LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() - .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") .build(); - PrivatePathServiceGatewayPatch privatePathServiceGatewayPatchModel = new PrivatePathServiceGatewayPatch.Builder() - .defaultAccessPolicy("deny") - .loadBalancer(loadBalancerIdentityModel) - .name("my-private-path-service-gateway") - .zonalAffinity(true) + VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() + .providerType("iam") .build(); - Map privatePathServiceGatewayPatchModelAsPatch = privatePathServiceGatewayPatchModel.asPatch(); - UpdatePrivatePathServiceGatewayOptions updatePrivatePathServiceGatewayOptions = new UpdatePrivatePathServiceGatewayOptions.Builder() + VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() + .method("certificate") + .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) + .build(); + + IP ipModel = new IP.Builder() + .address("192.168.3.4") + .build(); + + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + VPNServerPatch vpnServerPatchModel = new VPNServerPatch.Builder() + .certificate(certificateInstanceIdentityModel) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) + .clientIdleTimeout(Long.valueOf("600")) + .clientIpPool("172.16.0.0/16") + .enableSplitTunneling(true) + .name("my-vpn-server-updated") + .port(Long.valueOf("443")) + .protocol("tcp") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .build(); + Map vpnServerPatchModelAsPatch = vpnServerPatchModel.asPatch(); + + UpdateVpnServerOptions updateVpnServerOptions = new UpdateVpnServerOptions.Builder() .id("testString") - .privatePathServiceGatewayPatch(privatePathServiceGatewayPatchModelAsPatch) + .vpnServerPatch(vpnServerPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.updatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptions).execute(); + Response response = service.updateVpnServer(updateVpnServerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PrivatePathServiceGateway privatePathServiceGatewayResult = response.getResult(); - assertNotNull(privatePathServiceGatewayResult); + VPNServer vpnServerResult = response.getResult(); + assertNotNull(vpnServerResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -15140,24 +15941,46 @@ public void testUpdatePrivatePathServiceGateway() throws Exception { } } - @Test(dependsOnMethods = { "testUpdatePrivatePathServiceGateway" }) - public void testListPrivatePathServiceGatewayAccountPolicies() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpnServer" }) + public void testGetVpnServerClientConfiguration() throws Exception { try { - ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptions = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() - .privatePathServiceGatewayId("testString") + GetVpnServerClientConfigurationOptions getVpnServerClientConfigurationOptions = new GetVpnServerClientConfigurationOptions.Builder() + .id("testString") + .build(); + + // Invoke operation + Response response = service.getVpnServerClientConfiguration(getVpnServerClientConfigurationOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 200); + + String resultResult = response.getResult(); + assertNotNull(resultResult); + + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testGetVpnServerClientConfiguration" }) + public void testListVpnServerClients() throws Exception { + try { + ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() + .vpnServerId("testString") .start("testString") .limit(Long.valueOf("10")) - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("created_at") .build(); // Invoke operation - Response response = service.listPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptions).execute(); + Response response = service.listVpnServerClients(listVpnServerClientsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PrivatePathServiceGatewayAccountPolicyCollection privatePathServiceGatewayAccountPolicyCollectionResult = response.getResult(); - assertNotNull(privatePathServiceGatewayAccountPolicyCollectionResult); + VPNServerClientCollection vpnServerClientCollectionResult = response.getResult(); + assertNotNull(vpnServerClientCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -15165,28 +15988,28 @@ public void testListPrivatePathServiceGatewayAccountPolicies() throws Exception } } - @Test(dependsOnMethods = { "testListPrivatePathServiceGatewayAccountPolicies" }) - public void testListPrivatePathServiceGatewayAccountPoliciesWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpnServerClients" }) + public void testListVpnServerClientsWithPager() throws Exception { try { - ListPrivatePathServiceGatewayAccountPoliciesOptions options = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() - .privatePathServiceGatewayId("testString") + ListVpnServerClientsOptions options = new ListVpnServerClientsOptions.Builder() + .vpnServerId("testString") .limit(Long.valueOf("10")) - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("created_at") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - PrivatePathServiceGatewayAccountPoliciesPager pager = new PrivatePathServiceGatewayAccountPoliciesPager(service, options); + List allResults = new ArrayList<>(); + VpnServerClientsPager pager = new VpnServerClientsPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new PrivatePathServiceGatewayAccountPoliciesPager(service, options); - List allItems = pager.getAll(); + pager = new VpnServerClientsPager(service, options); + List allItems = pager.getAll(); assertNotNull(allItems); assertFalse(allItems.isEmpty()); @@ -15198,50 +16021,22 @@ public void testListPrivatePathServiceGatewayAccountPoliciesWithPager() throws E } } - @Test(dependsOnMethods = { "testListPrivatePathServiceGatewayAccountPolicies" }) - public void testCreatePrivatePathServiceGatewayAccountPolicy() throws Exception { - try { - AccountIdentityById accountIdentityModel = new AccountIdentityById.Builder() - .id("bb1b52262f7441a586f49068482f1e60") - .build(); - - CreatePrivatePathServiceGatewayAccountPolicyOptions createPrivatePathServiceGatewayAccountPolicyOptions = new CreatePrivatePathServiceGatewayAccountPolicyOptions.Builder() - .privatePathServiceGatewayId("testString") - .accessPolicy("deny") - .account(accountIdentityModel) - .build(); - - // Invoke operation - Response response = service.createPrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 201); - - PrivatePathServiceGatewayAccountPolicy privatePathServiceGatewayAccountPolicyResult = response.getResult(); - assertNotNull(privatePathServiceGatewayAccountPolicyResult); - - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testCreatePrivatePathServiceGatewayAccountPolicy" }) - public void testGetPrivatePathServiceGatewayAccountPolicy() throws Exception { + @Test(dependsOnMethods = { "testListVpnServerClients" }) + public void testGetVpnServerClient() throws Exception { try { - GetPrivatePathServiceGatewayAccountPolicyOptions getPrivatePathServiceGatewayAccountPolicyOptions = new GetPrivatePathServiceGatewayAccountPolicyOptions.Builder() - .privatePathServiceGatewayId("testString") + GetVpnServerClientOptions getVpnServerClientOptions = new GetVpnServerClientOptions.Builder() + .vpnServerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.getPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptions).execute(); + Response response = service.getVpnServerClient(getVpnServerClientOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PrivatePathServiceGatewayAccountPolicy privatePathServiceGatewayAccountPolicyResult = response.getResult(); - assertNotNull(privatePathServiceGatewayAccountPolicyResult); + VPNServerClient vpnServerClientResult = response.getResult(); + assertNotNull(vpnServerClientResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -15249,54 +16044,43 @@ public void testGetPrivatePathServiceGatewayAccountPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testGetPrivatePathServiceGatewayAccountPolicy" }) - public void testUpdatePrivatePathServiceGatewayAccountPolicy() throws Exception { + @Test(dependsOnMethods = { "testGetVpnServerClient" }) + public void testDisconnectVpnClient() throws Exception { try { - PrivatePathServiceGatewayAccountPolicyPatch privatePathServiceGatewayAccountPolicyPatchModel = new PrivatePathServiceGatewayAccountPolicyPatch.Builder() - .accessPolicy("review") - .build(); - Map privatePathServiceGatewayAccountPolicyPatchModelAsPatch = privatePathServiceGatewayAccountPolicyPatchModel.asPatch(); - - UpdatePrivatePathServiceGatewayAccountPolicyOptions updatePrivatePathServiceGatewayAccountPolicyOptions = new UpdatePrivatePathServiceGatewayAccountPolicyOptions.Builder() - .privatePathServiceGatewayId("testString") + DisconnectVpnClientOptions disconnectVpnClientOptions = new DisconnectVpnClientOptions.Builder() + .vpnServerId("testString") .id("testString") - .privatePathServiceGatewayAccountPolicyPatch(privatePathServiceGatewayAccountPolicyPatchModelAsPatch) .build(); // Invoke operation - Response response = service.updatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptions).execute(); + Response response = service.disconnectVpnClient(disconnectVpnClientOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - PrivatePathServiceGatewayAccountPolicy privatePathServiceGatewayAccountPolicyResult = response.getResult(); - assertNotNull(privatePathServiceGatewayAccountPolicyResult); - + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUpdatePrivatePathServiceGatewayAccountPolicy" }) - public void testListPrivatePathServiceGatewayEndpointGatewayBindings() throws Exception { + @Test(dependsOnMethods = { "testDisconnectVpnClient" }) + public void testListVpnServerRoutes() throws Exception { try { - ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptions = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() - .privatePathServiceGatewayId("testString") + ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() + .vpnServerId("testString") .start("testString") .limit(Long.valueOf("10")) - .status("abandoned") - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("name") .build(); // Invoke operation - Response response = service.listPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptions).execute(); + Response response = service.listVpnServerRoutes(listVpnServerRoutesOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 200); - PrivatePathServiceGatewayEndpointGatewayBindingCollection privatePathServiceGatewayEndpointGatewayBindingCollectionResult = response.getResult(); - assertNotNull(privatePathServiceGatewayEndpointGatewayBindingCollectionResult); + VPNServerRouteCollection vpnServerRouteCollectionResult = response.getResult(); + assertNotNull(vpnServerRouteCollectionResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -15304,233 +16088,192 @@ public void testListPrivatePathServiceGatewayEndpointGatewayBindings() throws Ex } } - @Test(dependsOnMethods = { "testListPrivatePathServiceGatewayEndpointGatewayBindings" }) - public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWithPager() throws Exception { + @Test(dependsOnMethods = { "testListVpnServerRoutes" }) + public void testListVpnServerRoutesWithPager() throws Exception { try { - ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions options = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() - .privatePathServiceGatewayId("testString") + ListVpnServerRoutesOptions options = new ListVpnServerRoutesOptions.Builder() + .vpnServerId("testString") .limit(Long.valueOf("10")) - .status("abandoned") - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("name") .build(); // Test getNext(). - List allResults = new ArrayList<>(); - PrivatePathServiceGatewayEndpointGatewayBindingsPager pager = new PrivatePathServiceGatewayEndpointGatewayBindingsPager(service, options); + List allResults = new ArrayList<>(); + VpnServerRoutesPager pager = new VpnServerRoutesPager(service, options); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertFalse(allResults.isEmpty()); // Test getAll(); - pager = new PrivatePathServiceGatewayEndpointGatewayBindingsPager(service, options); - List allItems = pager.getAll(); - assertNotNull(allItems); - assertFalse(allItems.isEmpty()); - - assertEquals(allItems.size(), allResults.size()); - System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } - - @Test(dependsOnMethods = { "testListPrivatePathServiceGatewayEndpointGatewayBindings" }) - public void testGetPrivatePathServiceGatewayEndpointGatewayBinding() throws Exception { - try { - GetPrivatePathServiceGatewayEndpointGatewayBindingOptions getPrivatePathServiceGatewayEndpointGatewayBindingOptions = new GetPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() - .privatePathServiceGatewayId("testString") - .id("testString") - .build(); - - // Invoke operation - Response response = service.getPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 200); - - PrivatePathServiceGatewayEndpointGatewayBinding privatePathServiceGatewayEndpointGatewayBindingResult = response.getResult(); - assertNotNull(privatePathServiceGatewayEndpointGatewayBindingResult); + pager = new VpnServerRoutesPager(service, options); + List allItems = pager.getAll(); + assertNotNull(allItems); + assertFalse(allItems.isEmpty()); + assertEquals(allItems.size(), allResults.size()); + System.out.println(String.format("Retrieved a total of %d item(s) with pagination.", allResults.size())); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testGetPrivatePathServiceGatewayEndpointGatewayBinding" }) - public void testDenyPrivatePathServiceGatewayEndpointGatewayBinding() throws Exception { + @Test(dependsOnMethods = { "testListVpnServerRoutes" }) + public void testCreateVpnServerRoute() throws Exception { try { - DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions denyPrivatePathServiceGatewayEndpointGatewayBindingOptions = new DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() - .privatePathServiceGatewayId("testString") - .id("testString") - .setAccountPolicy(true) + CreateVpnServerRouteOptions createVpnServerRouteOptions = new CreateVpnServerRouteOptions.Builder() + .vpnServerId("testString") + .destination("172.16.0.0/16") + .action("deliver") + .name("my-vpn-route-2") .build(); // Invoke operation - Response response = service.denyPrivatePathServiceGatewayEndpointGatewayBinding(denyPrivatePathServiceGatewayEndpointGatewayBindingOptions).execute(); + Response response = service.createVpnServerRoute(createVpnServerRouteOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 201); + + VPNServerRoute vpnServerRouteResult = response.getResult(); + assertNotNull(vpnServerRouteResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDenyPrivatePathServiceGatewayEndpointGatewayBinding" }) - public void testPermitPrivatePathServiceGatewayEndpointGatewayBinding() throws Exception { + @Test(dependsOnMethods = { "testCreateVpnServerRoute" }) + public void testGetVpnServerRoute() throws Exception { try { - PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions permitPrivatePathServiceGatewayEndpointGatewayBindingOptions = new PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() - .privatePathServiceGatewayId("testString") + GetVpnServerRouteOptions getVpnServerRouteOptions = new GetVpnServerRouteOptions.Builder() + .vpnServerId("testString") .id("testString") - .setAccountPolicy(true) .build(); // Invoke operation - Response response = service.permitPrivatePathServiceGatewayEndpointGatewayBinding(permitPrivatePathServiceGatewayEndpointGatewayBindingOptions).execute(); + Response response = service.getVpnServerRoute(getVpnServerRouteOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + assertEquals(response.getStatusCode(), 200); - @Test(dependsOnMethods = { "testPermitPrivatePathServiceGatewayEndpointGatewayBinding" }) - public void testPublishPrivatePathServiceGateway() throws Exception { - try { - PublishPrivatePathServiceGatewayOptions publishPrivatePathServiceGatewayOptions = new PublishPrivatePathServiceGatewayOptions.Builder() - .privatePathServiceGatewayId("testString") - .build(); + VPNServerRoute vpnServerRouteResult = response.getResult(); + assertNotNull(vpnServerRouteResult); - // Invoke operation - Response response = service.publishPrivatePathServiceGateway(publishPrivatePathServiceGatewayOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testPublishPrivatePathServiceGateway" }) - public void testRevokeAccountForPrivatePathServiceGateway() throws Exception { + @Test(dependsOnMethods = { "testGetVpnServerRoute" }) + public void testUpdateVpnServerRoute() throws Exception { try { - AccountIdentityById accountIdentityModel = new AccountIdentityById.Builder() - .id("bb1b52262f7441a586f49068482f1e60") + VPNServerRoutePatch vpnServerRoutePatchModel = new VPNServerRoutePatch.Builder() + .name("my-vpn-server-route-updated") .build(); + Map vpnServerRoutePatchModelAsPatch = vpnServerRoutePatchModel.asPatch(); - RevokeAccountForPrivatePathServiceGatewayOptions revokeAccountForPrivatePathServiceGatewayOptions = new RevokeAccountForPrivatePathServiceGatewayOptions.Builder() - .privatePathServiceGatewayId("testString") - .account(accountIdentityModel) + UpdateVpnServerRouteOptions updateVpnServerRouteOptions = new UpdateVpnServerRouteOptions.Builder() + .vpnServerId("testString") + .id("testString") + .vpnServerRoutePatch(vpnServerRoutePatchModelAsPatch) .build(); // Invoke operation - Response response = service.revokeAccountForPrivatePathServiceGateway(revokeAccountForPrivatePathServiceGatewayOptions).execute(); + Response response = service.updateVpnServerRoute(updateVpnServerRouteOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); - } catch (ServiceResponseException e) { - fail(String.format("Service returned status code %d: %s%nError details: %s", - e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); - } - } + assertEquals(response.getStatusCode(), 200); - @Test(dependsOnMethods = { "testRevokeAccountForPrivatePathServiceGateway" }) - public void testUnpublishPrivatePathServiceGateway() throws Exception { - try { - UnpublishPrivatePathServiceGatewayOptions unpublishPrivatePathServiceGatewayOptions = new UnpublishPrivatePathServiceGatewayOptions.Builder() - .privatePathServiceGatewayId("testString") - .build(); + VPNServerRoute vpnServerRouteResult = response.getResult(); + assertNotNull(vpnServerRouteResult); - // Invoke operation - Response response = service.unpublishPrivatePathServiceGateway(unpublishPrivatePathServiceGatewayOptions).execute(); - // Validate response - assertNotNull(response); - assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUnpublishPrivatePathServiceGateway" }) - public void testDeleteVpc() throws Exception { + @Test(dependsOnMethods = { "testUpdateVpnServerRoute" }) + public void testDeleteBackupPolicyPlan() throws Exception { try { - DeleteVpcOptions deleteVpcOptions = new DeleteVpcOptions.Builder() + DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptions = new DeleteBackupPolicyPlanOptions.Builder() + .backupPolicyId("testString") .id("testString") .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteVpc(deleteVpcOptions).execute(); + Response response = service.deleteBackupPolicyPlan(deleteBackupPolicyPlanOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); + + BackupPolicyPlan backupPolicyPlanResult = response.getResult(); + assertNotNull(backupPolicyPlanResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpc" }) - public void testDeleteVpcAddressPrefix() throws Exception { + @Test(dependsOnMethods = { "testDeleteBackupPolicyPlan" }) + public void testDeleteBackupPolicy() throws Exception { try { - DeleteVpcAddressPrefixOptions deleteVpcAddressPrefixOptions = new DeleteVpcAddressPrefixOptions.Builder() - .vpcId("testString") + DeleteBackupPolicyOptions deleteBackupPolicyOptions = new DeleteBackupPolicyOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteVpcAddressPrefix(deleteVpcAddressPrefixOptions).execute(); + Response response = service.deleteBackupPolicy(deleteBackupPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); + + BackupPolicy backupPolicyResult = response.getResult(); + assertNotNull(backupPolicyResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpcAddressPrefix" }) - public void testDeleteVpcDnsResolutionBinding() throws Exception { + @Test(dependsOnMethods = { "testDeleteBackupPolicy" }) + public void testDeleteBareMetalServerNetworkAttachment() throws Exception { try { - DeleteVpcDnsResolutionBindingOptions deleteVpcDnsResolutionBindingOptions = new DeleteVpcDnsResolutionBindingOptions.Builder() - .vpcId("testString") + DeleteBareMetalServerNetworkAttachmentOptions deleteBareMetalServerNetworkAttachmentOptions = new DeleteBareMetalServerNetworkAttachmentOptions.Builder() + .bareMetalServerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteVpcDnsResolutionBinding(deleteVpcDnsResolutionBindingOptions).execute(); + Response response = service.deleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - VPCDNSResolutionBinding vpcdnsResolutionBindingResult = response.getResult(); - assertNotNull(vpcdnsResolutionBindingResult); - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpcDnsResolutionBinding" }) - public void testDeleteVpcRoute() throws Exception { + @Test(dependsOnMethods = { "testDeleteBareMetalServerNetworkAttachment" }) + public void testDeleteBareMetalServerNetworkInterface() throws Exception { try { - DeleteVpcRouteOptions deleteVpcRouteOptions = new DeleteVpcRouteOptions.Builder() - .vpcId("testString") + DeleteBareMetalServerNetworkInterfaceOptions deleteBareMetalServerNetworkInterfaceOptions = new DeleteBareMetalServerNetworkInterfaceOptions.Builder() + .bareMetalServerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteVpcRoute(deleteVpcRouteOptions).execute(); + Response response = service.deleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -15540,17 +16283,17 @@ public void testDeleteVpcRoute() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteVpcRoute" }) - public void testDeleteVpcRoutingTable() throws Exception { + @Test(dependsOnMethods = { "testDeleteBareMetalServerNetworkInterface" }) + public void testRemoveBareMetalServerNetworkInterfaceFloatingIp() throws Exception { try { - DeleteVpcRoutingTableOptions deleteVpcRoutingTableOptions = new DeleteVpcRoutingTableOptions.Builder() - .vpcId("testString") + RemoveBareMetalServerNetworkInterfaceFloatingIpOptions removeBareMetalServerNetworkInterfaceFloatingIpOptions = new RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteVpcRoutingTable(deleteVpcRoutingTableOptions).execute(); + Response response = service.removeBareMetalServerNetworkInterfaceFloatingIp(removeBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -15560,127 +16303,147 @@ public void testDeleteVpcRoutingTable() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteVpcRoutingTable" }) - public void testDeleteVpcRoutingTableRoute() throws Exception { + @Test(dependsOnMethods = { "testRemoveBareMetalServerNetworkInterfaceFloatingIp" }) + public void testDeleteBareMetalServer() throws Exception { try { - DeleteVpcRoutingTableRouteOptions deleteVpcRoutingTableRouteOptions = new DeleteVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") + DeleteBareMetalServerOptions deleteBareMetalServerOptions = new DeleteBareMetalServerOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteVpcRoutingTableRoute(deleteVpcRoutingTableRouteOptions).execute(); + Response response = service.deleteBareMetalServer(deleteBareMetalServerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpcRoutingTableRoute" }) - public void testDeleteSubnet() throws Exception { + @Test(dependsOnMethods = { "testDeleteBareMetalServer" }) + public void testDeleteClusterNetworkInterface() throws Exception { try { - DeleteSubnetOptions deleteSubnetOptions = new DeleteSubnetOptions.Builder() + DeleteClusterNetworkInterfaceOptions deleteClusterNetworkInterfaceOptions = new DeleteClusterNetworkInterfaceOptions.Builder() + .clusterNetworkId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteSubnet(deleteSubnetOptions).execute(); + Response response = service.deleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); + + ClusterNetworkInterface clusterNetworkInterfaceResult = response.getResult(); + assertNotNull(clusterNetworkInterfaceResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteSubnet" }) - public void testUnsetSubnetPublicGateway() throws Exception { + @Test(dependsOnMethods = { "testDeleteClusterNetworkInterface" }) + public void testDeleteClusterNetworkSubnetReservedIp() throws Exception { try { - UnsetSubnetPublicGatewayOptions unsetSubnetPublicGatewayOptions = new UnsetSubnetPublicGatewayOptions.Builder() + DeleteClusterNetworkSubnetReservedIpOptions deleteClusterNetworkSubnetReservedIpOptions = new DeleteClusterNetworkSubnetReservedIpOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.unsetSubnetPublicGateway(unsetSubnetPublicGatewayOptions).execute(); + Response response = service.deleteClusterNetworkSubnetReservedIp(deleteClusterNetworkSubnetReservedIpOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); + + ClusterNetworkSubnetReservedIP clusterNetworkSubnetReservedIpResult = response.getResult(); + assertNotNull(clusterNetworkSubnetReservedIpResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testUnsetSubnetPublicGateway" }) - public void testDeleteSubnetReservedIp() throws Exception { + @Test(dependsOnMethods = { "testDeleteClusterNetworkSubnetReservedIp" }) + public void testDeleteClusterNetworkSubnet() throws Exception { try { - DeleteSubnetReservedIpOptions deleteSubnetReservedIpOptions = new DeleteSubnetReservedIpOptions.Builder() - .subnetId("testString") + DeleteClusterNetworkSubnetOptions deleteClusterNetworkSubnetOptions = new DeleteClusterNetworkSubnetOptions.Builder() + .clusterNetworkId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteSubnetReservedIp(deleteSubnetReservedIpOptions).execute(); + Response response = service.deleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); + + ClusterNetworkSubnet clusterNetworkSubnetResult = response.getResult(); + assertNotNull(clusterNetworkSubnetResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteSubnetReservedIp" }) - public void testDeleteImage() throws Exception { + @Test(dependsOnMethods = { "testDeleteClusterNetworkSubnet" }) + public void testDeleteClusterNetwork() throws Exception { try { - DeleteImageOptions deleteImageOptions = new DeleteImageOptions.Builder() + DeleteClusterNetworkOptions deleteClusterNetworkOptions = new DeleteClusterNetworkOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteImage(deleteImageOptions).execute(); + Response response = service.deleteClusterNetwork(deleteClusterNetworkOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); + + ClusterNetwork clusterNetworkResult = response.getResult(); + assertNotNull(clusterNetworkResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteImage" }) - public void testDeleteImageExportJob() throws Exception { + @Test(dependsOnMethods = { "testDeleteClusterNetwork" }) + public void testDeleteDedicatedHostGroup() throws Exception { try { - DeleteImageExportJobOptions deleteImageExportJobOptions = new DeleteImageExportJobOptions.Builder() - .imageId("testString") + DeleteDedicatedHostGroupOptions deleteDedicatedHostGroupOptions = new DeleteDedicatedHostGroupOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteImageExportJob(deleteImageExportJobOptions).execute(); + Response response = service.deleteDedicatedHostGroup(deleteDedicatedHostGroupOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteImageExportJob" }) - public void testDeleteKey() throws Exception { + @Test(dependsOnMethods = { "testDeleteDedicatedHostGroup" }) + public void testDeleteDedicatedHost() throws Exception { try { - DeleteKeyOptions deleteKeyOptions = new DeleteKeyOptions.Builder() + DeleteDedicatedHostOptions deleteDedicatedHostOptions = new DeleteDedicatedHostOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteKey(deleteKeyOptions).execute(); + Response response = service.deleteDedicatedHost(deleteDedicatedHostOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -15690,15 +16453,16 @@ public void testDeleteKey() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteKey" }) - public void testDeleteInstanceTemplate() throws Exception { + @Test(dependsOnMethods = { "testDeleteDedicatedHost" }) + public void testRemoveEndpointGatewayIp() throws Exception { try { - DeleteInstanceTemplateOptions deleteInstanceTemplateOptions = new DeleteInstanceTemplateOptions.Builder() + RemoveEndpointGatewayIpOptions removeEndpointGatewayIpOptions = new RemoveEndpointGatewayIpOptions.Builder() + .endpointGatewayId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteInstanceTemplate(deleteInstanceTemplateOptions).execute(); + Response response = service.removeEndpointGatewayIp(removeEndpointGatewayIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -15708,16 +16472,16 @@ public void testDeleteInstanceTemplate() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteInstanceTemplate" }) - public void testDeleteInstance() throws Exception { + @Test(dependsOnMethods = { "testRemoveEndpointGatewayIp" }) + public void testDeleteEndpointGatewayResourceBinding() throws Exception { try { - DeleteInstanceOptions deleteInstanceOptions = new DeleteInstanceOptions.Builder() + DeleteEndpointGatewayResourceBindingOptions deleteEndpointGatewayResourceBindingOptions = new DeleteEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteInstance(deleteInstanceOptions).execute(); + Response response = service.deleteEndpointGatewayResourceBinding(deleteEndpointGatewayResourceBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -15727,58 +16491,51 @@ public void testDeleteInstance() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteInstance" }) - public void testDeleteInstanceClusterNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testDeleteEndpointGatewayResourceBinding" }) + public void testDeleteEndpointGateway() throws Exception { try { - DeleteInstanceClusterNetworkAttachmentOptions deleteInstanceClusterNetworkAttachmentOptions = new DeleteInstanceClusterNetworkAttachmentOptions.Builder() - .instanceId("testString") + DeleteEndpointGatewayOptions deleteEndpointGatewayOptions = new DeleteEndpointGatewayOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptions).execute(); + Response response = service.deleteEndpointGateway(deleteEndpointGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); - - InstanceClusterNetworkAttachment instanceClusterNetworkAttachmentResult = response.getResult(); - assertNotNull(instanceClusterNetworkAttachmentResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteInstanceClusterNetworkAttachment" }) - public void testDeleteInstanceNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testDeleteEndpointGateway" }) + public void testDeleteFloatingIp() throws Exception { try { - DeleteInstanceNetworkAttachmentOptions deleteInstanceNetworkAttachmentOptions = new DeleteInstanceNetworkAttachmentOptions.Builder() - .instanceId("testString") + DeleteFloatingIpOptions deleteFloatingIpOptions = new DeleteFloatingIpOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptions).execute(); + Response response = service.deleteFloatingIp(deleteFloatingIpOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteInstanceNetworkAttachment" }) - public void testDeleteInstanceNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testDeleteFloatingIp" }) + public void testDeleteFlowLogCollector() throws Exception { try { - DeleteInstanceNetworkInterfaceOptions deleteInstanceNetworkInterfaceOptions = new DeleteInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") + DeleteFlowLogCollectorOptions deleteFlowLogCollectorOptions = new DeleteFlowLogCollectorOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptions).execute(); + Response response = service.deleteFlowLogCollector(deleteFlowLogCollectorOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -15788,46 +16545,44 @@ public void testDeleteInstanceNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteInstanceNetworkInterface" }) - public void testRemoveInstanceNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testDeleteFlowLogCollector" }) + public void testDeleteImage() throws Exception { try { - RemoveInstanceNetworkInterfaceFloatingIpOptions removeInstanceNetworkInterfaceFloatingIpOptions = new RemoveInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + DeleteImageOptions deleteImageOptions = new DeleteImageOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.removeInstanceNetworkInterfaceFloatingIp(removeInstanceNetworkInterfaceFloatingIpOptions).execute(); + Response response = service.deleteImage(deleteImageOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testRemoveInstanceNetworkInterfaceFloatingIp" }) - public void testDeleteInstanceVolumeAttachment() throws Exception { + @Test(dependsOnMethods = { "testDeleteImage" }) + public void testDeleteImageExportJob() throws Exception { try { - DeleteInstanceVolumeAttachmentOptions deleteInstanceVolumeAttachmentOptions = new DeleteInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") + DeleteImageExportJobOptions deleteImageExportJobOptions = new DeleteImageExportJobOptions.Builder() + .imageId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptions).execute(); + Response response = service.deleteImageExportJob(deleteImageExportJobOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteInstanceVolumeAttachment" }) + @Test(dependsOnMethods = { "testDeleteImageExportJob" }) public void testDeleteInstanceGroup() throws Exception { try { DeleteInstanceGroupOptions deleteInstanceGroupOptions = new DeleteInstanceGroupOptions.Builder() @@ -15960,36 +16715,33 @@ public void testDeleteInstanceGroupMembership() throws Exception { } @Test(dependsOnMethods = { "testDeleteInstanceGroupMembership" }) - public void testDeleteReservation() throws Exception { + public void testDeleteInstanceTemplate() throws Exception { try { - DeleteReservationOptions deleteReservationOptions = new DeleteReservationOptions.Builder() + DeleteInstanceTemplateOptions deleteInstanceTemplateOptions = new DeleteInstanceTemplateOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteReservation(deleteReservationOptions).execute(); + Response response = service.deleteInstanceTemplate(deleteInstanceTemplateOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); - - Reservation reservationResult = response.getResult(); - assertNotNull(reservationResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteReservation" }) - public void testDeleteDedicatedHostGroup() throws Exception { + @Test(dependsOnMethods = { "testDeleteInstanceTemplate" }) + public void testDeleteInstance() throws Exception { try { - DeleteDedicatedHostGroupOptions deleteDedicatedHostGroupOptions = new DeleteDedicatedHostGroupOptions.Builder() + DeleteInstanceOptions deleteInstanceOptions = new DeleteInstanceOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteDedicatedHostGroup(deleteDedicatedHostGroupOptions).execute(); + Response response = service.deleteInstance(deleteInstanceOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -15999,33 +16751,39 @@ public void testDeleteDedicatedHostGroup() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteDedicatedHostGroup" }) - public void testDeleteDedicatedHost() throws Exception { + @Test(dependsOnMethods = { "testDeleteInstance" }) + public void testDeleteInstanceClusterNetworkAttachment() throws Exception { try { - DeleteDedicatedHostOptions deleteDedicatedHostOptions = new DeleteDedicatedHostOptions.Builder() + DeleteInstanceClusterNetworkAttachmentOptions deleteInstanceClusterNetworkAttachmentOptions = new DeleteInstanceClusterNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteDedicatedHost(deleteDedicatedHostOptions).execute(); + Response response = service.deleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); + + InstanceClusterNetworkAttachment instanceClusterNetworkAttachmentResult = response.getResult(); + assertNotNull(instanceClusterNetworkAttachmentResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteDedicatedHost" }) - public void testDeletePlacementGroup() throws Exception { + @Test(dependsOnMethods = { "testDeleteInstanceClusterNetworkAttachment" }) + public void testDeleteInstanceNetworkAttachment() throws Exception { try { - DeletePlacementGroupOptions deletePlacementGroupOptions = new DeletePlacementGroupOptions.Builder() + DeleteInstanceNetworkAttachmentOptions deleteInstanceNetworkAttachmentOptions = new DeleteInstanceNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deletePlacementGroup(deletePlacementGroupOptions).execute(); + Response response = service.deleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); @@ -16035,35 +16793,36 @@ public void testDeletePlacementGroup() throws Exception { } } - @Test(dependsOnMethods = { "testDeletePlacementGroup" }) - public void testDeleteBareMetalServerNetworkAttachment() throws Exception { + @Test(dependsOnMethods = { "testDeleteInstanceNetworkAttachment" }) + public void testDeleteInstanceNetworkInterface() throws Exception { try { - DeleteBareMetalServerNetworkAttachmentOptions deleteBareMetalServerNetworkAttachmentOptions = new DeleteBareMetalServerNetworkAttachmentOptions.Builder() - .bareMetalServerId("testString") + DeleteInstanceNetworkInterfaceOptions deleteInstanceNetworkInterfaceOptions = new DeleteInstanceNetworkInterfaceOptions.Builder() + .instanceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptions).execute(); + Response response = service.deleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteBareMetalServerNetworkAttachment" }) - public void testDeleteBareMetalServerNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testDeleteInstanceNetworkInterface" }) + public void testRemoveInstanceNetworkInterfaceFloatingIp() throws Exception { try { - DeleteBareMetalServerNetworkInterfaceOptions deleteBareMetalServerNetworkInterfaceOptions = new DeleteBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") + RemoveInstanceNetworkInterfaceFloatingIpOptions removeInstanceNetworkInterfaceFloatingIpOptions = new RemoveInstanceNetworkInterfaceFloatingIpOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptions).execute(); + Response response = service.removeInstanceNetworkInterfaceFloatingIp(removeInstanceNetworkInterfaceFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16073,17 +16832,16 @@ public void testDeleteBareMetalServerNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteBareMetalServerNetworkInterface" }) - public void testRemoveBareMetalServerNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testRemoveInstanceNetworkInterfaceFloatingIp" }) + public void testDeleteInstanceVolumeAttachment() throws Exception { try { - RemoveBareMetalServerNetworkInterfaceFloatingIpOptions removeBareMetalServerNetworkInterfaceFloatingIpOptions = new RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + DeleteInstanceVolumeAttachmentOptions deleteInstanceVolumeAttachmentOptions = new DeleteInstanceVolumeAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.removeBareMetalServerNetworkInterfaceFloatingIp(removeBareMetalServerNetworkInterfaceFloatingIpOptions).execute(); + Response response = service.deleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16093,74 +16851,94 @@ public void testRemoveBareMetalServerNetworkInterfaceFloatingIp() throws Excepti } } - @Test(dependsOnMethods = { "testRemoveBareMetalServerNetworkInterfaceFloatingIp" }) - public void testDeleteBareMetalServer() throws Exception { + @Test(dependsOnMethods = { "testDeleteInstanceVolumeAttachment" }) + public void testDeleteKey() throws Exception { try { - DeleteBareMetalServerOptions deleteBareMetalServerOptions = new DeleteBareMetalServerOptions.Builder() + DeleteKeyOptions deleteKeyOptions = new DeleteKeyOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteBareMetalServer(deleteBareMetalServerOptions).execute(); + Response response = service.deleteKey(deleteKeyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteBareMetalServer" }) - public void testDeleteVolume() throws Exception { + @Test(dependsOnMethods = { "testDeleteKey" }) + public void testDeleteLoadBalancer() throws Exception { try { - DeleteVolumeOptions deleteVolumeOptions = new DeleteVolumeOptions.Builder() + DeleteLoadBalancerOptions deleteLoadBalancerOptions = new DeleteLoadBalancerOptions.Builder() .id("testString") .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteVolume(deleteVolumeOptions).execute(); + Response response = service.deleteLoadBalancer(deleteLoadBalancerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVolume" }) - public void testDeleteSnapshotConsistencyGroup() throws Exception { + @Test(dependsOnMethods = { "testDeleteLoadBalancer" }) + public void testDeleteLoadBalancerListener() throws Exception { try { - DeleteSnapshotConsistencyGroupOptions deleteSnapshotConsistencyGroupOptions = new DeleteSnapshotConsistencyGroupOptions.Builder() + DeleteLoadBalancerListenerOptions deleteLoadBalancerListenerOptions = new DeleteLoadBalancerListenerOptions.Builder() + .loadBalancerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptions).execute(); + Response response = service.deleteLoadBalancerListener(deleteLoadBalancerListenerOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } - SnapshotConsistencyGroup snapshotConsistencyGroupResult = response.getResult(); - assertNotNull(snapshotConsistencyGroupResult); + @Test(dependsOnMethods = { "testDeleteLoadBalancerListener" }) + public void testDeleteLoadBalancerListenerPolicy() throws Exception { + try { + DeleteLoadBalancerListenerPolicyOptions deleteLoadBalancerListenerPolicyOptions = new DeleteLoadBalancerListenerPolicyOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .id("testString") + .build(); + // Invoke operation + Response response = service.deleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteSnapshotConsistencyGroup" }) - public void testDeleteSnapshots() throws Exception { + @Test(dependsOnMethods = { "testDeleteLoadBalancerListenerPolicy" }) + public void testDeleteLoadBalancerListenerPolicyRule() throws Exception { try { - DeleteSnapshotsOptions deleteSnapshotsOptions = new DeleteSnapshotsOptions.Builder() - .sourceVolumeId("testString") + DeleteLoadBalancerListenerPolicyRuleOptions deleteLoadBalancerListenerPolicyRuleOptions = new DeleteLoadBalancerListenerPolicyRuleOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .id("testString") .build(); // Invoke operation - Response response = service.deleteSnapshots(deleteSnapshotsOptions).execute(); + Response response = service.deleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); @@ -16170,16 +16948,16 @@ public void testDeleteSnapshots() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteSnapshots" }) - public void testDeleteSnapshot() throws Exception { + @Test(dependsOnMethods = { "testDeleteLoadBalancerListenerPolicyRule" }) + public void testDeleteLoadBalancerPool() throws Exception { try { - DeleteSnapshotOptions deleteSnapshotOptions = new DeleteSnapshotOptions.Builder() + DeleteLoadBalancerPoolOptions deleteLoadBalancerPoolOptions = new DeleteLoadBalancerPoolOptions.Builder() + .loadBalancerId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteSnapshot(deleteSnapshotOptions).execute(); + Response response = service.deleteLoadBalancerPool(deleteLoadBalancerPoolOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); @@ -16189,16 +16967,17 @@ public void testDeleteSnapshot() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteSnapshot" }) - public void testDeleteSnapshotClone() throws Exception { + @Test(dependsOnMethods = { "testDeleteLoadBalancerPool" }) + public void testDeleteLoadBalancerPoolMember() throws Exception { try { - DeleteSnapshotCloneOptions deleteSnapshotCloneOptions = new DeleteSnapshotCloneOptions.Builder() + DeleteLoadBalancerPoolMemberOptions deleteLoadBalancerPoolMemberOptions = new DeleteLoadBalancerPoolMemberOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") .id("testString") - .zoneName("us-south-1") .build(); // Invoke operation - Response response = service.deleteSnapshotClone(deleteSnapshotCloneOptions).execute(); + Response response = service.deleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); @@ -16208,152 +16987,153 @@ public void testDeleteSnapshotClone() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteSnapshotClone" }) - public void testDeleteShare() throws Exception { + @Test(dependsOnMethods = { "testDeleteLoadBalancerPoolMember" }) + public void testDeleteNetworkAcl() throws Exception { + try { + DeleteNetworkAclOptions deleteNetworkAclOptions = new DeleteNetworkAclOptions.Builder() + .id("testString") + .build(); + + // Invoke operation + Response response = service.deleteNetworkAcl(deleteNetworkAclOptions).execute(); + // Validate response + assertNotNull(response); + assertEquals(response.getStatusCode(), 204); + } catch (ServiceResponseException e) { + fail(String.format("Service returned status code %d: %s%nError details: %s", + e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); + } + } + + @Test(dependsOnMethods = { "testDeleteNetworkAcl" }) + public void testDeleteNetworkAclRule() throws Exception { try { - DeleteShareOptions deleteShareOptions = new DeleteShareOptions.Builder() + DeleteNetworkAclRuleOptions deleteNetworkAclRuleOptions = new DeleteNetworkAclRuleOptions.Builder() + .networkAclId("testString") .id("testString") - .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") .build(); // Invoke operation - Response response = service.deleteShare(deleteShareOptions).execute(); + Response response = service.deleteNetworkAclRule(deleteNetworkAclRuleOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); - - Share shareResult = response.getResult(); - assertNotNull(shareResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteShare" }) - public void testDeleteShareAccessorBinding() throws Exception { + @Test(dependsOnMethods = { "testDeleteNetworkAclRule" }) + public void testDeletePlacementGroup() throws Exception { try { - DeleteShareAccessorBindingOptions deleteShareAccessorBindingOptions = new DeleteShareAccessorBindingOptions.Builder() - .shareId("testString") + DeletePlacementGroupOptions deletePlacementGroupOptions = new DeletePlacementGroupOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteShareAccessorBinding(deleteShareAccessorBindingOptions).execute(); + Response response = service.deletePlacementGroup(deletePlacementGroupOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteShareAccessorBinding" }) - public void testDeleteShareMountTarget() throws Exception { + @Test(dependsOnMethods = { "testDeletePlacementGroup" }) + public void testDeletePrivatePathServiceGateway() throws Exception { try { - DeleteShareMountTargetOptions deleteShareMountTargetOptions = new DeleteShareMountTargetOptions.Builder() - .shareId("testString") + DeletePrivatePathServiceGatewayOptions deletePrivatePathServiceGatewayOptions = new DeletePrivatePathServiceGatewayOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteShareMountTarget(deleteShareMountTargetOptions).execute(); + Response response = service.deletePrivatePathServiceGateway(deletePrivatePathServiceGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); - - ShareMountTarget shareMountTargetResult = response.getResult(); - assertNotNull(shareMountTargetResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteShareMountTarget" }) - public void testDeleteShareSnapshot() throws Exception { + @Test(dependsOnMethods = { "testDeletePrivatePathServiceGateway" }) + public void testDeletePrivatePathServiceGatewayAccountPolicy() throws Exception { try { - DeleteShareSnapshotOptions deleteShareSnapshotOptions = new DeleteShareSnapshotOptions.Builder() - .shareId("testString") + DeletePrivatePathServiceGatewayAccountPolicyOptions deletePrivatePathServiceGatewayAccountPolicyOptions = new DeletePrivatePathServiceGatewayAccountPolicyOptions.Builder() + .privatePathServiceGatewayId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteShareSnapshot(deleteShareSnapshotOptions).execute(); + Response response = service.deletePrivatePathServiceGatewayAccountPolicy(deletePrivatePathServiceGatewayAccountPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); - - ShareSnapshot shareSnapshotResult = response.getResult(); - assertNotNull(shareSnapshotResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteShareSnapshot" }) - public void testDeleteShareSource() throws Exception { + @Test(dependsOnMethods = { "testDeletePrivatePathServiceGatewayAccountPolicy" }) + public void testDeletePublicAddressRange() throws Exception { try { - DeleteShareSourceOptions deleteShareSourceOptions = new DeleteShareSourceOptions.Builder() - .shareId("testString") + DeletePublicAddressRangeOptions deletePublicAddressRangeOptions = new DeletePublicAddressRangeOptions.Builder() + .id("testString") .build(); // Invoke operation - Response response = service.deleteShareSource(deleteShareSourceOptions).execute(); + Response response = service.deletePublicAddressRange(deletePublicAddressRangeOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); + + PublicAddressRange publicAddressRangeResult = response.getResult(); + assertNotNull(publicAddressRangeResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteShareSource" }) - public void testDeleteBackupPolicyPlan() throws Exception { + @Test(dependsOnMethods = { "testDeletePublicAddressRange" }) + public void testDeletePublicGateway() throws Exception { try { - DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptions = new DeleteBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") + DeletePublicGatewayOptions deletePublicGatewayOptions = new DeletePublicGatewayOptions.Builder() .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteBackupPolicyPlan(deleteBackupPolicyPlanOptions).execute(); + Response response = service.deletePublicGateway(deletePublicGatewayOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); - - BackupPolicyPlan backupPolicyPlanResult = response.getResult(); - assertNotNull(backupPolicyPlanResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteBackupPolicyPlan" }) - public void testDeleteBackupPolicy() throws Exception { + @Test(dependsOnMethods = { "testDeletePublicGateway" }) + public void testDeleteReservation() throws Exception { try { - DeleteBackupPolicyOptions deleteBackupPolicyOptions = new DeleteBackupPolicyOptions.Builder() + DeleteReservationOptions deleteReservationOptions = new DeleteReservationOptions.Builder() .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteBackupPolicy(deleteBackupPolicyOptions).execute(); + Response response = service.deleteReservation(deleteReservationOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - BackupPolicy backupPolicyResult = response.getResult(); - assertNotNull(backupPolicyResult); + Reservation reservationResult = response.getResult(); + assertNotNull(reservationResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -16361,38 +17141,34 @@ public void testDeleteBackupPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteBackupPolicy" }) - public void testDeleteVirtualNetworkInterfaces() throws Exception { + @Test(dependsOnMethods = { "testDeleteReservation" }) + public void testDeleteSecurityGroup() throws Exception { try { - DeleteVirtualNetworkInterfacesOptions deleteVirtualNetworkInterfacesOptions = new DeleteVirtualNetworkInterfacesOptions.Builder() + DeleteSecurityGroupOptions deleteSecurityGroupOptions = new DeleteSecurityGroupOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptions).execute(); + Response response = service.deleteSecurityGroup(deleteSecurityGroupOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); - - VirtualNetworkInterface virtualNetworkInterfaceResult = response.getResult(); - assertNotNull(virtualNetworkInterfaceResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVirtualNetworkInterfaces" }) - public void testRemoveNetworkInterfaceFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testDeleteSecurityGroup" }) + public void testDeleteSecurityGroupRule() throws Exception { try { - RemoveNetworkInterfaceFloatingIpOptions removeNetworkInterfaceFloatingIpOptions = new RemoveNetworkInterfaceFloatingIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + DeleteSecurityGroupRuleOptions deleteSecurityGroupRuleOptions = new DeleteSecurityGroupRuleOptions.Builder() + .securityGroupId("testString") .id("testString") .build(); // Invoke operation - Response response = service.removeNetworkInterfaceFloatingIp(removeNetworkInterfaceFloatingIpOptions).execute(); + Response response = service.deleteSecurityGroupRule(deleteSecurityGroupRuleOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16402,16 +17178,16 @@ public void testRemoveNetworkInterfaceFloatingIp() throws Exception { } } - @Test(dependsOnMethods = { "testRemoveNetworkInterfaceFloatingIp" }) - public void testRemoveVirtualNetworkInterfaceIp() throws Exception { + @Test(dependsOnMethods = { "testDeleteSecurityGroupRule" }) + public void testDeleteSecurityGroupTargetBinding() throws Exception { try { - RemoveVirtualNetworkInterfaceIpOptions removeVirtualNetworkInterfaceIpOptions = new RemoveVirtualNetworkInterfaceIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + DeleteSecurityGroupTargetBindingOptions deleteSecurityGroupTargetBindingOptions = new DeleteSecurityGroupTargetBindingOptions.Builder() + .securityGroupId("testString") .id("testString") .build(); // Invoke operation - Response response = service.removeVirtualNetworkInterfaceIp(removeVirtualNetworkInterfaceIpOptions).execute(); + Response response = service.deleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16421,23 +17197,22 @@ public void testRemoveVirtualNetworkInterfaceIp() throws Exception { } } - @Test(dependsOnMethods = { "testRemoveVirtualNetworkInterfaceIp" }) - public void testDeleteClusterNetworkInterface() throws Exception { + @Test(dependsOnMethods = { "testDeleteSecurityGroupTargetBinding" }) + public void testDeleteShare() throws Exception { try { - DeleteClusterNetworkInterfaceOptions deleteClusterNetworkInterfaceOptions = new DeleteClusterNetworkInterfaceOptions.Builder() - .clusterNetworkId("testString") + DeleteShareOptions deleteShareOptions = new DeleteShareOptions.Builder() .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") .build(); // Invoke operation - Response response = service.deleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptions).execute(); + Response response = service.deleteShare(deleteShareOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - ClusterNetworkInterface clusterNetworkInterfaceResult = response.getResult(); - assertNotNull(clusterNetworkInterfaceResult); + Share shareResult = response.getResult(); + assertNotNull(shareResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -16445,48 +17220,41 @@ public void testDeleteClusterNetworkInterface() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteClusterNetworkInterface" }) - public void testDeleteClusterNetworkSubnetReservedIp() throws Exception { + @Test(dependsOnMethods = { "testDeleteShare" }) + public void testDeleteShareAccessorBinding() throws Exception { try { - DeleteClusterNetworkSubnetReservedIpOptions deleteClusterNetworkSubnetReservedIpOptions = new DeleteClusterNetworkSubnetReservedIpOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + DeleteShareAccessorBindingOptions deleteShareAccessorBindingOptions = new DeleteShareAccessorBindingOptions.Builder() + .shareId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteClusterNetworkSubnetReservedIp(deleteClusterNetworkSubnetReservedIpOptions).execute(); + Response response = service.deleteShareAccessorBinding(deleteShareAccessorBindingOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); - - ClusterNetworkSubnetReservedIP clusterNetworkSubnetReservedIpResult = response.getResult(); - assertNotNull(clusterNetworkSubnetReservedIpResult); - + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteClusterNetworkSubnetReservedIp" }) - public void testDeleteClusterNetworkSubnet() throws Exception { + @Test(dependsOnMethods = { "testDeleteShareAccessorBinding" }) + public void testDeleteShareMountTarget() throws Exception { try { - DeleteClusterNetworkSubnetOptions deleteClusterNetworkSubnetOptions = new DeleteClusterNetworkSubnetOptions.Builder() - .clusterNetworkId("testString") + DeleteShareMountTargetOptions deleteShareMountTargetOptions = new DeleteShareMountTargetOptions.Builder() + .shareId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptions).execute(); + Response response = service.deleteShareMountTarget(deleteShareMountTargetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - ClusterNetworkSubnet clusterNetworkSubnetResult = response.getResult(); - assertNotNull(clusterNetworkSubnetResult); + ShareMountTarget shareMountTargetResult = response.getResult(); + assertNotNull(shareMountTargetResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -16494,22 +17262,22 @@ public void testDeleteClusterNetworkSubnet() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteClusterNetworkSubnet" }) - public void testDeleteClusterNetwork() throws Exception { + @Test(dependsOnMethods = { "testDeleteShareMountTarget" }) + public void testDeleteShareSnapshot() throws Exception { try { - DeleteClusterNetworkOptions deleteClusterNetworkOptions = new DeleteClusterNetworkOptions.Builder() + DeleteShareSnapshotOptions deleteShareSnapshotOptions = new DeleteShareSnapshotOptions.Builder() + .shareId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteClusterNetwork(deleteClusterNetworkOptions).execute(); + Response response = service.deleteShareSnapshot(deleteShareSnapshotOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - ClusterNetwork clusterNetworkResult = response.getResult(); - assertNotNull(clusterNetworkResult); + ShareSnapshot shareSnapshotResult = response.getResult(); + assertNotNull(shareSnapshotResult); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", @@ -16517,110 +17285,111 @@ public void testDeleteClusterNetwork() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteClusterNetwork" }) - public void testDeletePublicGateway() throws Exception { + @Test(dependsOnMethods = { "testDeleteShareSnapshot" }) + public void testDeleteShareSource() throws Exception { try { - DeletePublicGatewayOptions deletePublicGatewayOptions = new DeletePublicGatewayOptions.Builder() - .id("testString") + DeleteShareSourceOptions deleteShareSourceOptions = new DeleteShareSourceOptions.Builder() + .shareId("testString") .build(); // Invoke operation - Response response = service.deletePublicGateway(deletePublicGatewayOptions).execute(); + Response response = service.deleteShareSource(deleteShareSourceOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeletePublicGateway" }) - public void testDeleteFloatingIp() throws Exception { + @Test(dependsOnMethods = { "testDeleteShareSource" }) + public void testDeleteSnapshotConsistencyGroup() throws Exception { try { - DeleteFloatingIpOptions deleteFloatingIpOptions = new DeleteFloatingIpOptions.Builder() + DeleteSnapshotConsistencyGroupOptions deleteSnapshotConsistencyGroupOptions = new DeleteSnapshotConsistencyGroupOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteFloatingIp(deleteFloatingIpOptions).execute(); + Response response = service.deleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); + + SnapshotConsistencyGroup snapshotConsistencyGroupResult = response.getResult(); + assertNotNull(snapshotConsistencyGroupResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteFloatingIp" }) - public void testDeletePublicAddressRange() throws Exception { + @Test(dependsOnMethods = { "testDeleteSnapshotConsistencyGroup" }) + public void testDeleteSnapshots() throws Exception { try { - DeletePublicAddressRangeOptions deletePublicAddressRangeOptions = new DeletePublicAddressRangeOptions.Builder() - .id("testString") + DeleteSnapshotsOptions deleteSnapshotsOptions = new DeleteSnapshotsOptions.Builder() + .sourceVolumeId("testString") .build(); // Invoke operation - Response response = service.deletePublicAddressRange(deletePublicAddressRangeOptions).execute(); + Response response = service.deleteSnapshots(deleteSnapshotsOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); - - PublicAddressRange publicAddressRangeResult = response.getResult(); - assertNotNull(publicAddressRangeResult); - } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeletePublicAddressRange" }) - public void testDeleteNetworkAcl() throws Exception { + @Test(dependsOnMethods = { "testDeleteSnapshots" }) + public void testDeleteSnapshot() throws Exception { try { - DeleteNetworkAclOptions deleteNetworkAclOptions = new DeleteNetworkAclOptions.Builder() + DeleteSnapshotOptions deleteSnapshotOptions = new DeleteSnapshotOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteNetworkAcl(deleteNetworkAclOptions).execute(); + Response response = service.deleteSnapshot(deleteSnapshotOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteNetworkAcl" }) - public void testDeleteNetworkAclRule() throws Exception { + @Test(dependsOnMethods = { "testDeleteSnapshot" }) + public void testDeleteSnapshotClone() throws Exception { try { - DeleteNetworkAclRuleOptions deleteNetworkAclRuleOptions = new DeleteNetworkAclRuleOptions.Builder() - .networkAclId("testString") + DeleteSnapshotCloneOptions deleteSnapshotCloneOptions = new DeleteSnapshotCloneOptions.Builder() .id("testString") + .zoneName("us-south-1") .build(); // Invoke operation - Response response = service.deleteNetworkAclRule(deleteNetworkAclRuleOptions).execute(); + Response response = service.deleteSnapshotClone(deleteSnapshotCloneOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteNetworkAclRule" }) - public void testDeleteSecurityGroup() throws Exception { + @Test(dependsOnMethods = { "testDeleteSnapshotClone" }) + public void testDeleteSubnet() throws Exception { try { - DeleteSecurityGroupOptions deleteSecurityGroupOptions = new DeleteSecurityGroupOptions.Builder() + DeleteSubnetOptions deleteSubnetOptions = new DeleteSubnetOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteSecurityGroup(deleteSecurityGroupOptions).execute(); + Response response = service.deleteSubnet(deleteSubnetOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16630,16 +17399,15 @@ public void testDeleteSecurityGroup() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteSecurityGroup" }) - public void testDeleteSecurityGroupRule() throws Exception { + @Test(dependsOnMethods = { "testDeleteSubnet" }) + public void testUnsetSubnetPublicGateway() throws Exception { try { - DeleteSecurityGroupRuleOptions deleteSecurityGroupRuleOptions = new DeleteSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") + UnsetSubnetPublicGatewayOptions unsetSubnetPublicGatewayOptions = new UnsetSubnetPublicGatewayOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteSecurityGroupRule(deleteSecurityGroupRuleOptions).execute(); + Response response = service.unsetSubnetPublicGateway(unsetSubnetPublicGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16649,16 +17417,16 @@ public void testDeleteSecurityGroupRule() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteSecurityGroupRule" }) - public void testDeleteSecurityGroupTargetBinding() throws Exception { + @Test(dependsOnMethods = { "testUnsetSubnetPublicGateway" }) + public void testDeleteSubnetReservedIp() throws Exception { try { - DeleteSecurityGroupTargetBindingOptions deleteSecurityGroupTargetBindingOptions = new DeleteSecurityGroupTargetBindingOptions.Builder() - .securityGroupId("testString") + DeleteSubnetReservedIpOptions deleteSubnetReservedIpOptions = new DeleteSubnetReservedIpOptions.Builder() + .subnetId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptions).execute(); + Response response = service.deleteSubnetReservedIp(deleteSubnetReservedIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16668,33 +17436,39 @@ public void testDeleteSecurityGroupTargetBinding() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteSecurityGroupTargetBinding" }) - public void testDeleteIkePolicy() throws Exception { + @Test(dependsOnMethods = { "testDeleteSubnetReservedIp" }) + public void testDeleteVirtualNetworkInterfaces() throws Exception { try { - DeleteIkePolicyOptions deleteIkePolicyOptions = new DeleteIkePolicyOptions.Builder() + DeleteVirtualNetworkInterfacesOptions deleteVirtualNetworkInterfacesOptions = new DeleteVirtualNetworkInterfacesOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteIkePolicy(deleteIkePolicyOptions).execute(); + Response response = service.deleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); + + VirtualNetworkInterface virtualNetworkInterfaceResult = response.getResult(); + assertNotNull(virtualNetworkInterfaceResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteIkePolicy" }) - public void testDeleteIpsecPolicy() throws Exception { + @Test(dependsOnMethods = { "testDeleteVirtualNetworkInterfaces" }) + public void testRemoveNetworkInterfaceFloatingIp() throws Exception { try { - DeleteIpsecPolicyOptions deleteIpsecPolicyOptions = new DeleteIpsecPolicyOptions.Builder() + RemoveNetworkInterfaceFloatingIpOptions removeNetworkInterfaceFloatingIpOptions = new RemoveNetworkInterfaceFloatingIpOptions.Builder() + .virtualNetworkInterfaceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteIpsecPolicy(deleteIpsecPolicyOptions).execute(); + Response response = service.removeNetworkInterfaceFloatingIp(removeNetworkInterfaceFloatingIpOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16704,54 +17478,54 @@ public void testDeleteIpsecPolicy() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteIpsecPolicy" }) - public void testDeleteVpnGateway() throws Exception { + @Test(dependsOnMethods = { "testRemoveNetworkInterfaceFloatingIp" }) + public void testRemoveVirtualNetworkInterfaceIp() throws Exception { try { - DeleteVpnGatewayOptions deleteVpnGatewayOptions = new DeleteVpnGatewayOptions.Builder() + RemoveVirtualNetworkInterfaceIpOptions removeVirtualNetworkInterfaceIpOptions = new RemoveVirtualNetworkInterfaceIpOptions.Builder() + .virtualNetworkInterfaceId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteVpnGateway(deleteVpnGatewayOptions).execute(); + Response response = service.removeVirtualNetworkInterfaceIp(removeVirtualNetworkInterfaceIpOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpnGateway" }) - public void testDeleteVpnGatewayConnection() throws Exception { + @Test(dependsOnMethods = { "testRemoveVirtualNetworkInterfaceIp" }) + public void testDeleteVolume() throws Exception { try { - DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptions = new DeleteVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") + DeleteVolumeOptions deleteVolumeOptions = new DeleteVolumeOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteVpnGatewayConnection(deleteVpnGatewayConnectionOptions).execute(); + Response response = service.deleteVolume(deleteVolumeOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpnGatewayConnection" }) - public void testRemoveVpnGatewayConnectionsLocalCidr() throws Exception { + @Test(dependsOnMethods = { "testDeleteVolume" }) + public void testDeleteVpc() throws Exception { try { - RemoveVpnGatewayConnectionsLocalCidrOptions removeVpnGatewayConnectionsLocalCidrOptions = new RemoveVpnGatewayConnectionsLocalCidrOptions.Builder() - .vpnGatewayId("testString") + DeleteVpcOptions deleteVpcOptions = new DeleteVpcOptions.Builder() .id("testString") - .cidr("192.168.1.0/24") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.removeVpnGatewayConnectionsLocalCidr(removeVpnGatewayConnectionsLocalCidrOptions).execute(); + Response response = service.deleteVpc(deleteVpcOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16761,17 +17535,16 @@ public void testRemoveVpnGatewayConnectionsLocalCidr() throws Exception { } } - @Test(dependsOnMethods = { "testRemoveVpnGatewayConnectionsLocalCidr" }) - public void testRemoveVpnGatewayConnectionsPeerCidr() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpc" }) + public void testDeleteVpcAddressPrefix() throws Exception { try { - RemoveVpnGatewayConnectionsPeerCidrOptions removeVpnGatewayConnectionsPeerCidrOptions = new RemoveVpnGatewayConnectionsPeerCidrOptions.Builder() - .vpnGatewayId("testString") + DeleteVpcAddressPrefixOptions deleteVpcAddressPrefixOptions = new DeleteVpcAddressPrefixOptions.Builder() + .vpcId("testString") .id("testString") - .cidr("192.168.1.0/24") .build(); // Invoke operation - Response response = service.removeVpnGatewayConnectionsPeerCidr(removeVpnGatewayConnectionsPeerCidrOptions).execute(); + Response response = service.deleteVpcAddressPrefix(deleteVpcAddressPrefixOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16781,133 +17554,133 @@ public void testRemoveVpnGatewayConnectionsPeerCidr() throws Exception { } } - @Test(dependsOnMethods = { "testRemoveVpnGatewayConnectionsPeerCidr" }) - public void testDeleteVpnServer() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpcAddressPrefix" }) + public void testDeleteVpcDnsResolutionBinding() throws Exception { try { - DeleteVpnServerOptions deleteVpnServerOptions = new DeleteVpnServerOptions.Builder() + DeleteVpcDnsResolutionBindingOptions deleteVpcDnsResolutionBindingOptions = new DeleteVpcDnsResolutionBindingOptions.Builder() + .vpcId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteVpnServer(deleteVpnServerOptions).execute(); + Response response = service.deleteVpcDnsResolutionBinding(deleteVpcDnsResolutionBindingOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); + + VPCDNSResolutionBinding vpcdnsResolutionBindingResult = response.getResult(); + assertNotNull(vpcdnsResolutionBindingResult); + } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpnServer" }) - public void testDeleteVpnServerClient() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpcDnsResolutionBinding" }) + public void testDeleteVpcRoute() throws Exception { try { - DeleteVpnServerClientOptions deleteVpnServerClientOptions = new DeleteVpnServerClientOptions.Builder() - .vpnServerId("testString") + DeleteVpcRouteOptions deleteVpcRouteOptions = new DeleteVpcRouteOptions.Builder() + .vpcId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deleteVpnServerClient(deleteVpnServerClientOptions).execute(); + Response response = service.deleteVpcRoute(deleteVpcRouteOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpnServerClient" }) - public void testDeleteVpnServerRoute() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpcRoute" }) + public void testDeleteVpcRoutingTable() throws Exception { try { - DeleteVpnServerRouteOptions deleteVpnServerRouteOptions = new DeleteVpnServerRouteOptions.Builder() - .vpnServerId("testString") + DeleteVpcRoutingTableOptions deleteVpcRoutingTableOptions = new DeleteVpcRoutingTableOptions.Builder() + .vpcId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteVpnServerRoute(deleteVpnServerRouteOptions).execute(); + Response response = service.deleteVpcRoutingTable(deleteVpcRoutingTableOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteVpnServerRoute" }) - public void testDeleteLoadBalancer() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpcRoutingTable" }) + public void testDeleteVpcRoutingTableRoute() throws Exception { try { - DeleteLoadBalancerOptions deleteLoadBalancerOptions = new DeleteLoadBalancerOptions.Builder() + DeleteVpcRoutingTableRouteOptions deleteVpcRoutingTableRouteOptions = new DeleteVpcRoutingTableRouteOptions.Builder() + .vpcId("testString") + .routingTableId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteLoadBalancer(deleteLoadBalancerOptions).execute(); + Response response = service.deleteVpcRoutingTableRoute(deleteVpcRoutingTableRouteOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteLoadBalancer" }) - public void testDeleteLoadBalancerListener() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpcRoutingTableRoute" }) + public void testDeleteIkePolicy() throws Exception { try { - DeleteLoadBalancerListenerOptions deleteLoadBalancerListenerOptions = new DeleteLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") + DeleteIkePolicyOptions deleteIkePolicyOptions = new DeleteIkePolicyOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteLoadBalancerListener(deleteLoadBalancerListenerOptions).execute(); + Response response = service.deleteIkePolicy(deleteIkePolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteLoadBalancerListener" }) - public void testDeleteLoadBalancerListenerPolicy() throws Exception { + @Test(dependsOnMethods = { "testDeleteIkePolicy" }) + public void testDeleteIpsecPolicy() throws Exception { try { - DeleteLoadBalancerListenerPolicyOptions deleteLoadBalancerListenerPolicyOptions = new DeleteLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") + DeleteIpsecPolicyOptions deleteIpsecPolicyOptions = new DeleteIpsecPolicyOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptions).execute(); + Response response = service.deleteIpsecPolicy(deleteIpsecPolicyOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteLoadBalancerListenerPolicy" }) - public void testDeleteLoadBalancerListenerPolicyRule() throws Exception { + @Test(dependsOnMethods = { "testDeleteIpsecPolicy" }) + public void testDeleteVpnGateway() throws Exception { try { - DeleteLoadBalancerListenerPolicyRuleOptions deleteLoadBalancerListenerPolicyRuleOptions = new DeleteLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") + DeleteVpnGatewayOptions deleteVpnGatewayOptions = new DeleteVpnGatewayOptions.Builder() .id("testString") .build(); // Invoke operation - Response response = service.deleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptions).execute(); + Response response = service.deleteVpnGateway(deleteVpnGatewayOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); @@ -16917,36 +17690,36 @@ public void testDeleteLoadBalancerListenerPolicyRule() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteLoadBalancerListenerPolicyRule" }) - public void testDeleteLoadBalancerPool() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpnGateway" }) + public void testRemoveVpnGatewayAdvertisedCidr() throws Exception { try { - DeleteLoadBalancerPoolOptions deleteLoadBalancerPoolOptions = new DeleteLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .id("testString") + RemoveVpnGatewayAdvertisedCidrOptions removeVpnGatewayAdvertisedCidrOptions = new RemoveVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.3.0/24") .build(); // Invoke operation - Response response = service.deleteLoadBalancerPool(deleteLoadBalancerPoolOptions).execute(); + Response response = service.removeVpnGatewayAdvertisedCidr(removeVpnGatewayAdvertisedCidrOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 202); + assertEquals(response.getStatusCode(), 204); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteLoadBalancerPool" }) - public void testDeleteLoadBalancerPoolMember() throws Exception { + @Test(dependsOnMethods = { "testRemoveVpnGatewayAdvertisedCidr" }) + public void testDeleteVpnGatewayConnection() throws Exception { try { - DeleteLoadBalancerPoolMemberOptions deleteLoadBalancerPoolMemberOptions = new DeleteLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") + DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptions = new DeleteVpnGatewayConnectionOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptions).execute(); + Response response = service.deleteVpnGatewayConnection(deleteVpnGatewayConnectionOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 202); @@ -16956,16 +17729,17 @@ public void testDeleteLoadBalancerPoolMember() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteLoadBalancerPoolMember" }) - public void testRemoveEndpointGatewayIp() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpnGatewayConnection" }) + public void testRemoveVpnGatewayConnectionsLocalCidr() throws Exception { try { - RemoveEndpointGatewayIpOptions removeEndpointGatewayIpOptions = new RemoveEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") + RemoveVpnGatewayConnectionsLocalCidrOptions removeVpnGatewayConnectionsLocalCidrOptions = new RemoveVpnGatewayConnectionsLocalCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .cidr("192.168.3.0/24") .build(); // Invoke operation - Response response = service.removeEndpointGatewayIp(removeEndpointGatewayIpOptions).execute(); + Response response = service.removeVpnGatewayConnectionsLocalCidr(removeVpnGatewayConnectionsLocalCidrOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16975,15 +17749,17 @@ public void testRemoveEndpointGatewayIp() throws Exception { } } - @Test(dependsOnMethods = { "testRemoveEndpointGatewayIp" }) - public void testDeleteEndpointGateway() throws Exception { + @Test(dependsOnMethods = { "testRemoveVpnGatewayConnectionsLocalCidr" }) + public void testRemoveVpnGatewayConnectionsPeerCidr() throws Exception { try { - DeleteEndpointGatewayOptions deleteEndpointGatewayOptions = new DeleteEndpointGatewayOptions.Builder() + RemoveVpnGatewayConnectionsPeerCidrOptions removeVpnGatewayConnectionsPeerCidrOptions = new RemoveVpnGatewayConnectionsPeerCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .cidr("192.168.3.0/24") .build(); // Invoke operation - Response response = service.deleteEndpointGateway(deleteEndpointGatewayOptions).execute(); + Response response = service.removeVpnGatewayConnectionsPeerCidr(removeVpnGatewayConnectionsPeerCidrOptions).execute(); // Validate response assertNotNull(response); assertEquals(response.getStatusCode(), 204); @@ -16993,55 +17769,57 @@ public void testDeleteEndpointGateway() throws Exception { } } - @Test(dependsOnMethods = { "testDeleteEndpointGateway" }) - public void testDeleteFlowLogCollector() throws Exception { + @Test(dependsOnMethods = { "testRemoveVpnGatewayConnectionsPeerCidr" }) + public void testDeleteVpnServer() throws Exception { try { - DeleteFlowLogCollectorOptions deleteFlowLogCollectorOptions = new DeleteFlowLogCollectorOptions.Builder() + DeleteVpnServerOptions deleteVpnServerOptions = new DeleteVpnServerOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); // Invoke operation - Response response = service.deleteFlowLogCollector(deleteFlowLogCollectorOptions).execute(); + Response response = service.deleteVpnServer(deleteVpnServerOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeleteFlowLogCollector" }) - public void testDeletePrivatePathServiceGateway() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpnServer" }) + public void testDeleteVpnServerClient() throws Exception { try { - DeletePrivatePathServiceGatewayOptions deletePrivatePathServiceGatewayOptions = new DeletePrivatePathServiceGatewayOptions.Builder() + DeleteVpnServerClientOptions deleteVpnServerClientOptions = new DeleteVpnServerClientOptions.Builder() + .vpnServerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deletePrivatePathServiceGateway(deletePrivatePathServiceGatewayOptions).execute(); + Response response = service.deleteVpnServerClient(deleteVpnServerClientOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); } } - @Test(dependsOnMethods = { "testDeletePrivatePathServiceGateway" }) - public void testDeletePrivatePathServiceGatewayAccountPolicy() throws Exception { + @Test(dependsOnMethods = { "testDeleteVpnServerClient" }) + public void testDeleteVpnServerRoute() throws Exception { try { - DeletePrivatePathServiceGatewayAccountPolicyOptions deletePrivatePathServiceGatewayAccountPolicyOptions = new DeletePrivatePathServiceGatewayAccountPolicyOptions.Builder() - .privatePathServiceGatewayId("testString") + DeleteVpnServerRouteOptions deleteVpnServerRouteOptions = new DeleteVpnServerRouteOptions.Builder() + .vpnServerId("testString") .id("testString") .build(); // Invoke operation - Response response = service.deletePrivatePathServiceGatewayAccountPolicy(deletePrivatePathServiceGatewayAccountPolicyOptions).execute(); + Response response = service.deleteVpnServerRoute(deleteVpnServerRouteOptions).execute(); // Validate response assertNotNull(response); - assertEquals(response.getStatusCode(), 204); + assertEquals(response.getStatusCode(), 202); } catch (ServiceResponseException e) { fail(String.format("Service returned status code %d: %s%nError details: %s", e.getStatusCode(), e.getMessage(), e.getDebuggingInfo())); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcTest.java index 9ce99bc64a..2139891d3e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/VpcTest.java @@ -23,6 +23,7 @@ import com.ibm.cloud.is.vpc.v1.model.AddInstanceNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.AddVirtualNetworkInterfaceIpOptions; +import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.AddressPrefix; @@ -78,15 +79,21 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerCollection; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerConsoleAccessToken; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDisk; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskAllowedUse; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskCollection; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskPatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerFirmware; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerHealthReason; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitialization; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfile; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccount; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataService; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePatch; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachment; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentByPCI; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentByVLAN; @@ -191,6 +198,7 @@ import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentity; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.CertificateInstanceReference; +import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.CloudObjectStorageBucketIdentity; @@ -260,6 +268,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.CreateDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.CreateEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.CreateEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.CreateFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.CreateFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.CreateIkePolicyOptions; @@ -390,6 +399,7 @@ import com.ibm.cloud.is.vpc.v1.model.DeleteDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.DeleteEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.DeleteIkePolicyOptions; @@ -470,6 +480,15 @@ import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReservedIPReservedIPIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReservedIPReservedIPIdentityById; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayReservedIPReservedIPPrototypeTargetContext; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBinding; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingCollection; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingPatch; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTarget; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetCRN; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetPrototype; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingsPager; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTarget; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetPrivatePathServiceGatewayReference; import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayTargetPrototype; @@ -573,6 +592,7 @@ import com.ibm.cloud.is.vpc.v1.model.GetDedicatedHostProfileOptions; import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.GetFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.GetFlowLogCollectorOptions; import com.ibm.cloud.is.vpc.v1.model.GetIkePolicyOptions; @@ -649,6 +669,7 @@ import com.ibm.cloud.is.vpc.v1.model.GetVpcRoutingTableRouteOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayConnectionOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayServiceConnectionOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerClientConfigurationOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerClientOptions; import com.ibm.cloud.is.vpc.v1.model.GetVpnServerOptions; @@ -667,6 +688,11 @@ import com.ibm.cloud.is.vpc.v1.model.IkePoliciesPager; import com.ibm.cloud.is.vpc.v1.model.IkePolicyConnectionsPager; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUse; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePrototype; +import com.ibm.cloud.is.vpc.v1.model.ImageBareMetalServerProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.ImageBareMetalServerProfilesPager; import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.ImageCollection; import com.ibm.cloud.is.vpc.v1.model.ImageExportJob; @@ -680,6 +706,8 @@ import com.ibm.cloud.is.vpc.v1.model.ImageIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ImageIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.ImageIdentityById; +import com.ibm.cloud.is.vpc.v1.model.ImageInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.ImageInstanceProfilesPager; import com.ibm.cloud.is.vpc.v1.model.ImagePatch; import com.ibm.cloud.is.vpc.v1.model.ImagePrototype; import com.ibm.cloud.is.vpc.v1.model.ImagePrototypeImageByFile; @@ -732,12 +760,10 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototype; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionReference; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionScheduledAction; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionScheduledActionGroupTarget; @@ -772,6 +798,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembership; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipReferenceInstanceContext; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipsPager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupPatch; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReference; @@ -888,17 +915,23 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileSupportedSecureBootModes; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPU; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUArchitecture; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUBurstLimit; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUBurstLimitFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUDependent; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUEnum; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUManufacturer; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUManufacturerDependent; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUManufacturerFixed; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUPercentage; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPURange; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidth; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthDependent; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthEnum; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthFixed; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModes; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModesDependent; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModesEnum; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthRange; import com.ibm.cloud.is.vpc.v1.model.InstancePrototype; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByCatalogOffering; @@ -948,6 +981,9 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceTemplate; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateReference; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUBurst; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.InstancesPager; import com.ibm.cloud.is.vpc.v1.model.IpsecPoliciesPager; import com.ibm.cloud.is.vpc.v1.model.IpsecPolicyConnectionsPager; @@ -984,12 +1020,15 @@ import com.ibm.cloud.is.vpc.v1.model.ListDedicatedHostProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListDedicatedHostsOptions; import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewayIpsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewayResourceBindingsOptions; import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewaysOptions; import com.ibm.cloud.is.vpc.v1.model.ListFloatingIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListFlowLogCollectorsOptions; import com.ibm.cloud.is.vpc.v1.model.ListIkePoliciesOptions; import com.ibm.cloud.is.vpc.v1.model.ListIkePolicyConnectionsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListImageBareMetalServerProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListImageExportJobsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListImageInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListImagesOptions; import com.ibm.cloud.is.vpc.v1.model.ListInstanceClusterNetworkAttachmentsOptions; import com.ibm.cloud.is.vpc.v1.model.ListInstanceDisksOptions; @@ -1039,11 +1078,13 @@ import com.ibm.cloud.is.vpc.v1.model.ListSharesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotClonesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotConsistencyGroupsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListSnapshotInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListSnapshotsOptions; import com.ibm.cloud.is.vpc.v1.model.ListSubnetReservedIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListSubnetsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVirtualNetworkInterfaceIpsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVirtualNetworkInterfacesOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVolumeInstanceProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVolumeProfilesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVolumesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcAddressPrefixesOptions; @@ -1052,9 +1093,11 @@ import com.ibm.cloud.is.vpc.v1.model.ListVpcRoutingTableRoutesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcRoutingTablesOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpcsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayAdvertisedCidrsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsLocalCidrsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayConnectionsPeerCidrsOptions; +import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayServiceConnectionsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewaysOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnServerClientsOptions; import com.ibm.cloud.is.vpc.v1.model.ListVpnServerRoutesOptions; @@ -1147,7 +1190,8 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberPrototype; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberReference; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTarget; -import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetIP; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetByReservedIp; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetIPNotReservedIP; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetInstanceReference; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetLoadBalancerReference; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototype; @@ -1160,6 +1204,9 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeLoadBalancerIdentityLoadBalancerIdentityById; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolPatch; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolPrototypeLoadBalancerContext; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolReference; @@ -1192,6 +1239,7 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSourceIPSessionPersistenceSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSourceIPSessionPersistenceSupportedDependent; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSourceIPSessionPersistenceSupportedFixed; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileTargetableResourceTypes; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupported; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedDependent; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedFixed; @@ -1219,20 +1267,28 @@ import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleCollection; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItem; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolIndividual; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolTCPUDP; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolIndividual; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePatch; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContext; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDPPrototype; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDPPrototype; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.NetworkAclRulesPager; @@ -1311,6 +1367,7 @@ import com.ibm.cloud.is.vpc.v1.model.RemoveInstanceNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveNetworkInterfaceFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVirtualNetworkInterfaceIpOptions; +import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayAdvertisedCidrOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayConnectionsLocalCidrOptions; import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayConnectionsPeerCidrOptions; import com.ibm.cloud.is.vpc.v1.model.ReplaceBareMetalServerInitializationOptions; @@ -1424,9 +1481,14 @@ import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeCIDR; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeIP; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePatch; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolAny; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolIndividual; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototype; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemote; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemoteCIDR; @@ -1446,7 +1508,6 @@ import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeSecurityGroupIdentitySecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemoteSecurityGroupReference; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleSecurityGroupRuleProtocolAll; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleSecurityGroupRuleProtocolICMP; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetCollection; @@ -1494,6 +1555,19 @@ import com.ibm.cloud.is.vpc.v1.model.ShareMountTargetsPager; import com.ibm.cloud.is.vpc.v1.model.SharePatch; import com.ibm.cloud.is.vpc.v1.model.ShareProfile; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedAccessProtocols; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedAccessProtocolsSubset; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedTransitEncryptionModes; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedTransitEncryptionModesSubset; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModes; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModesEnum; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModesFixed; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidth; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthDependent; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthDependentRange; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthEnum; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthFixed; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthRange; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCapacity; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCapacityDependentRange; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCapacityEnum; @@ -1510,6 +1584,8 @@ import com.ibm.cloud.is.vpc.v1.model.ShareProfileIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.ShareProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.ShareProfileReference; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileStorageGeneration; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileStorageGenerationFixed; import com.ibm.cloud.is.vpc.v1.model.ShareProfilesPager; import com.ibm.cloud.is.vpc.v1.model.SharePrototype; import com.ibm.cloud.is.vpc.v1.model.SharePrototypeShareByOriginShare; @@ -1535,6 +1611,9 @@ import com.ibm.cloud.is.vpc.v1.model.ShareSourceSnapshotShareSnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SharesPager; import com.ibm.cloud.is.vpc.v1.model.Snapshot; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUse; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.SnapshotClone; import com.ibm.cloud.is.vpc.v1.model.SnapshotCloneCollection; @@ -1552,6 +1631,8 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SnapshotInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.SnapshotInstanceProfilesPager; import com.ibm.cloud.is.vpc.v1.model.SnapshotPatch; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceSnapshot; @@ -1600,6 +1681,7 @@ import com.ibm.cloud.is.vpc.v1.model.UpdateDedicatedHostGroupOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateDedicatedHostOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateEndpointGatewayOptions; +import com.ibm.cloud.is.vpc.v1.model.UpdateEndpointGatewayResourceBindingOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFirmwareForBareMetalServerOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFloatingIpOptions; import com.ibm.cloud.is.vpc.v1.model.UpdateFlowLogCollectorOptions; @@ -1689,6 +1771,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCReferenceRemote; import com.ibm.cloud.is.vpc.v1.model.VPCRemote; import com.ibm.cloud.is.vpc.v1.model.VPNGateway; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayAdvertisedCIDRCollection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayCollection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnection; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionCIDRs; @@ -1696,6 +1779,15 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPD; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPDPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPDPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeLocal; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeLocalPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeer; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeTunnel; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentity; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN; @@ -1720,6 +1812,9 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatch; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerFQDNPatch; @@ -1736,10 +1831,12 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPolicyModePeerVPNGatewayConnectionPeerByAddress; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPolicyModePeerVPNGatewayConnectionPeerByFQDN; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionReference; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionRouteMode; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionRouteModeVPNGatewayConnectionStaticRouteMode; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStaticRouteModeLocal; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStaticRouteModeLocalPrototype; @@ -1751,6 +1848,8 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStaticRouteModePeerVPNGatewayConnectionPeerByFQDN; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStaticRouteModeTunnel; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStatusReason; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnel; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnelPrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnelStatusReason; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayHealthReason; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayLifecycleReason; @@ -1763,6 +1862,12 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayPrototypeVPNGatewayPolicyModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayPrototypeVPNGatewayRouteModePrototype; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayRouteMode; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCollection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCreator; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCreatorTransitGatewayReference; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionStatusReason; import com.ibm.cloud.is.vpc.v1.model.VPNServer; import com.ibm.cloud.is.vpc.v1.model.VPNServerAuthentication; import com.ibm.cloud.is.vpc.v1.model.VPNServerAuthenticationByCertificate; @@ -1804,6 +1909,9 @@ import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceTargetShareMountTargetReference; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacesPager; import com.ibm.cloud.is.vpc.v1.model.Volume; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUse; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachment; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentCollection; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentDevice; @@ -1829,6 +1937,8 @@ import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityByHref; import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.VolumeInstanceProfilesPager; import com.ibm.cloud.is.vpc.v1.model.VolumePatch; import com.ibm.cloud.is.vpc.v1.model.VolumeProfile; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileAdjustableCapacityStates; @@ -1878,6 +1988,7 @@ import com.ibm.cloud.is.vpc.v1.model.VpcRoutingTablesPager; import com.ibm.cloud.is.vpc.v1.model.VpcsPager; import com.ibm.cloud.is.vpc.v1.model.VpnGatewayConnectionsPager; +import com.ibm.cloud.is.vpc.v1.model.VpnGatewayServiceConnectionsPager; import com.ibm.cloud.is.vpc.v1.model.VpnGatewaysPager; import com.ibm.cloud.is.vpc.v1.model.VpnServerClientsPager; import com.ibm.cloud.is.vpc.v1.model.VpnServerRoutesPager; @@ -1919,6 +2030,7 @@ public class VpcTest { protected MockWebServer server; protected Vpc vpcService; + String version = "2025-12-16"; // Construct the service with a null authenticator (negative test) @Test(expectedExceptions = IllegalArgumentException.class) @@ -1938,6 +2050,7 @@ public void testGetServiceUrlForRegion() throws Throwable { assertEquals(Vpc.getServiceUrlForRegion("eu-de"), "https://eu-de.iaas.cloud.ibm.com/v1"); assertEquals(Vpc.getServiceUrlForRegion("eu-es"), "https://eu-es.iaas.cloud.ibm.com/v1"); assertEquals(Vpc.getServiceUrlForRegion("eu-gb"), "https://eu-gb.iaas.cloud.ibm.com/v1"); + assertEquals(Vpc.getServiceUrlForRegion("in-che"), "https://in-che.iaas.cloud.ibm.com/v1"); assertEquals(Vpc.getServiceUrlForRegion("jp-osa"), "https://jp-osa.iaas.cloud.ibm.com/v1"); assertEquals(Vpc.getServiceUrlForRegion("jp-tok"), "https://jp-tok.iaas.cloud.ibm.com/v1"); assertEquals(Vpc.getServiceUrlForRegion("us-east"), "https://us-east.iaas.cloud.ibm.com/v1"); @@ -1948,32 +2061,33 @@ public void testGetServiceUrlForRegion() throws Throwable { // Test the getter for the version global parameter @Test public void testGetVersion() throws Throwable { - assertEquals(vpcService.getVersion(), "2025-07-08"); + assertEquals(vpcService.getVersion(), version); } - // Test the listVpcs operation with a valid options model parameter + // Test the listBackupPolicies operation with a valid options model parameter @Test - public void testListVpcsWOptions() throws Throwable { + public void testListBackupPoliciesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"vpcs\": [{\"classic_access\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"cse_source_ips\": [{\"ip\": {\"address\": \"192.168.3.4\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"default_network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"default_routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"default_security_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}, \"dns\": {\"enable_hub\": false, \"resolution_binding_count\": 0, \"resolver\": {\"servers\": [{\"address\": \"192.168.3.4\", \"zone_affinity\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"type\": \"delegated\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}}, \"health_reasons\": [{\"code\": \"dns_resolution_binding_failed\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpc\", \"status\": \"available\"}]}"; - String listVpcsPath = "/vpcs"; + String mockResponseBody = "{\"backup_policies\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listBackupPoliciesPath = "/backup_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpcsOptions model - ListVpcsOptions listVpcsOptionsModel = new ListVpcsOptions.Builder() + // Construct an instance of the ListBackupPoliciesOptions model + ListBackupPoliciesOptions listBackupPoliciesOptionsModel = new ListBackupPoliciesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .classicAccess(true) + .name("my-name") + .tag("testString") .build(); - // Invoke listVpcs() with a valid options model and verify the result - Response response = vpcService.listVpcs(listVpcsOptionsModel).execute(); + // Invoke listBackupPolicies() with a valid options model and verify the result + Response response = vpcService.listBackupPolicies(listBackupPoliciesOptionsModel).execute(); assertNotNull(response); - VPCCollection responseObj = response.getResult(); + BackupPolicyCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -1982,34 +2096,35 @@ public void testListVpcsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpcsPath); + assertEquals(parsedPath, listBackupPoliciesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(Boolean.valueOf(query.get("classic_access")), Boolean.valueOf(true)); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("tag"), "testString"); } - // Test the listVpcs operation with and without retries enabled + // Test the listBackupPolicies operation with and without retries enabled @Test - public void testListVpcsWRetries() throws Throwable { + public void testListBackupPoliciesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpcsWOptions(); + testListBackupPoliciesWOptions(); vpcService.disableRetries(); - testListVpcsWOptions(); + testListBackupPoliciesWOptions(); } - // Test the listVpcs operation using the VpcsPager.getNext() method + // Test the listBackupPolicies operation using the BackupPoliciesPager.getNext() method @Test - public void testListVpcsWithPagerGetNext() throws Throwable { + public void testListBackupPoliciesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"dns\":{\"enable_hub\":false,\"resolution_binding_count\":0,\"resolver\":{\"servers\":[{\"address\":\"192.168.3.4\",\"zone_affinity\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"type\":\"delegated\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}},\"health_reasons\":[{\"code\":\"dns_resolution_binding_failed\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"public_address_ranges\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"name\":\"my-public-address-range\",\"resource_type\":\"public_address_range\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"dns\":{\"enable_hub\":false,\"resolution_binding_count\":0,\"resolver\":{\"servers\":[{\"address\":\"192.168.3.4\",\"zone_affinity\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"type\":\"delegated\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}},\"health_reasons\":[{\"code\":\"dns_resolution_binding_failed\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"public_address_ranges\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"name\":\"my-public-address-range\",\"resource_type\":\"public_address_range\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"health_reasons\":[{\"code\":\"missing_service_authorization_policies\",\"message\":\"One or more accounts are missing service authorization policies\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\",\"scope\":{\"crn\":\"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\",\"id\":\"ebc2b430240943458b9e91e1432cfcce\",\"resource_type\":\"enterprise\"},\"included_content\":[\"data_volumes\"],\"match_resource_type\":\"instance\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"health_reasons\":[{\"code\":\"missing_service_authorization_policies\",\"message\":\"One or more accounts are missing service authorization policies\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\",\"scope\":{\"crn\":\"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\",\"id\":\"ebc2b430240943458b9e91e1432cfcce\",\"resource_type\":\"enterprise\"},\"included_content\":[\"data_volumes\"],\"match_resource_type\":\"instance\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -2023,28 +2138,29 @@ public void testListVpcsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() + ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .classicAccess(true) + .name("my-name") + .tag("testString") .build(); - List allResults = new ArrayList<>(); - VpcsPager pager = new VpcsPager(vpcService, listVpcsOptions); + List allResults = new ArrayList<>(); + BackupPoliciesPager pager = new BackupPoliciesPager(vpcService, listBackupPoliciesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listVpcs operation using the VpcsPager.getAll() method + // Test the listBackupPolicies operation using the BackupPoliciesPager.getAll() method @Test - public void testListVpcsWithPagerGetAll() throws Throwable { + public void testListBackupPoliciesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"dns\":{\"enable_hub\":false,\"resolution_binding_count\":0,\"resolver\":{\"servers\":[{\"address\":\"192.168.3.4\",\"zone_affinity\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"type\":\"delegated\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}},\"health_reasons\":[{\"code\":\"dns_resolution_binding_failed\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"public_address_ranges\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"name\":\"my-public-address-range\",\"resource_type\":\"public_address_range\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"dns\":{\"enable_hub\":false,\"resolution_binding_count\":0,\"resolver\":{\"servers\":[{\"address\":\"192.168.3.4\",\"zone_affinity\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"type\":\"delegated\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}},\"health_reasons\":[{\"code\":\"dns_resolution_binding_failed\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"public_address_ranges\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"name\":\"my-public-address-range\",\"resource_type\":\"public_address_range\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"health_reasons\":[{\"code\":\"missing_service_authorization_policies\",\"message\":\"One or more accounts are missing service authorization policies\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\",\"scope\":{\"crn\":\"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\",\"id\":\"ebc2b430240943458b9e91e1432cfcce\",\"resource_type\":\"enterprise\"},\"included_content\":[\"data_volumes\"],\"match_resource_type\":\"instance\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"health_reasons\":[{\"code\":\"missing_service_authorization_policies\",\"message\":\"One or more accounts are missing service authorization policies\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\",\"scope\":{\"crn\":\"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\",\"id\":\"ebc2b430240943458b9e91e1432cfcce\",\"resource_type\":\"enterprise\"},\"included_content\":[\"data_volumes\"],\"match_resource_type\":\"instance\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -2058,24 +2174,25 @@ public void testListVpcsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() + ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .classicAccess(true) + .name("my-name") + .tag("testString") .build(); - VpcsPager pager = new VpcsPager(vpcService, listVpcsOptions); - List allResults = pager.getAll(); + BackupPoliciesPager pager = new BackupPoliciesPager(vpcService, listBackupPoliciesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createVpc operation with a valid options model parameter + // Test the createBackupPolicy operation with a valid options model parameter @Test - public void testCreateVpcWOptions() throws Throwable { + public void testCreateBackupPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"classic_access\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"cse_source_ips\": [{\"ip\": {\"address\": \"192.168.3.4\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"default_network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"default_routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"default_security_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}, \"dns\": {\"enable_hub\": false, \"resolution_binding_count\": 0, \"resolver\": {\"servers\": [{\"address\": \"192.168.3.4\", \"zone_affinity\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"type\": \"delegated\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}}, \"health_reasons\": [{\"code\": \"dns_resolution_binding_failed\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"public_address_ranges\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"name\": \"my-public-address-range\", \"resource_type\": \"public_address_range\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpc\", \"status\": \"available\"}"; - String createVpcPath = "/vpcs"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}"; + String createBackupPolicyPath = "/backup_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) @@ -2086,22 +2203,45 @@ public void testCreateVpcWOptions() throws Throwable { .name("us-south-1") .build(); - // Construct an instance of the DNSServerPrototype model - DNSServerPrototype dnsServerPrototypeModel = new DNSServerPrototype.Builder() - .address("192.168.3.4") - .zoneAffinity(zoneIdentityModel) + // Construct an instance of the BackupPolicyPlanClonePolicyPrototype model + BackupPolicyPlanClonePolicyPrototype backupPolicyPlanClonePolicyPrototypeModel = new BackupPolicyPlanClonePolicyPrototype.Builder() + .maxSnapshots(Long.valueOf("5")) + .zones(java.util.Arrays.asList(zoneIdentityModel)) .build(); - // Construct an instance of the VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype model - VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype vpcdnsResolverPrototypeModel = new VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype.Builder() - .manualServers(java.util.Arrays.asList(dnsServerPrototypeModel)) - .type("manual") + // Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model + BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("20")) .build(); - // Construct an instance of the VPCDNSPrototype model - VPCDNSPrototype vpcdnsPrototypeModel = new VPCDNSPrototype.Builder() - .enableHub(false) - .resolver(vpcdnsResolverPrototypeModel) + // Construct an instance of the EncryptionKeyIdentityByCRN model + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + + // Construct an instance of the RegionIdentityByName model + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") + .build(); + + // Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("5")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); + + // Construct an instance of the BackupPolicyPlanPrototype model + BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .clonePolicy(backupPolicyPlanClonePolicyPrototypeModel) + .copyUserTags(true) + .cronSpec("30 */2 * * 1-5") + .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) + .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); // Construct an instance of the ResourceGroupIdentityById model @@ -2109,19 +2249,30 @@ public void testCreateVpcWOptions() throws Throwable { .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the CreateVpcOptions model - CreateVpcOptions createVpcOptionsModel = new CreateVpcOptions.Builder() - .addressPrefixManagement("auto") - .classicAccess(false) - .dns(vpcdnsPrototypeModel) - .name("my-vpc") + // Construct an instance of the BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model + BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN backupPolicyScopePrototypeModel = new BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce") + .build(); + + // Construct an instance of the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model + BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype backupPolicyPrototypeModel = new BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.Builder() + .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) + .name("my-backup-policy") + .plans(java.util.Arrays.asList(backupPolicyPlanPrototypeModel)) .resourceGroup(resourceGroupIdentityModel) + .scope(backupPolicyScopePrototypeModel) + .matchResourceType("volume") .build(); - // Invoke createVpc() with a valid options model and verify the result - Response response = vpcService.createVpc(createVpcOptionsModel).execute(); + // Construct an instance of the CreateBackupPolicyOptions model + CreateBackupPolicyOptions createBackupPolicyOptionsModel = new CreateBackupPolicyOptions.Builder() + .backupPolicyPrototype(backupPolicyPrototypeModel) + .build(); + + // Invoke createBackupPolicy() with a valid options model and verify the result + Response response = vpcService.createBackupPolicy(createBackupPolicyOptionsModel).execute(); assertNotNull(response); - VPC responseObj = response.getResult(); + BackupPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -2130,97 +2281,197 @@ public void testCreateVpcWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpcPath); + assertEquals(parsedPath, createBackupPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpc operation with and without retries enabled + // Test the createBackupPolicy operation with and without retries enabled @Test - public void testCreateVpcWRetries() throws Throwable { + public void testCreateBackupPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpcWOptions(); + testCreateBackupPolicyWOptions(); vpcService.disableRetries(); - testCreateVpcWOptions(); + testCreateBackupPolicyWOptions(); } - // Test the deleteVpc operation with a valid options model parameter + // Test the createBackupPolicy operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateBackupPolicyNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createBackupPolicy(null).execute(); + } + + // Test the listBackupPolicyJobs operation with a valid options model parameter @Test - public void testDeleteVpcWOptions() throws Throwable { + public void testListBackupPolicyJobsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteVpcPath = "/vpcs/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"jobs\": [{\"auto_delete\": true, \"auto_delete_after\": 90, \"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\", \"id\": \"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\", \"job_type\": \"creation\", \"resource_type\": \"backup_policy_job\", \"source\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"failed\", \"status_reasons\": [{\"code\": \"source_volume_busy\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}], \"target_snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listBackupPolicyJobsPath = "/backup_policies/testString/jobs"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpcOptions model - DeleteVpcOptions deleteVpcOptionsModel = new DeleteVpcOptions.Builder() - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + // Construct an instance of the ListBackupPolicyJobsOptions model + ListBackupPolicyJobsOptions listBackupPolicyJobsOptionsModel = new ListBackupPolicyJobsOptions.Builder() + .backupPolicyId("testString") + .status("failed") + .backupPolicyPlanId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .sort("name") + .sourceId("testString") + .targetSnapshotsId("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") .build(); - // Invoke deleteVpc() with a valid options model and verify the result - Response response = vpcService.deleteVpc(deleteVpcOptionsModel).execute(); + // Invoke listBackupPolicyJobs() with a valid options model and verify the result + Response response = vpcService.listBackupPolicyJobs(listBackupPolicyJobsOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + BackupPolicyJobCollection responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpcPath); + assertEquals(parsedPath, listBackupPolicyJobsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("status"), "failed"); + assertEquals(query.get("backup_policy_plan.id"), "testString"); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("sort"), "name"); + assertEquals(query.get("source.id"), "testString"); + assertEquals(query.get("target_snapshots[].id"), "testString"); + assertEquals(query.get("target_snapshots[].crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); } - // Test the deleteVpc operation with and without retries enabled + // Test the listBackupPolicyJobs operation with and without retries enabled @Test - public void testDeleteVpcWRetries() throws Throwable { + public void testListBackupPolicyJobsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpcWOptions(); + testListBackupPolicyJobsWOptions(); vpcService.disableRetries(); - testDeleteVpcWOptions(); + testListBackupPolicyJobsWOptions(); } - // Test the deleteVpc operation with a null options model (negative test) + // Test the listBackupPolicyJobs operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpcNoOptions() throws Throwable { + public void testListBackupPolicyJobsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpc(null).execute(); + vpcService.listBackupPolicyJobs(null).execute(); } - // Test the getVpc operation with a valid options model parameter + // Test the listBackupPolicyJobs operation using the BackupPolicyJobsPager.getNext() method @Test - public void testGetVpcWOptions() throws Throwable { + public void testListBackupPolicyJobsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"jobs\":[{\"auto_delete\":true,\"auto_delete_after\":90,\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"id\":\"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"jobs\":[{\"auto_delete\":true,\"auto_delete_after\":90,\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"id\":\"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() + .backupPolicyId("testString") + .status("failed") + .backupPolicyPlanId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .sourceId("testString") + .targetSnapshotsId("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .build(); + + List allResults = new ArrayList<>(); + BackupPolicyJobsPager pager = new BackupPolicyJobsPager(vpcService, listBackupPolicyJobsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listBackupPolicyJobs operation using the BackupPolicyJobsPager.getAll() method + @Test + public void testListBackupPolicyJobsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"jobs\":[{\"auto_delete\":true,\"auto_delete_after\":90,\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"id\":\"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"jobs\":[{\"auto_delete\":true,\"auto_delete_after\":90,\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"id\":\"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() + .backupPolicyId("testString") + .status("failed") + .backupPolicyPlanId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .sourceId("testString") + .targetSnapshotsId("testString") + .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .build(); + + BackupPolicyJobsPager pager = new BackupPolicyJobsPager(vpcService, listBackupPolicyJobsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the getBackupPolicyJob operation with a valid options model parameter + @Test + public void testGetBackupPolicyJobWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"classic_access\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"cse_source_ips\": [{\"ip\": {\"address\": \"192.168.3.4\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"default_network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"default_routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"default_security_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}, \"dns\": {\"enable_hub\": false, \"resolution_binding_count\": 0, \"resolver\": {\"servers\": [{\"address\": \"192.168.3.4\", \"zone_affinity\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"type\": \"delegated\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}}, \"health_reasons\": [{\"code\": \"dns_resolution_binding_failed\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"public_address_ranges\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"name\": \"my-public-address-range\", \"resource_type\": \"public_address_range\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpc\", \"status\": \"available\"}"; - String getVpcPath = "/vpcs/testString"; + String mockResponseBody = "{\"auto_delete\": true, \"auto_delete_after\": 90, \"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\", \"id\": \"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\", \"job_type\": \"creation\", \"resource_type\": \"backup_policy_job\", \"source\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"failed\", \"status_reasons\": [{\"code\": \"source_volume_busy\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}], \"target_snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; + String getBackupPolicyJobPath = "/backup_policies/testString/jobs/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcOptions model - GetVpcOptions getVpcOptionsModel = new GetVpcOptions.Builder() + // Construct an instance of the GetBackupPolicyJobOptions model + GetBackupPolicyJobOptions getBackupPolicyJobOptionsModel = new GetBackupPolicyJobOptions.Builder() + .backupPolicyId("testString") .id("testString") .build(); - // Invoke getVpc() with a valid options model and verify the result - Response response = vpcService.getVpc(getVpcOptionsModel).execute(); + // Invoke getBackupPolicyJob() with a valid options model and verify the result + Response response = vpcService.getBackupPolicyJob(getBackupPolicyJobOptionsModel).execute(); assertNotNull(response); - VPC responseObj = response.getResult(); + BackupPolicyJob responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -2229,195 +2480,257 @@ public void testGetVpcWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcPath); + assertEquals(parsedPath, getBackupPolicyJobPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpc operation with and without retries enabled + // Test the getBackupPolicyJob operation with and without retries enabled @Test - public void testGetVpcWRetries() throws Throwable { + public void testGetBackupPolicyJobWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpcWOptions(); + testGetBackupPolicyJobWOptions(); vpcService.disableRetries(); - testGetVpcWOptions(); + testGetBackupPolicyJobWOptions(); } - // Test the getVpc operation with a null options model (negative test) + // Test the getBackupPolicyJob operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcNoOptions() throws Throwable { + public void testGetBackupPolicyJobNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpc(null).execute(); + vpcService.getBackupPolicyJob(null).execute(); } - // Test the updateVpc operation with a valid options model parameter + // Test the listBackupPolicyPlans operation with a valid options model parameter @Test - public void testUpdateVpcWOptions() throws Throwable { + public void testListBackupPolicyPlansWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"classic_access\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"cse_source_ips\": [{\"ip\": {\"address\": \"192.168.3.4\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"default_network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"default_routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"default_security_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}, \"dns\": {\"enable_hub\": false, \"resolution_binding_count\": 0, \"resolver\": {\"servers\": [{\"address\": \"192.168.3.4\", \"zone_affinity\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"type\": \"delegated\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}}, \"health_reasons\": [{\"code\": \"dns_resolution_binding_failed\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"public_address_ranges\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"name\": \"my-public-address-range\", \"resource_type\": \"public_address_range\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpc\", \"status\": \"available\"}"; - String updateVpcPath = "/vpcs/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"plans\": [{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}], \"total_count\": 132}"; + String listBackupPolicyPlansPath = "/backup_policies/testString/plans"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); + // Construct an instance of the ListBackupPolicyPlansOptions model + ListBackupPolicyPlansOptions listBackupPolicyPlansOptionsModel = new ListBackupPolicyPlansOptions.Builder() + .backupPolicyId("testString") + .name("my-name") + .build(); + + // Invoke listBackupPolicyPlans() with a valid options model and verify the result + Response response = vpcService.listBackupPolicyPlans(listBackupPolicyPlansOptionsModel).execute(); + assertNotNull(response); + BackupPolicyPlanCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listBackupPolicyPlansPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("name"), "my-name"); + } + + // Test the listBackupPolicyPlans operation with and without retries enabled + @Test + public void testListBackupPolicyPlansWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListBackupPolicyPlansWOptions(); + + vpcService.disableRetries(); + testListBackupPolicyPlansWOptions(); + } + + // Test the listBackupPolicyPlans operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListBackupPolicyPlansNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listBackupPolicyPlans(null).execute(); + } + + // Test the createBackupPolicyPlan operation with a valid options model parameter + @Test + public void testCreateBackupPolicyPlanWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}"; + String createBackupPolicyPlanPath = "/backup_policies/testString/plans"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + // Construct an instance of the ZoneIdentityByName model ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); - // Construct an instance of the DNSServerPrototype model - DNSServerPrototype dnsServerPrototypeModel = new DNSServerPrototype.Builder() - .address("192.168.3.4") - .zoneAffinity(zoneIdentityModel) + // Construct an instance of the BackupPolicyPlanClonePolicyPrototype model + BackupPolicyPlanClonePolicyPrototype backupPolicyPlanClonePolicyPrototypeModel = new BackupPolicyPlanClonePolicyPrototype.Builder() + .maxSnapshots(Long.valueOf("5")) + .zones(java.util.Arrays.asList(zoneIdentityModel)) .build(); - // Construct an instance of the VPCDNSResolverVPCPatchVPCIdentityById model - VPCDNSResolverVPCPatchVPCIdentityById vpcdnsResolverVpcPatchModel = new VPCDNSResolverVPCPatchVPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + // Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model + BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("20")) .build(); - // Construct an instance of the VPCDNSResolverPatch model - VPCDNSResolverPatch vpcdnsResolverPatchModel = new VPCDNSResolverPatch.Builder() - .manualServers(java.util.Arrays.asList(dnsServerPrototypeModel)) - .type("delegated") - .vpc(vpcdnsResolverVpcPatchModel) + // Construct an instance of the EncryptionKeyIdentityByCRN model + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); - // Construct an instance of the VPCDNSPatch model - VPCDNSPatch vpcdnsPatchModel = new VPCDNSPatch.Builder() - .enableHub(true) - .resolver(vpcdnsResolverPatchModel) + // Construct an instance of the RegionIdentityByName model + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") .build(); - // Construct an instance of the VPCPatch model - VPCPatch vpcPatchModel = new VPCPatch.Builder() - .dns(vpcdnsPatchModel) - .name("my-vpc") + // Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("5")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) .build(); - Map vpcPatchModelAsPatch = vpcPatchModel.asPatch(); - // Construct an instance of the UpdateVpcOptions model - UpdateVpcOptions updateVpcOptionsModel = new UpdateVpcOptions.Builder() - .id("testString") - .vpcPatch(vpcPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + // Construct an instance of the CreateBackupPolicyPlanOptions model + CreateBackupPolicyPlanOptions createBackupPolicyPlanOptionsModel = new CreateBackupPolicyPlanOptions.Builder() + .backupPolicyId("testString") + .cronSpec("30 */2 * * 1-5") + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .clonePolicy(backupPolicyPlanClonePolicyPrototypeModel) + .copyUserTags(true) + .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) + .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); - // Invoke updateVpc() with a valid options model and verify the result - Response response = vpcService.updateVpc(updateVpcOptionsModel).execute(); + // Invoke createBackupPolicyPlan() with a valid options model and verify the result + Response response = vpcService.createBackupPolicyPlan(createBackupPolicyPlanOptionsModel).execute(); assertNotNull(response); - VPC responseObj = response.getResult(); + BackupPolicyPlan responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpcPath); + assertEquals(parsedPath, createBackupPolicyPlanPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVpc operation with and without retries enabled + // Test the createBackupPolicyPlan operation with and without retries enabled @Test - public void testUpdateVpcWRetries() throws Throwable { + public void testCreateBackupPolicyPlanWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpcWOptions(); + testCreateBackupPolicyPlanWOptions(); vpcService.disableRetries(); - testUpdateVpcWOptions(); + testCreateBackupPolicyPlanWOptions(); } - // Test the updateVpc operation with a null options model (negative test) + // Test the createBackupPolicyPlan operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpcNoOptions() throws Throwable { + public void testCreateBackupPolicyPlanNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpc(null).execute(); + vpcService.createBackupPolicyPlan(null).execute(); } - // Test the getVpcDefaultNetworkAcl operation with a valid options model parameter + // Test the deleteBackupPolicyPlan operation with a valid options model parameter @Test - public void testGetVpcDefaultNetworkAclWOptions() throws Throwable { + public void testDeleteBackupPolicyPlanWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"mnemonic-ersatz-eatery-mythology\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getVpcDefaultNetworkAclPath = "/vpcs/testString/default_network_acl"; + String mockResponseBody = "{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}"; + String deleteBackupPolicyPlanPath = "/backup_policies/testString/plans/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcDefaultNetworkAclOptions model - GetVpcDefaultNetworkAclOptions getVpcDefaultNetworkAclOptionsModel = new GetVpcDefaultNetworkAclOptions.Builder() + // Construct an instance of the DeleteBackupPolicyPlanOptions model + DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptionsModel = new DeleteBackupPolicyPlanOptions.Builder() + .backupPolicyId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke getVpcDefaultNetworkAcl() with a valid options model and verify the result - Response response = vpcService.getVpcDefaultNetworkAcl(getVpcDefaultNetworkAclOptionsModel).execute(); + // Invoke deleteBackupPolicyPlan() with a valid options model and verify the result + Response response = vpcService.deleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModel).execute(); assertNotNull(response); - DefaultNetworkACL responseObj = response.getResult(); + BackupPolicyPlan responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcDefaultNetworkAclPath); + assertEquals(parsedPath, deleteBackupPolicyPlanPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpcDefaultNetworkAcl operation with and without retries enabled + // Test the deleteBackupPolicyPlan operation with and without retries enabled @Test - public void testGetVpcDefaultNetworkAclWRetries() throws Throwable { + public void testDeleteBackupPolicyPlanWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpcDefaultNetworkAclWOptions(); + testDeleteBackupPolicyPlanWOptions(); vpcService.disableRetries(); - testGetVpcDefaultNetworkAclWOptions(); + testDeleteBackupPolicyPlanWOptions(); } - // Test the getVpcDefaultNetworkAcl operation with a null options model (negative test) + // Test the deleteBackupPolicyPlan operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcDefaultNetworkAclNoOptions() throws Throwable { + public void testDeleteBackupPolicyPlanNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpcDefaultNetworkAcl(null).execute(); + vpcService.deleteBackupPolicyPlan(null).execute(); } - // Test the getVpcDefaultRoutingTable operation with a valid options model parameter + // Test the getBackupPolicyPlan operation with a valid options model parameter @Test - public void testGetVpcDefaultRoutingTableWOptions() throws Throwable { + public void testGetBackupPolicyPlanWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"milled-easy-equine-machines\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; - String getVpcDefaultRoutingTablePath = "/vpcs/testString/default_routing_table"; + String mockResponseBody = "{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}"; + String getBackupPolicyPlanPath = "/backup_policies/testString/plans/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcDefaultRoutingTableOptions model - GetVpcDefaultRoutingTableOptions getVpcDefaultRoutingTableOptionsModel = new GetVpcDefaultRoutingTableOptions.Builder() + // Construct an instance of the GetBackupPolicyPlanOptions model + GetBackupPolicyPlanOptions getBackupPolicyPlanOptionsModel = new GetBackupPolicyPlanOptions.Builder() + .backupPolicyId("testString") .id("testString") .build(); - // Invoke getVpcDefaultRoutingTable() with a valid options model and verify the result - Response response = vpcService.getVpcDefaultRoutingTable(getVpcDefaultRoutingTableOptionsModel).execute(); + // Invoke getBackupPolicyPlan() with a valid options model and verify the result + Response response = vpcService.getBackupPolicyPlan(getBackupPolicyPlanOptionsModel).execute(); assertNotNull(response); - DefaultRoutingTable responseObj = response.getResult(); + BackupPolicyPlan responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -2426,288 +2739,156 @@ public void testGetVpcDefaultRoutingTableWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcDefaultRoutingTablePath); + assertEquals(parsedPath, getBackupPolicyPlanPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpcDefaultRoutingTable operation with and without retries enabled + // Test the getBackupPolicyPlan operation with and without retries enabled @Test - public void testGetVpcDefaultRoutingTableWRetries() throws Throwable { + public void testGetBackupPolicyPlanWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpcDefaultRoutingTableWOptions(); + testGetBackupPolicyPlanWOptions(); vpcService.disableRetries(); - testGetVpcDefaultRoutingTableWOptions(); + testGetBackupPolicyPlanWOptions(); } - // Test the getVpcDefaultRoutingTable operation with a null options model (negative test) + // Test the getBackupPolicyPlan operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcDefaultRoutingTableNoOptions() throws Throwable { + public void testGetBackupPolicyPlanNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpcDefaultRoutingTable(null).execute(); + vpcService.getBackupPolicyPlan(null).execute(); } - // Test the getVpcDefaultSecurityGroup operation with a valid options model parameter + // Test the updateBackupPolicyPlan operation with a valid options model parameter @Test - public void testGetVpcDefaultSecurityGroupWOptions() throws Throwable { + public void testUpdateBackupPolicyPlanWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"observant-chip-emphatic-engraver\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getVpcDefaultSecurityGroupPath = "/vpcs/testString/default_security_group"; + String mockResponseBody = "{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}"; + String updateBackupPolicyPlanPath = "/backup_policies/testString/plans/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcDefaultSecurityGroupOptions model - GetVpcDefaultSecurityGroupOptions getVpcDefaultSecurityGroupOptionsModel = new GetVpcDefaultSecurityGroupOptions.Builder() - .id("testString") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Invoke getVpcDefaultSecurityGroup() with a valid options model and verify the result - Response response = vpcService.getVpcDefaultSecurityGroup(getVpcDefaultSecurityGroupOptionsModel).execute(); - assertNotNull(response); - DefaultSecurityGroup responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcDefaultSecurityGroupPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the getVpcDefaultSecurityGroup operation with and without retries enabled - @Test - public void testGetVpcDefaultSecurityGroupWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetVpcDefaultSecurityGroupWOptions(); - - vpcService.disableRetries(); - testGetVpcDefaultSecurityGroupWOptions(); - } - - // Test the getVpcDefaultSecurityGroup operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcDefaultSecurityGroupNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getVpcDefaultSecurityGroup(null).execute(); - } - - // Test the listVpcAddressPrefixes operation with a valid options model parameter - @Test - public void testListVpcAddressPrefixesWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"address_prefixes\": [{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"has_subnets\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"id\": \"r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"is_default\": false, \"name\": \"my-vpc-address-prefix-zone-1\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listVpcAddressPrefixesPath = "/vpcs/testString/address_prefixes"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListVpcAddressPrefixesOptions model - ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptionsModel = new ListVpcAddressPrefixesOptions.Builder() - .vpcId("testString") - .start("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the BackupPolicyPlanClonePolicyPatch model + BackupPolicyPlanClonePolicyPatch backupPolicyPlanClonePolicyPatchModel = new BackupPolicyPlanClonePolicyPatch.Builder() + .maxSnapshots(Long.valueOf("1")) + .zones(java.util.Arrays.asList(zoneIdentityModel)) .build(); - // Invoke listVpcAddressPrefixes() with a valid options model and verify the result - Response response = vpcService.listVpcAddressPrefixes(listVpcAddressPrefixesOptionsModel).execute(); - assertNotNull(response); - AddressPrefixCollection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpcAddressPrefixesPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - } - - // Test the listVpcAddressPrefixes operation with and without retries enabled - @Test - public void testListVpcAddressPrefixesWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListVpcAddressPrefixesWOptions(); - - vpcService.disableRetries(); - testListVpcAddressPrefixesWOptions(); - } - - // Test the listVpcAddressPrefixes operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpcAddressPrefixesNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listVpcAddressPrefixes(null).execute(); - } - - // Test the listVpcAddressPrefixes operation using the VpcAddressPrefixesPager.getNext() method - @Test - public void testListVpcAddressPrefixesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"id\":\"r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"is_default\":false,\"name\":\"my-vpc-address-prefix-zone-1\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"id\":\"r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"is_default\":false,\"name\":\"my-vpc-address-prefix-zone-1\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() - .vpcId("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the BackupPolicyPlanDeletionTriggerPatch model + BackupPolicyPlanDeletionTriggerPatch backupPolicyPlanDeletionTriggerPatchModel = new BackupPolicyPlanDeletionTriggerPatch.Builder() + .deleteAfter(Long.valueOf("20")) + .deleteOverCount(Long.valueOf("1")) .build(); - List allResults = new ArrayList<>(); - VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(vpcService, listVpcAddressPrefixesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); - } - - // Test the listVpcAddressPrefixes operation using the VpcAddressPrefixesPager.getAll() method - @Test - public void testListVpcAddressPrefixesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"id\":\"r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"is_default\":false,\"name\":\"my-vpc-address-prefix-zone-1\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"id\":\"r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"is_default\":false,\"name\":\"my-vpc-address-prefix-zone-1\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + // Construct an instance of the EncryptionKeyIdentityByCRN model + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); - ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() - .vpcId("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the RegionIdentityByName model + RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() + .name("us-south") .build(); - VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(vpcService, listVpcAddressPrefixesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createVpcAddressPrefix operation with a valid options model parameter - @Test - public void testCreateVpcAddressPrefixWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"has_subnets\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"id\": \"r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"is_default\": false, \"name\": \"my-vpc-address-prefix-zone-1\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createVpcAddressPrefixPath = "/vpcs/testString/address_prefixes"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); + // Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model + BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() + .deleteOverCount(Long.valueOf("5")) + .encryptionKey(encryptionKeyIdentityModel) + .region(regionIdentityModel) + .build(); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the BackupPolicyPlanPatch model + BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() + .active(true) + .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) + .clonePolicy(backupPolicyPlanClonePolicyPatchModel) + .copyUserTags(false) + .cronSpec("30 */2 * * 1-5") + .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) + .name("my-policy-plan") + .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) .build(); + Map backupPolicyPlanPatchModelAsPatch = backupPolicyPlanPatchModel.asPatch(); - // Construct an instance of the CreateVpcAddressPrefixOptions model - CreateVpcAddressPrefixOptions createVpcAddressPrefixOptionsModel = new CreateVpcAddressPrefixOptions.Builder() - .vpcId("testString") - .cidr("10.240.0.0/18") - .zone(zoneIdentityModel) - .isDefault(true) - .name("my-vpc-address-prefix-zone-1") + // Construct an instance of the UpdateBackupPolicyPlanOptions model + UpdateBackupPolicyPlanOptions updateBackupPolicyPlanOptionsModel = new UpdateBackupPolicyPlanOptions.Builder() + .backupPolicyId("testString") + .id("testString") + .backupPolicyPlanPatch(backupPolicyPlanPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke createVpcAddressPrefix() with a valid options model and verify the result - Response response = vpcService.createVpcAddressPrefix(createVpcAddressPrefixOptionsModel).execute(); + // Invoke updateBackupPolicyPlan() with a valid options model and verify the result + Response response = vpcService.updateBackupPolicyPlan(updateBackupPolicyPlanOptionsModel).execute(); assertNotNull(response); - AddressPrefix responseObj = response.getResult(); + BackupPolicyPlan responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpcAddressPrefixPath); + assertEquals(parsedPath, updateBackupPolicyPlanPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpcAddressPrefix operation with and without retries enabled + // Test the updateBackupPolicyPlan operation with and without retries enabled @Test - public void testCreateVpcAddressPrefixWRetries() throws Throwable { + public void testUpdateBackupPolicyPlanWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpcAddressPrefixWOptions(); + testUpdateBackupPolicyPlanWOptions(); vpcService.disableRetries(); - testCreateVpcAddressPrefixWOptions(); + testUpdateBackupPolicyPlanWOptions(); } - // Test the createVpcAddressPrefix operation with a null options model (negative test) + // Test the updateBackupPolicyPlan operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpcAddressPrefixNoOptions() throws Throwable { + public void testUpdateBackupPolicyPlanNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpcAddressPrefix(null).execute(); + vpcService.updateBackupPolicyPlan(null).execute(); } - // Test the deleteVpcAddressPrefix operation with a valid options model parameter + // Test the deleteBackupPolicy operation with a valid options model parameter @Test - public void testDeleteVpcAddressPrefixWOptions() throws Throwable { + public void testDeleteBackupPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteVpcAddressPrefixPath = "/vpcs/testString/address_prefixes/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}"; + String deleteBackupPolicyPath = "/backup_policies/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpcAddressPrefixOptions model - DeleteVpcAddressPrefixOptions deleteVpcAddressPrefixOptionsModel = new DeleteVpcAddressPrefixOptions.Builder() - .vpcId("testString") + // Construct an instance of the DeleteBackupPolicyOptions model + DeleteBackupPolicyOptions deleteBackupPolicyOptionsModel = new DeleteBackupPolicyOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteVpcAddressPrefix() with a valid options model and verify the result - Response response = vpcService.deleteVpcAddressPrefix(deleteVpcAddressPrefixOptionsModel).execute(); + // Invoke deleteBackupPolicy() with a valid options model and verify the result + Response response = vpcService.deleteBackupPolicy(deleteBackupPolicyOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + BackupPolicy responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -2715,52 +2896,51 @@ public void testDeleteVpcAddressPrefixWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpcAddressPrefixPath); + assertEquals(parsedPath, deleteBackupPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpcAddressPrefix operation with and without retries enabled + // Test the deleteBackupPolicy operation with and without retries enabled @Test - public void testDeleteVpcAddressPrefixWRetries() throws Throwable { + public void testDeleteBackupPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpcAddressPrefixWOptions(); + testDeleteBackupPolicyWOptions(); vpcService.disableRetries(); - testDeleteVpcAddressPrefixWOptions(); + testDeleteBackupPolicyWOptions(); } - // Test the deleteVpcAddressPrefix operation with a null options model (negative test) + // Test the deleteBackupPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpcAddressPrefixNoOptions() throws Throwable { + public void testDeleteBackupPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpcAddressPrefix(null).execute(); + vpcService.deleteBackupPolicy(null).execute(); } - // Test the getVpcAddressPrefix operation with a valid options model parameter + // Test the getBackupPolicy operation with a valid options model parameter @Test - public void testGetVpcAddressPrefixWOptions() throws Throwable { + public void testGetBackupPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"has_subnets\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"id\": \"r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"is_default\": false, \"name\": \"my-vpc-address-prefix-zone-1\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getVpcAddressPrefixPath = "/vpcs/testString/address_prefixes/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}"; + String getBackupPolicyPath = "/backup_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcAddressPrefixOptions model - GetVpcAddressPrefixOptions getVpcAddressPrefixOptionsModel = new GetVpcAddressPrefixOptions.Builder() - .vpcId("testString") + // Construct an instance of the GetBackupPolicyOptions model + GetBackupPolicyOptions getBackupPolicyOptionsModel = new GetBackupPolicyOptions.Builder() .id("testString") .build(); - // Invoke getVpcAddressPrefix() with a valid options model and verify the result - Response response = vpcService.getVpcAddressPrefix(getVpcAddressPrefixOptionsModel).execute(); + // Invoke getBackupPolicy() with a valid options model and verify the result + Response response = vpcService.getBackupPolicy(getBackupPolicyOptionsModel).execute(); assertNotNull(response); - AddressPrefix responseObj = response.getResult(); + BackupPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -2769,60 +2949,61 @@ public void testGetVpcAddressPrefixWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcAddressPrefixPath); + assertEquals(parsedPath, getBackupPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpcAddressPrefix operation with and without retries enabled + // Test the getBackupPolicy operation with and without retries enabled @Test - public void testGetVpcAddressPrefixWRetries() throws Throwable { + public void testGetBackupPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpcAddressPrefixWOptions(); + testGetBackupPolicyWOptions(); vpcService.disableRetries(); - testGetVpcAddressPrefixWOptions(); + testGetBackupPolicyWOptions(); } - // Test the getVpcAddressPrefix operation with a null options model (negative test) + // Test the getBackupPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcAddressPrefixNoOptions() throws Throwable { + public void testGetBackupPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpcAddressPrefix(null).execute(); + vpcService.getBackupPolicy(null).execute(); } - // Test the updateVpcAddressPrefix operation with a valid options model parameter + // Test the updateBackupPolicy operation with a valid options model parameter @Test - public void testUpdateVpcAddressPrefixWOptions() throws Throwable { + public void testUpdateBackupPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"has_subnets\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"id\": \"r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"is_default\": false, \"name\": \"my-vpc-address-prefix-zone-1\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateVpcAddressPrefixPath = "/vpcs/testString/address_prefixes/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}"; + String updateBackupPolicyPath = "/backup_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the AddressPrefixPatch model - AddressPrefixPatch addressPrefixPatchModel = new AddressPrefixPatch.Builder() - .isDefault(false) - .name("my-vpc-address-prefix-updated") + // Construct an instance of the BackupPolicyPatch model + BackupPolicyPatch backupPolicyPatchModel = new BackupPolicyPatch.Builder() + .includedContent(java.util.Arrays.asList("data_volumes")) + .matchUserTags(java.util.Arrays.asList("my-tag-1", "my-tag-2", "my-tag-3")) + .name("my-backup-policy") .build(); - Map addressPrefixPatchModelAsPatch = addressPrefixPatchModel.asPatch(); + Map backupPolicyPatchModelAsPatch = backupPolicyPatchModel.asPatch(); - // Construct an instance of the UpdateVpcAddressPrefixOptions model - UpdateVpcAddressPrefixOptions updateVpcAddressPrefixOptionsModel = new UpdateVpcAddressPrefixOptions.Builder() - .vpcId("testString") + // Construct an instance of the UpdateBackupPolicyOptions model + UpdateBackupPolicyOptions updateBackupPolicyOptionsModel = new UpdateBackupPolicyOptions.Builder() .id("testString") - .addressPrefixPatch(addressPrefixPatchModelAsPatch) + .backupPolicyPatch(backupPolicyPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateVpcAddressPrefix() with a valid options model and verify the result - Response response = vpcService.updateVpcAddressPrefix(updateVpcAddressPrefixOptionsModel).execute(); + // Invoke updateBackupPolicy() with a valid options model and verify the result + Response response = vpcService.updateBackupPolicy(updateBackupPolicyOptionsModel).execute(); assertNotNull(response); - AddressPrefix responseObj = response.getResult(); + BackupPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -2831,58 +3012,52 @@ public void testUpdateVpcAddressPrefixWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpcAddressPrefixPath); + assertEquals(parsedPath, updateBackupPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVpcAddressPrefix operation with and without retries enabled + // Test the updateBackupPolicy operation with and without retries enabled @Test - public void testUpdateVpcAddressPrefixWRetries() throws Throwable { + public void testUpdateBackupPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpcAddressPrefixWOptions(); + testUpdateBackupPolicyWOptions(); vpcService.disableRetries(); - testUpdateVpcAddressPrefixWOptions(); + testUpdateBackupPolicyWOptions(); } - // Test the updateVpcAddressPrefix operation with a null options model (negative test) + // Test the updateBackupPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpcAddressPrefixNoOptions() throws Throwable { + public void testUpdateBackupPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpcAddressPrefix(null).execute(); + vpcService.updateBackupPolicy(null).execute(); } - // Test the listVpcDnsResolutionBindings operation with a valid options model parameter + // Test the listBareMetalServerProfiles operation with a valid options model parameter @Test - public void testListVpcDnsResolutionBindingsWOptions() throws Throwable { + public void testListBareMetalServerProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"dns_resolution_bindings\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listVpcDnsResolutionBindingsPath = "/vpcs/testString/dns_resolution_bindings"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"console_types\": {\"type\": \"enum\", \"values\": [\"serial\"]}, \"cpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"cpu_core_count\": {\"type\": \"fixed\", \"value\": 80}, \"cpu_socket_count\": {\"type\": \"fixed\", \"value\": 4}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"fcp\", \"type\": \"enum\", \"values\": [\"fcp\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-metal-192x768\", \"network_attachment_count\": {\"max\": 128, \"min\": 1, \"type\": \"range\"}, \"network_interface_count\": {\"max\": 128, \"min\": 1, \"type\": \"range\"}, \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"reservation_terms\": {\"type\": \"enum\", \"values\": [\"one_year\"]}, \"resource_type\": \"bare_metal_server_profile\", \"supported_trusted_platform_module_modes\": {\"default\": \"disabled\", \"type\": \"enum\", \"values\": [\"disabled\"]}, \"virtual_network_interfaces_supported\": {\"type\": \"fixed\", \"value\": false}}], \"total_count\": 132}"; + String listBareMetalServerProfilesPath = "/bare_metal_server/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpcDnsResolutionBindingsOptions model - ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptionsModel = new ListVpcDnsResolutionBindingsOptions.Builder() - .vpcId("testString") - .sort("name") + // Construct an instance of the ListBareMetalServerProfilesOptions model + ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptionsModel = new ListBareMetalServerProfilesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .name("my-name") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - // Invoke listVpcDnsResolutionBindings() with a valid options model and verify the result - Response response = vpcService.listVpcDnsResolutionBindings(listVpcDnsResolutionBindingsOptionsModel).execute(); + // Invoke listBareMetalServerProfiles() with a valid options model and verify the result + Response response = vpcService.listBareMetalServerProfiles(listBareMetalServerProfilesOptionsModel).execute(); assertNotNull(response); - VPCDNSResolutionBindingCollection responseObj = response.getResult(); + BareMetalServerProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -2891,44 +3066,32 @@ public void testListVpcDnsResolutionBindingsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpcDnsResolutionBindingsPath); + assertEquals(parsedPath, listBareMetalServerProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("sort"), "name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); - assertEquals(query.get("vpc.name"), "my-vpc"); - assertEquals(query.get("account.id"), "bb1b52262f7441a586f49068482f1e60"); } - // Test the listVpcDnsResolutionBindings operation with and without retries enabled + // Test the listBareMetalServerProfiles operation with and without retries enabled @Test - public void testListVpcDnsResolutionBindingsWRetries() throws Throwable { + public void testListBareMetalServerProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpcDnsResolutionBindingsWOptions(); + testListBareMetalServerProfilesWOptions(); vpcService.disableRetries(); - testListVpcDnsResolutionBindingsWOptions(); - } - - // Test the listVpcDnsResolutionBindings operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpcDnsResolutionBindingsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listVpcDnsResolutionBindings(null).execute(); + testListBareMetalServerProfilesWOptions(); } - // Test the listVpcDnsResolutionBindings operation using the VpcDnsResolutionBindingsPager.getNext() method + // Test the listBareMetalServerProfiles operation using the BareMetalServerProfilesPager.getNext() method @Test - public void testListVpcDnsResolutionBindingsWithPagerGetNext() throws Throwable { + public void testListBareMetalServerProfilesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"dns_resolution_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"endpoint_gateways\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"endpoint_gateway\"}],\"health_reasons\":[{\"code\":\"disconnected_from_bound_vpc\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"id\":\"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"lifecycle_state\":\"stable\",\"name\":\"my-dns-resolution-binding\",\"resource_type\":\"vpc_dns_resolution_binding\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"dns_resolution_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"endpoint_gateways\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"endpoint_gateway\"}],\"health_reasons\":[{\"code\":\"disconnected_from_bound_vpc\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"id\":\"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"lifecycle_state\":\"stable\",\"name\":\"my-dns-resolution-binding\",\"resource_type\":\"vpc_dns_resolution_binding\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"console_types\":{\"type\":\"enum\",\"values\":[\"serial\"]},\"cpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"network_attachment_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"network_interface_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"reservation_terms\":{\"type\":\"enum\",\"values\":[\"one_year\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"default\":\"disabled\",\"type\":\"enum\",\"values\":[\"disabled\"]},\"virtual_network_interfaces_supported\":{\"type\":\"fixed\",\"value\":false}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"console_types\":{\"type\":\"enum\",\"values\":[\"serial\"]},\"cpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"network_attachment_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"network_interface_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"reservation_terms\":{\"type\":\"enum\",\"values\":[\"one_year\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"default\":\"disabled\",\"type\":\"enum\",\"values\":[\"disabled\"]},\"virtual_network_interfaces_supported\":{\"type\":\"fixed\",\"value\":false}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -2942,32 +3105,26 @@ public void testListVpcDnsResolutionBindingsWithPagerGetNext() throws Throwable .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptions = new ListVpcDnsResolutionBindingsOptions.Builder() - .vpcId("testString") - .sort("name") + ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() .limit(Long.valueOf("10")) - .name("my-name") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - List allResults = new ArrayList<>(); - VpcDnsResolutionBindingsPager pager = new VpcDnsResolutionBindingsPager(vpcService, listVpcDnsResolutionBindingsOptions); + List allResults = new ArrayList<>(); + BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(vpcService, listBareMetalServerProfilesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listVpcDnsResolutionBindings operation using the VpcDnsResolutionBindingsPager.getAll() method + // Test the listBareMetalServerProfiles operation using the BareMetalServerProfilesPager.getAll() method @Test - public void testListVpcDnsResolutionBindingsWithPagerGetAll() throws Throwable { + public void testListBareMetalServerProfilesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"dns_resolution_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"endpoint_gateways\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"endpoint_gateway\"}],\"health_reasons\":[{\"code\":\"disconnected_from_bound_vpc\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"id\":\"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"lifecycle_state\":\"stable\",\"name\":\"my-dns-resolution-binding\",\"resource_type\":\"vpc_dns_resolution_binding\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"dns_resolution_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"endpoint_gateways\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"endpoint_gateway\"}],\"health_reasons\":[{\"code\":\"disconnected_from_bound_vpc\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"id\":\"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"lifecycle_state\":\"stable\",\"name\":\"my-dns-resolution-binding\",\"resource_type\":\"vpc_dns_resolution_binding\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"console_types\":{\"type\":\"enum\",\"values\":[\"serial\"]},\"cpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"network_attachment_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"network_interface_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"reservation_terms\":{\"type\":\"enum\",\"values\":[\"one_year\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"default\":\"disabled\",\"type\":\"enum\",\"values\":[\"disabled\"]},\"virtual_network_interfaces_supported\":{\"type\":\"fixed\",\"value\":false}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"console_types\":{\"type\":\"enum\",\"values\":[\"serial\"]},\"cpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"network_attachment_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"network_interface_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"reservation_terms\":{\"type\":\"enum\",\"values\":[\"one_year\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"default\":\"disabled\",\"type\":\"enum\",\"values\":[\"disabled\"]},\"virtual_network_interfaces_supported\":{\"type\":\"fixed\",\"value\":false}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -2981,49 +3138,374 @@ public void testListVpcDnsResolutionBindingsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptions = new ListVpcDnsResolutionBindingsOptions.Builder() - .vpcId("testString") - .sort("name") + ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() .limit(Long.valueOf("10")) - .name("my-name") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - VpcDnsResolutionBindingsPager pager = new VpcDnsResolutionBindingsPager(vpcService, listVpcDnsResolutionBindingsOptions); - List allResults = pager.getAll(); + BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(vpcService, listBareMetalServerProfilesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createVpcDnsResolutionBinding operation with a valid options model parameter + // Test the getBareMetalServerProfile operation with a valid options model parameter @Test - public void testCreateVpcDnsResolutionBindingWOptions() throws Throwable { + public void testGetBareMetalServerProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}"; - String createVpcDnsResolutionBindingPath = "/vpcs/testString/dns_resolution_bindings"; + String mockResponseBody = "{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"console_types\": {\"type\": \"enum\", \"values\": [\"serial\"]}, \"cpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"cpu_core_count\": {\"type\": \"fixed\", \"value\": 80}, \"cpu_socket_count\": {\"type\": \"fixed\", \"value\": 4}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"fcp\", \"type\": \"enum\", \"values\": [\"fcp\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-metal-192x768\", \"network_attachment_count\": {\"max\": 128, \"min\": 1, \"type\": \"range\"}, \"network_interface_count\": {\"max\": 128, \"min\": 1, \"type\": \"range\"}, \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"reservation_terms\": {\"type\": \"enum\", \"values\": [\"one_year\"]}, \"resource_type\": \"bare_metal_server_profile\", \"supported_trusted_platform_module_modes\": {\"default\": \"disabled\", \"type\": \"enum\", \"values\": [\"disabled\"]}, \"virtual_network_interfaces_supported\": {\"type\": \"fixed\", \"value\": false}}"; + String getBareMetalServerProfilePath = "/bare_metal_server/profiles/bx2-metal-192x768"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); + // Construct an instance of the GetBareMetalServerProfileOptions model + GetBareMetalServerProfileOptions getBareMetalServerProfileOptionsModel = new GetBareMetalServerProfileOptions.Builder() + .name("bx2-metal-192x768") + .build(); + + // Invoke getBareMetalServerProfile() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerProfile(getBareMetalServerProfileOptionsModel).execute(); + assertNotNull(response); + BareMetalServerProfile responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getBareMetalServerProfilePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the getBareMetalServerProfile operation with and without retries enabled + @Test + public void testGetBareMetalServerProfileWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetBareMetalServerProfileWOptions(); + + vpcService.disableRetries(); + testGetBareMetalServerProfileWOptions(); + } + + // Test the getBareMetalServerProfile operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetBareMetalServerProfileNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getBareMetalServerProfile(null).execute(); + } + + // Test the listBareMetalServers operation with a valid options model parameter + @Test + public void testListBareMetalServersWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"bare_metal_servers\": [{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"disks\": [{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"firmware\": {\"update\": \"none\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"id\": \"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 1536, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\"}, \"name\": \"my-bare-metal-server\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"disabled\", \"supported_modes\": [\"disabled\"]}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listBareMetalServersPath = "/bare_metal_servers"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListBareMetalServersOptions model + ListBareMetalServersOptions listBareMetalServersOptionsModel = new ListBareMetalServersOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .reservationId("testString") + .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .reservationName("my-reservation") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .build(); + + // Invoke listBareMetalServers() with a valid options model and verify the result + Response response = vpcService.listBareMetalServers(listBareMetalServersOptionsModel).execute(); + assertNotNull(response); + BareMetalServerCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listBareMetalServersPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("reservation.id"), "testString"); + assertEquals(query.get("reservation.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"); + assertEquals(query.get("reservation.name"), "my-reservation"); + assertEquals(query.get("vpc.id"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); + } + + // Test the listBareMetalServers operation with and without retries enabled + @Test + public void testListBareMetalServersWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListBareMetalServersWOptions(); + + vpcService.disableRetries(); + testListBareMetalServersWOptions(); + } + + // Test the listBareMetalServers operation using the BareMetalServersPager.getNext() method + @Test + public void testListBareMetalServersWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"disks\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"firmware\":{\"update\":\"none\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"id\":\"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":1536,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\"},\"name\":\"my-bare-metal-server\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"disabled\",\"supported_modes\":[\"disabled\"]},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"disks\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"firmware\":{\"update\":\"none\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"id\":\"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":1536,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\"},\"name\":\"my-bare-metal-server\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"disabled\",\"supported_modes\":[\"disabled\"]},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .reservationId("testString") + .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .reservationName("my-reservation") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .build(); + + List allResults = new ArrayList<>(); + BareMetalServersPager pager = new BareMetalServersPager(vpcService, listBareMetalServersOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listBareMetalServers operation using the BareMetalServersPager.getAll() method + @Test + public void testListBareMetalServersWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"disks\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"firmware\":{\"update\":\"none\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"id\":\"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":1536,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\"},\"name\":\"my-bare-metal-server\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"disabled\",\"supported_modes\":[\"disabled\"]},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"disks\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"firmware\":{\"update\":\"none\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"id\":\"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":1536,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\"},\"name\":\"my-bare-metal-server\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"disabled\",\"supported_modes\":[\"disabled\"]},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .reservationId("testString") + .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .reservationName("my-reservation") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .build(); + + BareMetalServersPager pager = new BareMetalServersPager(vpcService, listBareMetalServersOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createBareMetalServer operation with a valid options model parameter + @Test + public void testCreateBareMetalServerWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"disks\": [{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"firmware\": {\"update\": \"none\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"id\": \"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 1536, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\"}, \"name\": \"my-bare-metal-server\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"disabled\", \"supported_modes\": [\"disabled\"]}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createBareMetalServerPath = "/bare_metal_servers"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the TrustedProfileIdentityById model + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + + // Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + + // Construct an instance of the ImageIdentityById model + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() + .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .build(); + + // Construct an instance of the KeyIdentityById model + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") + .build(); + + // Construct an instance of the BareMetalServerInitializationPrototype model + BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) + .image(imageIdentityModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .userData("testString") + .build(); + + // Construct an instance of the BareMetalServerMetadataServicePrototype model + BareMetalServerMetadataServicePrototype bareMetalServerMetadataServicePrototypeModel = new BareMetalServerMetadataServicePrototype.Builder() + .enabled(true) + .protocol("https") + .build(); + + // Construct an instance of the BareMetalServerProfileIdentityByName model + BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() + .name("bx2-metal-192x768") + .build(); + + // Construct an instance of the ReservationIdentityById model + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .build(); + + // Construct an instance of the BareMetalServerReservationAffinityPrototype model + BareMetalServerReservationAffinityPrototype bareMetalServerReservationAffinityPrototypeModel = new BareMetalServerReservationAffinityPrototype.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the BareMetalServerTrustedPlatformModulePrototype model + BareMetalServerTrustedPlatformModulePrototype bareMetalServerTrustedPlatformModulePrototypeModel = new BareMetalServerTrustedPlatformModulePrototype.Builder() + .mode("disabled") + .build(); + // Construct an instance of the VPCIdentityById model VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - // Construct an instance of the CreateVpcDnsResolutionBindingOptions model - CreateVpcDnsResolutionBindingOptions createVpcDnsResolutionBindingOptionsModel = new CreateVpcDnsResolutionBindingOptions.Builder() - .vpcId("testString") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + // Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model + BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + // Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model + BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype bareMetalServerNetworkAttachmentPrototypeModel = new BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.Builder() + .name("my-bare-metal-server-network-attachment") + .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .interfaceType("pci") + .build(); + + // Construct an instance of the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype model + BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype bareMetalServerPrimaryNetworkAttachmentPrototypeModel = new BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype.Builder() + .name("my-bare-metal-server-network-attachment") + .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .interfaceType("pci") + .build(); + + // Construct an instance of the BareMetalServerPrototypeBareMetalServerByNetworkAttachment model + BareMetalServerPrototypeBareMetalServerByNetworkAttachment bareMetalServerPrototypeModel = new BareMetalServerPrototypeBareMetalServerByNetworkAttachment.Builder() + .bandwidth(Long.valueOf("20000")) + .enableSecureBoot(false) + .initialization(bareMetalServerInitializationPrototypeModel) + .metadataService(bareMetalServerMetadataServicePrototypeModel) + .name("my-bare-metal-server") + .profile(bareMetalServerProfileIdentityModel) + .reservationAffinity(bareMetalServerReservationAffinityPrototypeModel) + .resourceGroup(resourceGroupIdentityModel) + .trustedPlatformModule(bareMetalServerTrustedPlatformModulePrototypeModel) .vpc(vpcIdentityModel) - .name("my-dns-resolution-binding") + .zone(zoneIdentityModel) + .networkAttachments(java.util.Arrays.asList(bareMetalServerNetworkAttachmentPrototypeModel)) + .primaryNetworkAttachment(bareMetalServerPrimaryNetworkAttachmentPrototypeModel) .build(); - // Invoke createVpcDnsResolutionBinding() with a valid options model and verify the result - Response response = vpcService.createVpcDnsResolutionBinding(createVpcDnsResolutionBindingOptionsModel).execute(); + // Construct an instance of the CreateBareMetalServerOptions model + CreateBareMetalServerOptions createBareMetalServerOptionsModel = new CreateBareMetalServerOptions.Builder() + .bareMetalServerPrototype(bareMetalServerPrototypeModel) + .build(); + + // Invoke createBareMetalServer() with a valid options model and verify the result + Response response = vpcService.createBareMetalServer(createBareMetalServerOptionsModel).execute(); assertNotNull(response); - VPCDNSResolutionBinding responseObj = response.getResult(); + BareMetalServer responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -3032,106 +3514,160 @@ public void testCreateVpcDnsResolutionBindingWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpcDnsResolutionBindingPath); + assertEquals(parsedPath, createBareMetalServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpcDnsResolutionBinding operation with and without retries enabled + // Test the createBareMetalServer operation with and without retries enabled @Test - public void testCreateVpcDnsResolutionBindingWRetries() throws Throwable { + public void testCreateBareMetalServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpcDnsResolutionBindingWOptions(); + testCreateBareMetalServerWOptions(); vpcService.disableRetries(); - testCreateVpcDnsResolutionBindingWOptions(); + testCreateBareMetalServerWOptions(); } - // Test the createVpcDnsResolutionBinding operation with a null options model (negative test) + // Test the createBareMetalServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpcDnsResolutionBindingNoOptions() throws Throwable { + public void testCreateBareMetalServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpcDnsResolutionBinding(null).execute(); + vpcService.createBareMetalServer(null).execute(); } - // Test the deleteVpcDnsResolutionBinding operation with a valid options model parameter + // Test the createBareMetalServerConsoleAccessToken operation with a valid options model parameter @Test - public void testDeleteVpcDnsResolutionBindingWOptions() throws Throwable { + public void testCreateBareMetalServerConsoleAccessTokenWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}"; - String deleteVpcDnsResolutionBindingPath = "/vpcs/testString/dns_resolution_bindings/testString"; + String mockResponseBody = "{\"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI\", \"console_type\": \"serial\", \"created_at\": \"2020-07-27T21:50:14.000Z\", \"expires_at\": \"2020-07-27T21:51:14.000Z\", \"force\": false, \"href\": \"wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI\"}"; + String createBareMetalServerConsoleAccessTokenPath = "/bare_metal_servers/testString/console_access_token"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpcDnsResolutionBindingOptions model - DeleteVpcDnsResolutionBindingOptions deleteVpcDnsResolutionBindingOptionsModel = new DeleteVpcDnsResolutionBindingOptions.Builder() - .vpcId("testString") - .id("testString") + // Construct an instance of the CreateBareMetalServerConsoleAccessTokenOptions model + CreateBareMetalServerConsoleAccessTokenOptions createBareMetalServerConsoleAccessTokenOptionsModel = new CreateBareMetalServerConsoleAccessTokenOptions.Builder() + .bareMetalServerId("testString") + .consoleType("serial") + .force(false) .build(); - // Invoke deleteVpcDnsResolutionBinding() with a valid options model and verify the result - Response response = vpcService.deleteVpcDnsResolutionBinding(deleteVpcDnsResolutionBindingOptionsModel).execute(); + // Invoke createBareMetalServerConsoleAccessToken() with a valid options model and verify the result + Response response = vpcService.createBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModel).execute(); assertNotNull(response); - VPCDNSResolutionBinding responseObj = response.getResult(); + BareMetalServerConsoleAccessToken responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpcDnsResolutionBindingPath); + assertEquals(parsedPath, createBareMetalServerConsoleAccessTokenPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpcDnsResolutionBinding operation with and without retries enabled + // Test the createBareMetalServerConsoleAccessToken operation with and without retries enabled @Test - public void testDeleteVpcDnsResolutionBindingWRetries() throws Throwable { + public void testCreateBareMetalServerConsoleAccessTokenWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpcDnsResolutionBindingWOptions(); + testCreateBareMetalServerConsoleAccessTokenWOptions(); vpcService.disableRetries(); - testDeleteVpcDnsResolutionBindingWOptions(); + testCreateBareMetalServerConsoleAccessTokenWOptions(); } - // Test the deleteVpcDnsResolutionBinding operation with a null options model (negative test) + // Test the createBareMetalServerConsoleAccessToken operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpcDnsResolutionBindingNoOptions() throws Throwable { + public void testCreateBareMetalServerConsoleAccessTokenNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpcDnsResolutionBinding(null).execute(); + vpcService.createBareMetalServerConsoleAccessToken(null).execute(); } - // Test the getVpcDnsResolutionBinding operation with a valid options model parameter + // Test the listBareMetalServerDisks operation with a valid options model parameter @Test - public void testGetVpcDnsResolutionBindingWOptions() throws Throwable { + public void testListBareMetalServerDisksWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}"; - String getVpcDnsResolutionBindingPath = "/vpcs/testString/dns_resolution_bindings/testString"; + String mockResponseBody = "{\"disks\": [{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}]}"; + String listBareMetalServerDisksPath = "/bare_metal_servers/testString/disks"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcDnsResolutionBindingOptions model - GetVpcDnsResolutionBindingOptions getVpcDnsResolutionBindingOptionsModel = new GetVpcDnsResolutionBindingOptions.Builder() - .vpcId("testString") + // Construct an instance of the ListBareMetalServerDisksOptions model + ListBareMetalServerDisksOptions listBareMetalServerDisksOptionsModel = new ListBareMetalServerDisksOptions.Builder() + .bareMetalServerId("testString") + .build(); + + // Invoke listBareMetalServerDisks() with a valid options model and verify the result + Response response = vpcService.listBareMetalServerDisks(listBareMetalServerDisksOptionsModel).execute(); + assertNotNull(response); + BareMetalServerDiskCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listBareMetalServerDisksPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the listBareMetalServerDisks operation with and without retries enabled + @Test + public void testListBareMetalServerDisksWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListBareMetalServerDisksWOptions(); + + vpcService.disableRetries(); + testListBareMetalServerDisksWOptions(); + } + + // Test the listBareMetalServerDisks operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListBareMetalServerDisksNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listBareMetalServerDisks(null).execute(); + } + + // Test the getBareMetalServerDisk operation with a valid options model parameter + @Test + public void testGetBareMetalServerDiskWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}"; + String getBareMetalServerDiskPath = "/bare_metal_servers/testString/disks/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetBareMetalServerDiskOptions model + GetBareMetalServerDiskOptions getBareMetalServerDiskOptionsModel = new GetBareMetalServerDiskOptions.Builder() + .bareMetalServerId("testString") .id("testString") .build(); - // Invoke getVpcDnsResolutionBinding() with a valid options model and verify the result - Response response = vpcService.getVpcDnsResolutionBinding(getVpcDnsResolutionBindingOptionsModel).execute(); + // Invoke getBareMetalServerDisk() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerDisk(getBareMetalServerDiskOptionsModel).execute(); assertNotNull(response); - VPCDNSResolutionBinding responseObj = response.getResult(); + BareMetalServerDisk responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -3140,59 +3676,59 @@ public void testGetVpcDnsResolutionBindingWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcDnsResolutionBindingPath); + assertEquals(parsedPath, getBareMetalServerDiskPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpcDnsResolutionBinding operation with and without retries enabled + // Test the getBareMetalServerDisk operation with and without retries enabled @Test - public void testGetVpcDnsResolutionBindingWRetries() throws Throwable { + public void testGetBareMetalServerDiskWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpcDnsResolutionBindingWOptions(); + testGetBareMetalServerDiskWOptions(); vpcService.disableRetries(); - testGetVpcDnsResolutionBindingWOptions(); + testGetBareMetalServerDiskWOptions(); } - // Test the getVpcDnsResolutionBinding operation with a null options model (negative test) + // Test the getBareMetalServerDisk operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcDnsResolutionBindingNoOptions() throws Throwable { + public void testGetBareMetalServerDiskNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpcDnsResolutionBinding(null).execute(); + vpcService.getBareMetalServerDisk(null).execute(); } - // Test the updateVpcDnsResolutionBinding operation with a valid options model parameter + // Test the updateBareMetalServerDisk operation with a valid options model parameter @Test - public void testUpdateVpcDnsResolutionBindingWOptions() throws Throwable { + public void testUpdateBareMetalServerDiskWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}"; - String updateVpcDnsResolutionBindingPath = "/vpcs/testString/dns_resolution_bindings/testString"; + String mockResponseBody = "{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}"; + String updateBareMetalServerDiskPath = "/bare_metal_servers/testString/disks/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VPCDNSResolutionBindingPatch model - VPCDNSResolutionBindingPatch vpcdnsResolutionBindingPatchModel = new VPCDNSResolutionBindingPatch.Builder() - .name("my-dns-resolution-binding-updated") + // Construct an instance of the BareMetalServerDiskPatch model + BareMetalServerDiskPatch bareMetalServerDiskPatchModel = new BareMetalServerDiskPatch.Builder() + .name("my-bare-metal-server-disk-updated") .build(); - Map vpcdnsResolutionBindingPatchModelAsPatch = vpcdnsResolutionBindingPatchModel.asPatch(); + Map bareMetalServerDiskPatchModelAsPatch = bareMetalServerDiskPatchModel.asPatch(); - // Construct an instance of the UpdateVpcDnsResolutionBindingOptions model - UpdateVpcDnsResolutionBindingOptions updateVpcDnsResolutionBindingOptionsModel = new UpdateVpcDnsResolutionBindingOptions.Builder() - .vpcId("testString") + // Construct an instance of the UpdateBareMetalServerDiskOptions model + UpdateBareMetalServerDiskOptions updateBareMetalServerDiskOptionsModel = new UpdateBareMetalServerDiskOptions.Builder() + .bareMetalServerId("testString") .id("testString") - .vpcdnsResolutionBindingPatch(vpcdnsResolutionBindingPatchModelAsPatch) + .bareMetalServerDiskPatch(bareMetalServerDiskPatchModelAsPatch) .build(); - // Invoke updateVpcDnsResolutionBinding() with a valid options model and verify the result - Response response = vpcService.updateVpcDnsResolutionBinding(updateVpcDnsResolutionBindingOptionsModel).execute(); + // Invoke updateBareMetalServerDisk() with a valid options model and verify the result + Response response = vpcService.updateBareMetalServerDisk(updateBareMetalServerDiskOptionsModel).execute(); assertNotNull(response); - VPCDNSResolutionBinding responseObj = response.getResult(); + BareMetalServerDisk responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -3201,54 +3737,930 @@ public void testUpdateVpcDnsResolutionBindingWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpcDnsResolutionBindingPath); + assertEquals(parsedPath, updateBareMetalServerDiskPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVpcDnsResolutionBinding operation with and without retries enabled + // Test the updateBareMetalServerDisk operation with and without retries enabled @Test - public void testUpdateVpcDnsResolutionBindingWRetries() throws Throwable { + public void testUpdateBareMetalServerDiskWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testUpdateBareMetalServerDiskWOptions(); + + vpcService.disableRetries(); + testUpdateBareMetalServerDiskWOptions(); + } + + // Test the updateBareMetalServerDisk operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateBareMetalServerDiskNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateBareMetalServerDisk(null).execute(); + } + + // Test the listBareMetalServerNetworkAttachments operation with a valid options model parameter + @Test + public void testListBareMetalServerNetworkAttachmentsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"network_attachments\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"lifecycle_state\": \"stable\", \"name\": \"my-bare-metal-server-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"allowed_vlans\": [4], \"interface_type\": \"pci\"}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listBareMetalServerNetworkAttachmentsPath = "/bare_metal_servers/testString/network_attachments"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListBareMetalServerNetworkAttachmentsOptions model + ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptionsModel = new ListBareMetalServerNetworkAttachmentsOptions.Builder() + .bareMetalServerId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); + + // Invoke listBareMetalServerNetworkAttachments() with a valid options model and verify the result + Response response = vpcService.listBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModel).execute(); + assertNotNull(response); + BareMetalServerNetworkAttachmentCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listBareMetalServerNetworkAttachmentsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + } + + // Test the listBareMetalServerNetworkAttachments operation with and without retries enabled + @Test + public void testListBareMetalServerNetworkAttachmentsWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListBareMetalServerNetworkAttachmentsWOptions(); + + vpcService.disableRetries(); + testListBareMetalServerNetworkAttachmentsWOptions(); + } + + // Test the listBareMetalServerNetworkAttachments operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListBareMetalServerNetworkAttachmentsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listBareMetalServerNetworkAttachments(null).execute(); + } + + // Test the listBareMetalServerNetworkAttachments operation using the BareMetalServerNetworkAttachmentsPager.getNext() method + @Test + public void testListBareMetalServerNetworkAttachmentsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_attachments\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"lifecycle_state\":\"stable\",\"name\":\"my-bare-metal-server-network-attachment\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"allowed_vlans\":[4],\"interface_type\":\"pci\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_attachments\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"lifecycle_state\":\"stable\",\"name\":\"my-bare-metal-server-network-attachment\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"allowed_vlans\":[4],\"interface_type\":\"pci\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptions = new ListBareMetalServerNetworkAttachmentsOptions.Builder() + .bareMetalServerId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + BareMetalServerNetworkAttachmentsPager pager = new BareMetalServerNetworkAttachmentsPager(vpcService, listBareMetalServerNetworkAttachmentsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listBareMetalServerNetworkAttachments operation using the BareMetalServerNetworkAttachmentsPager.getAll() method + @Test + public void testListBareMetalServerNetworkAttachmentsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_attachments\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"lifecycle_state\":\"stable\",\"name\":\"my-bare-metal-server-network-attachment\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"allowed_vlans\":[4],\"interface_type\":\"pci\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_attachments\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"lifecycle_state\":\"stable\",\"name\":\"my-bare-metal-server-network-attachment\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"allowed_vlans\":[4],\"interface_type\":\"pci\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptions = new ListBareMetalServerNetworkAttachmentsOptions.Builder() + .bareMetalServerId("testString") + .limit(Long.valueOf("10")) + .build(); + + BareMetalServerNetworkAttachmentsPager pager = new BareMetalServerNetworkAttachmentsPager(vpcService, listBareMetalServerNetworkAttachmentsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createBareMetalServerNetworkAttachment operation with a valid options model parameter + @Test + public void testCreateBareMetalServerNetworkAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"lifecycle_state\": \"stable\", \"name\": \"my-bare-metal-server-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; + String createBareMetalServerNetworkAttachmentPath = "/bare_metal_servers/testString/network_attachments"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + // Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model + BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + // Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model + BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype bareMetalServerNetworkAttachmentPrototypeModel = new BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.Builder() + .name("my-bare-metal-server-network-attachment") + .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .interfaceType("pci") + .build(); + + // Construct an instance of the CreateBareMetalServerNetworkAttachmentOptions model + CreateBareMetalServerNetworkAttachmentOptions createBareMetalServerNetworkAttachmentOptionsModel = new CreateBareMetalServerNetworkAttachmentOptions.Builder() + .bareMetalServerId("testString") + .bareMetalServerNetworkAttachmentPrototype(bareMetalServerNetworkAttachmentPrototypeModel) + .build(); + + // Invoke createBareMetalServerNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.createBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModel).execute(); + assertNotNull(response); + BareMetalServerNetworkAttachment responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createBareMetalServerNetworkAttachmentPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createBareMetalServerNetworkAttachment operation with and without retries enabled + @Test + public void testCreateBareMetalServerNetworkAttachmentWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateBareMetalServerNetworkAttachmentWOptions(); + + vpcService.disableRetries(); + testCreateBareMetalServerNetworkAttachmentWOptions(); + } + + // Test the createBareMetalServerNetworkAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateBareMetalServerNetworkAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createBareMetalServerNetworkAttachment(null).execute(); + } + + // Test the deleteBareMetalServerNetworkAttachment operation with a valid options model parameter + @Test + public void testDeleteBareMetalServerNetworkAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteBareMetalServerNetworkAttachmentPath = "/bare_metal_servers/testString/network_attachments/testString"; + server.enqueue(new MockResponse() + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteBareMetalServerNetworkAttachmentOptions model + DeleteBareMetalServerNetworkAttachmentOptions deleteBareMetalServerNetworkAttachmentOptionsModel = new DeleteBareMetalServerNetworkAttachmentOptions.Builder() + .bareMetalServerId("testString") + .id("testString") + .build(); + + // Invoke deleteBareMetalServerNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.deleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptionsModel).execute(); + assertNotNull(response); + Void responseObj = response.getResult(); + assertNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteBareMetalServerNetworkAttachmentPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the deleteBareMetalServerNetworkAttachment operation with and without retries enabled + @Test + public void testDeleteBareMetalServerNetworkAttachmentWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testDeleteBareMetalServerNetworkAttachmentWOptions(); + + vpcService.disableRetries(); + testDeleteBareMetalServerNetworkAttachmentWOptions(); + } + + // Test the deleteBareMetalServerNetworkAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteBareMetalServerNetworkAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.deleteBareMetalServerNetworkAttachment(null).execute(); + } + + // Test the getBareMetalServerNetworkAttachment operation with a valid options model parameter + @Test + public void testGetBareMetalServerNetworkAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"lifecycle_state\": \"stable\", \"name\": \"my-bare-metal-server-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; + String getBareMetalServerNetworkAttachmentPath = "/bare_metal_servers/testString/network_attachments/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetBareMetalServerNetworkAttachmentOptions model + GetBareMetalServerNetworkAttachmentOptions getBareMetalServerNetworkAttachmentOptionsModel = new GetBareMetalServerNetworkAttachmentOptions.Builder() + .bareMetalServerId("testString") + .id("testString") + .build(); + + // Invoke getBareMetalServerNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModel).execute(); + assertNotNull(response); + BareMetalServerNetworkAttachment responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getBareMetalServerNetworkAttachmentPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the getBareMetalServerNetworkAttachment operation with and without retries enabled + @Test + public void testGetBareMetalServerNetworkAttachmentWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetBareMetalServerNetworkAttachmentWOptions(); + + vpcService.disableRetries(); + testGetBareMetalServerNetworkAttachmentWOptions(); + } + + // Test the getBareMetalServerNetworkAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetBareMetalServerNetworkAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getBareMetalServerNetworkAttachment(null).execute(); + } + + // Test the updateBareMetalServerNetworkAttachment operation with a valid options model parameter + @Test + public void testUpdateBareMetalServerNetworkAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"lifecycle_state\": \"stable\", \"name\": \"my-bare-metal-server-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; + String updateBareMetalServerNetworkAttachmentPath = "/bare_metal_servers/testString/network_attachments/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the BareMetalServerNetworkAttachmentPatch model + BareMetalServerNetworkAttachmentPatch bareMetalServerNetworkAttachmentPatchModel = new BareMetalServerNetworkAttachmentPatch.Builder() + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .name("my-bare-metal-server-network-attachment-updated") + .build(); + Map bareMetalServerNetworkAttachmentPatchModelAsPatch = bareMetalServerNetworkAttachmentPatchModel.asPatch(); + + // Construct an instance of the UpdateBareMetalServerNetworkAttachmentOptions model + UpdateBareMetalServerNetworkAttachmentOptions updateBareMetalServerNetworkAttachmentOptionsModel = new UpdateBareMetalServerNetworkAttachmentOptions.Builder() + .bareMetalServerId("testString") + .id("testString") + .bareMetalServerNetworkAttachmentPatch(bareMetalServerNetworkAttachmentPatchModelAsPatch) + .build(); + + // Invoke updateBareMetalServerNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.updateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModel).execute(); + assertNotNull(response); + BareMetalServerNetworkAttachment responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateBareMetalServerNetworkAttachmentPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the updateBareMetalServerNetworkAttachment operation with and without retries enabled + @Test + public void testUpdateBareMetalServerNetworkAttachmentWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testUpdateBareMetalServerNetworkAttachmentWOptions(); + + vpcService.disableRetries(); + testUpdateBareMetalServerNetworkAttachmentWOptions(); + } + + // Test the updateBareMetalServerNetworkAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateBareMetalServerNetworkAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateBareMetalServerNetworkAttachment(null).execute(); + } + + // Test the listBareMetalServerNetworkInterfaces operation with a valid options model parameter + @Test + public void testListBareMetalServerNetworkInterfacesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"mac_address\": \"02:00:04:00:C4:6A\", \"name\": \"my-bare-metal-server-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listBareMetalServerNetworkInterfacesPath = "/bare_metal_servers/testString/network_interfaces"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListBareMetalServerNetworkInterfacesOptions model + ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptionsModel = new ListBareMetalServerNetworkInterfacesOptions.Builder() + .bareMetalServerId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .build(); + + // Invoke listBareMetalServerNetworkInterfaces() with a valid options model and verify the result + Response response = vpcService.listBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModel).execute(); + assertNotNull(response); + BareMetalServerNetworkInterfaceCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listBareMetalServerNetworkInterfacesPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + } + + // Test the listBareMetalServerNetworkInterfaces operation with and without retries enabled + @Test + public void testListBareMetalServerNetworkInterfacesWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListBareMetalServerNetworkInterfacesWOptions(); + + vpcService.disableRetries(); + testListBareMetalServerNetworkInterfacesWOptions(); + } + + // Test the listBareMetalServerNetworkInterfaces operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListBareMetalServerNetworkInterfacesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listBareMetalServerNetworkInterfaces(null).execute(); + } + + // Test the listBareMetalServerNetworkInterfaces operation using the BareMetalServerNetworkInterfacesPager.getNext() method + @Test + public void testListBareMetalServerNetworkInterfacesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"mac_address\":\"02:00:04:00:C4:6A\",\"name\":\"my-bare-metal-server-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"mac_address\":\"02:00:04:00:C4:6A\",\"name\":\"my-bare-metal-server-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() + .bareMetalServerId("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(vpcService, listBareMetalServerNetworkInterfacesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listBareMetalServerNetworkInterfaces operation using the BareMetalServerNetworkInterfacesPager.getAll() method + @Test + public void testListBareMetalServerNetworkInterfacesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"mac_address\":\"02:00:04:00:C4:6A\",\"name\":\"my-bare-metal-server-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"mac_address\":\"02:00:04:00:C4:6A\",\"name\":\"my-bare-metal-server-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() + .bareMetalServerId("testString") + .limit(Long.valueOf("10")) + .build(); + + BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(vpcService, listBareMetalServerNetworkInterfacesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createBareMetalServerNetworkInterface operation with a valid options model parameter + @Test + public void testCreateBareMetalServerNetworkInterfaceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"mac_address\": \"02:00:04:00:C4:6A\", \"name\": \"my-bare-metal-server-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; + String createBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + // Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model + BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() + .allowIpSpoofing(true) + .enableInfrastructureNat(true) + .name("my-bare-metal-server-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .interfaceType("hipersocket") + .build(); + + // Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model + CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptionsModel = new CreateBareMetalServerNetworkInterfaceOptions.Builder() + .bareMetalServerId("testString") + .bareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototypeModel) + .build(); + + // Invoke createBareMetalServerNetworkInterface() with a valid options model and verify the result + Response response = vpcService.createBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModel).execute(); + assertNotNull(response); + BareMetalServerNetworkInterface responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createBareMetalServerNetworkInterfacePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createBareMetalServerNetworkInterface operation with and without retries enabled + @Test + public void testCreateBareMetalServerNetworkInterfaceWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateBareMetalServerNetworkInterfaceWOptions(); + + vpcService.disableRetries(); + testCreateBareMetalServerNetworkInterfaceWOptions(); + } + + // Test the createBareMetalServerNetworkInterface operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateBareMetalServerNetworkInterfaceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createBareMetalServerNetworkInterface(null).execute(); + } + + // Test the deleteBareMetalServerNetworkInterface operation with a valid options model parameter + @Test + public void testDeleteBareMetalServerNetworkInterfaceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces/testString"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteBareMetalServerNetworkInterfaceOptions model + DeleteBareMetalServerNetworkInterfaceOptions deleteBareMetalServerNetworkInterfaceOptionsModel = new DeleteBareMetalServerNetworkInterfaceOptions.Builder() + .bareMetalServerId("testString") + .id("testString") + .build(); + + // Invoke deleteBareMetalServerNetworkInterface() with a valid options model and verify the result + Response response = vpcService.deleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptionsModel).execute(); + assertNotNull(response); + Void responseObj = response.getResult(); + assertNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteBareMetalServerNetworkInterfacePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the deleteBareMetalServerNetworkInterface operation with and without retries enabled + @Test + public void testDeleteBareMetalServerNetworkInterfaceWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testDeleteBareMetalServerNetworkInterfaceWOptions(); + + vpcService.disableRetries(); + testDeleteBareMetalServerNetworkInterfaceWOptions(); + } + + // Test the deleteBareMetalServerNetworkInterface operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteBareMetalServerNetworkInterfaceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.deleteBareMetalServerNetworkInterface(null).execute(); + } + + // Test the getBareMetalServerNetworkInterface operation with a valid options model parameter + @Test + public void testGetBareMetalServerNetworkInterfaceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"mac_address\": \"02:00:04:00:C4:6A\", \"name\": \"my-bare-metal-server-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; + String getBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetBareMetalServerNetworkInterfaceOptions model + GetBareMetalServerNetworkInterfaceOptions getBareMetalServerNetworkInterfaceOptionsModel = new GetBareMetalServerNetworkInterfaceOptions.Builder() + .bareMetalServerId("testString") + .id("testString") + .build(); + + // Invoke getBareMetalServerNetworkInterface() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModel).execute(); + assertNotNull(response); + BareMetalServerNetworkInterface responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getBareMetalServerNetworkInterfacePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the getBareMetalServerNetworkInterface operation with and without retries enabled + @Test + public void testGetBareMetalServerNetworkInterfaceWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetBareMetalServerNetworkInterfaceWOptions(); + + vpcService.disableRetries(); + testGetBareMetalServerNetworkInterfaceWOptions(); + } + + // Test the getBareMetalServerNetworkInterface operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetBareMetalServerNetworkInterfaceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getBareMetalServerNetworkInterface(null).execute(); + } + + // Test the updateBareMetalServerNetworkInterface operation with a valid options model parameter + @Test + public void testUpdateBareMetalServerNetworkInterfaceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"mac_address\": \"02:00:04:00:C4:6A\", \"name\": \"my-bare-metal-server-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; + String updateBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the BareMetalServerNetworkInterfacePatch model + BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatchModel = new BareMetalServerNetworkInterfacePatch.Builder() + .allowIpSpoofing(true) + .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) + .enableInfrastructureNat(true) + .name("my-bare-metal-server-network-interface") + .build(); + Map bareMetalServerNetworkInterfacePatchModelAsPatch = bareMetalServerNetworkInterfacePatchModel.asPatch(); + + // Construct an instance of the UpdateBareMetalServerNetworkInterfaceOptions model + UpdateBareMetalServerNetworkInterfaceOptions updateBareMetalServerNetworkInterfaceOptionsModel = new UpdateBareMetalServerNetworkInterfaceOptions.Builder() + .bareMetalServerId("testString") + .id("testString") + .bareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatchModelAsPatch) + .build(); + + // Invoke updateBareMetalServerNetworkInterface() with a valid options model and verify the result + Response response = vpcService.updateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModel).execute(); + assertNotNull(response); + BareMetalServerNetworkInterface responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateBareMetalServerNetworkInterfacePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the updateBareMetalServerNetworkInterface operation with and without retries enabled + @Test + public void testUpdateBareMetalServerNetworkInterfaceWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testUpdateBareMetalServerNetworkInterfaceWOptions(); + + vpcService.disableRetries(); + testUpdateBareMetalServerNetworkInterfaceWOptions(); + } + + // Test the updateBareMetalServerNetworkInterface operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateBareMetalServerNetworkInterfaceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateBareMetalServerNetworkInterface(null).execute(); + } + + // Test the listBareMetalServerNetworkInterfaceFloatingIps operation with a valid options model parameter + @Test + public void testListBareMetalServerNetworkInterfaceFloatingIpsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"floating_ips\": [{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; + String listBareMetalServerNetworkInterfaceFloatingIpsPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model + ListBareMetalServerNetworkInterfaceFloatingIpsOptions listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel = new ListBareMetalServerNetworkInterfaceFloatingIpsOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .build(); + + // Invoke listBareMetalServerNetworkInterfaceFloatingIps() with a valid options model and verify the result + Response response = vpcService.listBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel).execute(); + assertNotNull(response); + FloatingIPUnpaginatedCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listBareMetalServerNetworkInterfaceFloatingIpsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the listBareMetalServerNetworkInterfaceFloatingIps operation with and without retries enabled + @Test + public void testListBareMetalServerNetworkInterfaceFloatingIpsWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListBareMetalServerNetworkInterfaceFloatingIpsWOptions(); + + vpcService.disableRetries(); + testListBareMetalServerNetworkInterfaceFloatingIpsWOptions(); + } + + // Test the listBareMetalServerNetworkInterfaceFloatingIps operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListBareMetalServerNetworkInterfaceFloatingIpsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listBareMetalServerNetworkInterfaceFloatingIps(null).execute(); + } + + // Test the removeBareMetalServerNetworkInterfaceFloatingIp operation with a valid options model parameter + @Test + public void testRemoveBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String removeBareMetalServerNetworkInterfaceFloatingIpPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); + + // Construct an instance of the RemoveBareMetalServerNetworkInterfaceFloatingIpOptions model + RemoveBareMetalServerNetworkInterfaceFloatingIpOptions removeBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") + .build(); + + // Invoke removeBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.removeBareMetalServerNetworkInterfaceFloatingIp(removeBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); + assertNotNull(response); + Void responseObj = response.getResult(); + assertNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, removeBareMetalServerNetworkInterfaceFloatingIpPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the removeBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled + @Test + public void testRemoveBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpcDnsResolutionBindingWOptions(); + testRemoveBareMetalServerNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testUpdateVpcDnsResolutionBindingWOptions(); + testRemoveBareMetalServerNetworkInterfaceFloatingIpWOptions(); } - // Test the updateVpcDnsResolutionBinding operation with a null options model (negative test) + // Test the removeBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpcDnsResolutionBindingNoOptions() throws Throwable { + public void testRemoveBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpcDnsResolutionBinding(null).execute(); + vpcService.removeBareMetalServerNetworkInterfaceFloatingIp(null).execute(); } - // Test the listVpcRoutes operation with a valid options model parameter + // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with a valid options model parameter @Test - public void testListVpcRoutesWOptions() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"routes\": [{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; - String listVpcRoutesPath = "/vpcs/testString/routes"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getBareMetalServerNetworkInterfaceFloatingIpPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpcRoutesOptions model - ListVpcRoutesOptions listVpcRoutesOptionsModel = new ListVpcRoutesOptions.Builder() - .vpcId("testString") - .zoneName("us-south-1") - .start("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the GetBareMetalServerNetworkInterfaceFloatingIpOptions model + GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new GetBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") .build(); - // Invoke listVpcRoutes() with a valid options model and verify the result - Response response = vpcService.listVpcRoutes(listVpcRoutesOptionsModel).execute(); + // Invoke getBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerNetworkInterfaceFloatingIp(getBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); assertNotNull(response); - RouteCollectionVPCContext responseObj = response.getResult(); + FloatingIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -3257,244 +4669,162 @@ public void testListVpcRoutesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpcRoutesPath); + assertEquals(parsedPath, getBareMetalServerNetworkInterfaceFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("zone.name"), "us-south-1"); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listVpcRoutes operation with and without retries enabled + // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled @Test - public void testListVpcRoutesWRetries() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpcRoutesWOptions(); + testGetBareMetalServerNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testListVpcRoutesWOptions(); + testGetBareMetalServerNetworkInterfaceFloatingIpWOptions(); } - // Test the listVpcRoutes operation with a null options model (negative test) + // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpcRoutesNoOptions() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listVpcRoutes(null).execute(); - } - - // Test the listVpcRoutes operation using the VpcRoutesPager.getNext() method - @Test - public void testListVpcRoutesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() - .vpcId("testString") - .zoneName("us-south-1") - .limit(Long.valueOf("10")) - .build(); - - List allResults = new ArrayList<>(); - VpcRoutesPager pager = new VpcRoutesPager(vpcService, listVpcRoutesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + vpcService.getBareMetalServerNetworkInterfaceFloatingIp(null).execute(); } - - // Test the listVpcRoutes operation using the VpcRoutesPager.getAll() method - @Test - public void testListVpcRoutesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() - .vpcId("testString") - .zoneName("us-south-1") - .limit(Long.valueOf("10")) - .build(); - VpcRoutesPager pager = new VpcRoutesPager(vpcService, listVpcRoutesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createVpcRoute operation with a valid options model parameter + // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with a valid options model parameter @Test - public void testCreateVpcRouteWOptions() throws Throwable { + public void testAddBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createVpcRoutePath = "/vpcs/testString/routes"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String addBareMetalServerNetworkInterfaceFloatingIpPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model - RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("0.0.0.0") - .build(); - - // Construct an instance of the CreateVpcRouteOptions model - CreateVpcRouteOptions createVpcRouteOptionsModel = new CreateVpcRouteOptions.Builder() - .vpcId("testString") - .destination("192.168.3.0/24") - .zone(zoneIdentityModel) - .action("deliver") - .advertise(false) - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPrototypeModel) - .priority(Long.valueOf("1")) + // Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIpOptions model + AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new AddBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") + .id("testString") .build(); - // Invoke createVpcRoute() with a valid options model and verify the result - Response response = vpcService.createVpcRoute(createVpcRouteOptionsModel).execute(); + // Invoke addBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.addBareMetalServerNetworkInterfaceFloatingIp(addBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); assertNotNull(response); - Route responseObj = response.getResult(); + FloatingIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpcRoutePath); + assertEquals(parsedPath, addBareMetalServerNetworkInterfaceFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpcRoute operation with and without retries enabled + // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled @Test - public void testCreateVpcRouteWRetries() throws Throwable { + public void testAddBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpcRouteWOptions(); + testAddBareMetalServerNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testCreateVpcRouteWOptions(); + testAddBareMetalServerNetworkInterfaceFloatingIpWOptions(); } - // Test the createVpcRoute operation with a null options model (negative test) + // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpcRouteNoOptions() throws Throwable { + public void testAddBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpcRoute(null).execute(); + vpcService.addBareMetalServerNetworkInterfaceFloatingIp(null).execute(); } - // Test the deleteVpcRoute operation with a valid options model parameter + // Test the listBareMetalServerNetworkInterfaceIps operation with a valid options model parameter @Test - public void testDeleteVpcRouteWOptions() throws Throwable { + public void testListBareMetalServerNetworkInterfaceIpsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteVpcRoutePath = "/vpcs/testString/routes/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listBareMetalServerNetworkInterfaceIpsPath = "/bare_metal_servers/testString/network_interfaces/testString/ips"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpcRouteOptions model - DeleteVpcRouteOptions deleteVpcRouteOptionsModel = new DeleteVpcRouteOptions.Builder() - .vpcId("testString") - .id("testString") + // Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model + ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptionsModel = new ListBareMetalServerNetworkInterfaceIpsOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") .build(); - // Invoke deleteVpcRoute() with a valid options model and verify the result - Response response = vpcService.deleteVpcRoute(deleteVpcRouteOptionsModel).execute(); + // Invoke listBareMetalServerNetworkInterfaceIps() with a valid options model and verify the result + Response response = vpcService.listBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ReservedIPCollectionBareMetalServerNetworkInterfaceContext responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpcRoutePath); + assertEquals(parsedPath, listBareMetalServerNetworkInterfaceIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpcRoute operation with and without retries enabled + // Test the listBareMetalServerNetworkInterfaceIps operation with and without retries enabled @Test - public void testDeleteVpcRouteWRetries() throws Throwable { + public void testListBareMetalServerNetworkInterfaceIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpcRouteWOptions(); + testListBareMetalServerNetworkInterfaceIpsWOptions(); vpcService.disableRetries(); - testDeleteVpcRouteWOptions(); + testListBareMetalServerNetworkInterfaceIpsWOptions(); } - // Test the deleteVpcRoute operation with a null options model (negative test) + // Test the listBareMetalServerNetworkInterfaceIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpcRouteNoOptions() throws Throwable { + public void testListBareMetalServerNetworkInterfaceIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpcRoute(null).execute(); + vpcService.listBareMetalServerNetworkInterfaceIps(null).execute(); } - // Test the getVpcRoute operation with a valid options model parameter + // Test the getBareMetalServerNetworkInterfaceIp operation with a valid options model parameter @Test - public void testGetVpcRouteWOptions() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getVpcRoutePath = "/vpcs/testString/routes/testString"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; + String getBareMetalServerNetworkInterfaceIpPath = "/bare_metal_servers/testString/network_interfaces/testString/ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcRouteOptions model - GetVpcRouteOptions getVpcRouteOptionsModel = new GetVpcRouteOptions.Builder() - .vpcId("testString") + // Construct an instance of the GetBareMetalServerNetworkInterfaceIpOptions model + GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptionsModel = new GetBareMetalServerNetworkInterfaceIpOptions.Builder() + .bareMetalServerId("testString") + .networkInterfaceId("testString") .id("testString") .build(); - // Invoke getVpcRoute() with a valid options model and verify the result - Response response = vpcService.getVpcRoute(getVpcRouteOptionsModel).execute(); + // Invoke getBareMetalServerNetworkInterfaceIp() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerNetworkInterfaceIp(getBareMetalServerNetworkInterfaceIpOptionsModel).execute(); assertNotNull(response); - Route responseObj = response.getResult(); + ReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -3503,123 +4833,103 @@ public void testGetVpcRouteWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcRoutePath); + assertEquals(parsedPath, getBareMetalServerNetworkInterfaceIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpcRoute operation with and without retries enabled + // Test the getBareMetalServerNetworkInterfaceIp operation with and without retries enabled @Test - public void testGetVpcRouteWRetries() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpcRouteWOptions(); + testGetBareMetalServerNetworkInterfaceIpWOptions(); vpcService.disableRetries(); - testGetVpcRouteWOptions(); + testGetBareMetalServerNetworkInterfaceIpWOptions(); } - // Test the getVpcRoute operation with a null options model (negative test) + // Test the getBareMetalServerNetworkInterfaceIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcRouteNoOptions() throws Throwable { + public void testGetBareMetalServerNetworkInterfaceIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpcRoute(null).execute(); + vpcService.getBareMetalServerNetworkInterfaceIp(null).execute(); } - // Test the updateVpcRoute operation with a valid options model parameter + // Test the deleteBareMetalServer operation with a valid options model parameter @Test - public void testUpdateVpcRouteWOptions() throws Throwable { + public void testDeleteBareMetalServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateVpcRoutePath = "/vpcs/testString/routes/testString"; + String mockResponseBody = ""; + String deleteBareMetalServerPath = "/bare_metal_servers/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model - RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPatchModel = new RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("10.240.0.12") - .build(); - - // Construct an instance of the RoutePatch model - RoutePatch routePatchModel = new RoutePatch.Builder() - .advertise(true) - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPatchModel) - .priority(Long.valueOf("1")) - .build(); - Map routePatchModelAsPatch = routePatchModel.asPatch(); - - // Construct an instance of the UpdateVpcRouteOptions model - UpdateVpcRouteOptions updateVpcRouteOptionsModel = new UpdateVpcRouteOptions.Builder() - .vpcId("testString") + // Construct an instance of the DeleteBareMetalServerOptions model + DeleteBareMetalServerOptions deleteBareMetalServerOptionsModel = new DeleteBareMetalServerOptions.Builder() .id("testString") - .routePatch(routePatchModelAsPatch) .build(); - // Invoke updateVpcRoute() with a valid options model and verify the result - Response response = vpcService.updateVpcRoute(updateVpcRouteOptionsModel).execute(); + // Invoke deleteBareMetalServer() with a valid options model and verify the result + Response response = vpcService.deleteBareMetalServer(deleteBareMetalServerOptionsModel).execute(); assertNotNull(response); - Route responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpcRoutePath); + assertEquals(parsedPath, deleteBareMetalServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVpcRoute operation with and without retries enabled + // Test the deleteBareMetalServer operation with and without retries enabled @Test - public void testUpdateVpcRouteWRetries() throws Throwable { + public void testDeleteBareMetalServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpcRouteWOptions(); + testDeleteBareMetalServerWOptions(); vpcService.disableRetries(); - testUpdateVpcRouteWOptions(); + testDeleteBareMetalServerWOptions(); } - // Test the updateVpcRoute operation with a null options model (negative test) + // Test the deleteBareMetalServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpcRouteNoOptions() throws Throwable { + public void testDeleteBareMetalServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpcRoute(null).execute(); + vpcService.deleteBareMetalServer(null).execute(); } - // Test the listVpcRoutingTables operation with a valid options model parameter + // Test the getBareMetalServer operation with a valid options model parameter @Test - public void testListVpcRoutingTablesWOptions() throws Throwable { + public void testGetBareMetalServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"routing_tables\": [{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}], \"total_count\": 132}"; - String listVpcRoutingTablesPath = "/vpcs/testString/routing_tables"; + String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"disks\": [{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"firmware\": {\"update\": \"none\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"id\": \"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 1536, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\"}, \"name\": \"my-bare-metal-server\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"disabled\", \"supported_modes\": [\"disabled\"]}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getBareMetalServerPath = "/bare_metal_servers/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpcRoutingTablesOptions model - ListVpcRoutingTablesOptions listVpcRoutingTablesOptionsModel = new ListVpcRoutingTablesOptions.Builder() - .vpcId("testString") - .start("testString") - .limit(Long.valueOf("10")) - .isDefault(true) + // Construct an instance of the GetBareMetalServerOptions model + GetBareMetalServerOptions getBareMetalServerOptionsModel = new GetBareMetalServerOptions.Builder() + .id("testString") .build(); - // Invoke listVpcRoutingTables() with a valid options model and verify the result - Response response = vpcService.listVpcRoutingTables(listVpcRoutingTablesOptionsModel).execute(); + // Invoke getBareMetalServer() with a valid options model and verify the result + Response response = vpcService.getBareMetalServer(getBareMetalServerOptionsModel).execute(); assertNotNull(response); - RoutingTableCollection responseObj = response.getResult(); + BareMetalServer responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -3628,206 +4938,136 @@ public void testListVpcRoutingTablesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpcRoutingTablesPath); + assertEquals(parsedPath, getBareMetalServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(Boolean.valueOf(query.get("is_default")), Boolean.valueOf(true)); } - // Test the listVpcRoutingTables operation with and without retries enabled + // Test the getBareMetalServer operation with and without retries enabled @Test - public void testListVpcRoutingTablesWRetries() throws Throwable { + public void testGetBareMetalServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpcRoutingTablesWOptions(); + testGetBareMetalServerWOptions(); vpcService.disableRetries(); - testListVpcRoutingTablesWOptions(); + testGetBareMetalServerWOptions(); } - // Test the listVpcRoutingTables operation with a null options model (negative test) + // Test the getBareMetalServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpcRoutingTablesNoOptions() throws Throwable { + public void testGetBareMetalServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listVpcRoutingTables(null).execute(); + vpcService.getBareMetalServer(null).execute(); } - // Test the listVpcRoutingTables operation using the VpcRoutingTablesPager.getNext() method - @Test - public void testListVpcRoutingTablesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_server\"}],\"advertise_routes_to\":[\"transit_gateway\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_internet_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"name\":\"my-vpc-routing-table-route\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_server\"}],\"advertise_routes_to\":[\"transit_gateway\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_internet_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"name\":\"my-vpc-routing-table-route\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() - .vpcId("testString") - .limit(Long.valueOf("10")) - .isDefault(true) - .build(); - - List allResults = new ArrayList<>(); - VpcRoutingTablesPager pager = new VpcRoutingTablesPager(vpcService, listVpcRoutingTablesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); - } - - // Test the listVpcRoutingTables operation using the VpcRoutingTablesPager.getAll() method + // Test the updateBareMetalServer operation with a valid options model parameter @Test - public void testListVpcRoutingTablesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_server\"}],\"advertise_routes_to\":[\"transit_gateway\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_internet_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"name\":\"my-vpc-routing-table-route\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_server\"}],\"advertise_routes_to\":[\"transit_gateway\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_internet_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"name\":\"my-vpc-routing-table-route\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); + public void testUpdateBareMetalServerWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"disks\": [{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"firmware\": {\"update\": \"none\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"id\": \"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 1536, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\"}, \"name\": \"my-bare-metal-server\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"disabled\", \"supported_modes\": [\"disabled\"]}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateBareMetalServerPath = "/bare_metal_servers/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + .setBody(mockResponseBody)); - ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() - .vpcId("testString") - .limit(Long.valueOf("10")) - .isDefault(true) + // Construct an instance of the BareMetalServerMetadataServicePatch model + BareMetalServerMetadataServicePatch bareMetalServerMetadataServicePatchModel = new BareMetalServerMetadataServicePatch.Builder() + .enabled(true) + .protocol("http") .build(); - VpcRoutingTablesPager pager = new VpcRoutingTablesPager(vpcService, listVpcRoutingTablesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createVpcRoutingTable operation with a valid options model parameter - @Test - public void testCreateVpcRoutingTableWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; - String createVpcRoutingTablePath = "/vpcs/testString/routing_tables"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the ResourceFilter model - ResourceFilter resourceFilterModel = new ResourceFilter.Builder() - .resourceType("vpn_server") + // Construct an instance of the ReservationIdentityById model + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") .build(); - // Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model - RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("0.0.0.0") + // Construct an instance of the BareMetalServerReservationAffinityPatch model + BareMetalServerReservationAffinityPatch bareMetalServerReservationAffinityPatchModel = new BareMetalServerReservationAffinityPatch.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) .build(); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the BareMetalServerTrustedPlatformModulePatch model + BareMetalServerTrustedPlatformModulePatch bareMetalServerTrustedPlatformModulePatchModel = new BareMetalServerTrustedPlatformModulePatch.Builder() + .mode("disabled") .build(); - // Construct an instance of the RoutePrototype model - RoutePrototype routePrototypeModel = new RoutePrototype.Builder() - .action("deliver") - .advertise(false) - .destination("192.168.3.0/24") - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPrototypeModel) - .priority(Long.valueOf("1")) - .zone(zoneIdentityModel) + // Construct an instance of the BareMetalServerPatch model + BareMetalServerPatch bareMetalServerPatchModel = new BareMetalServerPatch.Builder() + .bandwidth(Long.valueOf("20000")) + .enableSecureBoot(false) + .metadataService(bareMetalServerMetadataServicePatchModel) + .name("my-bare-metal-server") + .reservationAffinity(bareMetalServerReservationAffinityPatchModel) + .trustedPlatformModule(bareMetalServerTrustedPlatformModulePatchModel) .build(); + Map bareMetalServerPatchModelAsPatch = bareMetalServerPatchModel.asPatch(); - // Construct an instance of the CreateVpcRoutingTableOptions model - CreateVpcRoutingTableOptions createVpcRoutingTableOptionsModel = new CreateVpcRoutingTableOptions.Builder() - .vpcId("testString") - .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) - .advertiseRoutesTo(java.util.Arrays.asList()) - .name("my-routing-table-1") - .routeDirectLinkIngress(false) - .routeInternetIngress(false) - .routeTransitGatewayIngress(false) - .routeVpcZoneIngress(false) - .routes(java.util.Arrays.asList(routePrototypeModel)) + // Construct an instance of the UpdateBareMetalServerOptions model + UpdateBareMetalServerOptions updateBareMetalServerOptionsModel = new UpdateBareMetalServerOptions.Builder() + .id("testString") + .bareMetalServerPatch(bareMetalServerPatchModelAsPatch) .build(); - // Invoke createVpcRoutingTable() with a valid options model and verify the result - Response response = vpcService.createVpcRoutingTable(createVpcRoutingTableOptionsModel).execute(); + // Invoke updateBareMetalServer() with a valid options model and verify the result + Response response = vpcService.updateBareMetalServer(updateBareMetalServerOptionsModel).execute(); assertNotNull(response); - RoutingTable responseObj = response.getResult(); + BareMetalServer responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpcRoutingTablePath); + assertEquals(parsedPath, updateBareMetalServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpcRoutingTable operation with and without retries enabled + // Test the updateBareMetalServer operation with and without retries enabled @Test - public void testCreateVpcRoutingTableWRetries() throws Throwable { + public void testUpdateBareMetalServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpcRoutingTableWOptions(); + testUpdateBareMetalServerWOptions(); vpcService.disableRetries(); - testCreateVpcRoutingTableWOptions(); + testUpdateBareMetalServerWOptions(); } - // Test the createVpcRoutingTable operation with a null options model (negative test) + // Test the updateBareMetalServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpcRoutingTableNoOptions() throws Throwable { + public void testUpdateBareMetalServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpcRoutingTable(null).execute(); + vpcService.updateBareMetalServer(null).execute(); } - // Test the deleteVpcRoutingTable operation with a valid options model parameter + // Test the updateFirmwareForBareMetalServer operation with a valid options model parameter @Test - public void testDeleteVpcRoutingTableWOptions() throws Throwable { + public void testUpdateFirmwareForBareMetalServerWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteVpcRoutingTablePath = "/vpcs/testString/routing_tables/testString"; + String updateFirmwareForBareMetalServerPath = "/bare_metal_servers/testString/firmware/update"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpcRoutingTableOptions model - DeleteVpcRoutingTableOptions deleteVpcRoutingTableOptionsModel = new DeleteVpcRoutingTableOptions.Builder() - .vpcId("testString") + // Construct an instance of the UpdateFirmwareForBareMetalServerOptions model + UpdateFirmwareForBareMetalServerOptions updateFirmwareForBareMetalServerOptionsModel = new UpdateFirmwareForBareMetalServerOptions.Builder() .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .autoStart(true) .build(); - // Invoke deleteVpcRoutingTable() with a valid options model and verify the result - Response response = vpcService.deleteVpcRoutingTable(deleteVpcRoutingTableOptionsModel).execute(); + // Invoke updateFirmwareForBareMetalServer() with a valid options model and verify the result + Response response = vpcService.updateFirmwareForBareMetalServer(updateFirmwareForBareMetalServerOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -3835,55 +5075,54 @@ public void testDeleteVpcRoutingTableWOptions() throws Throwable { // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpcRoutingTablePath); + assertEquals(parsedPath, updateFirmwareForBareMetalServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpcRoutingTable operation with and without retries enabled + // Test the updateFirmwareForBareMetalServer operation with and without retries enabled @Test - public void testDeleteVpcRoutingTableWRetries() throws Throwable { + public void testUpdateFirmwareForBareMetalServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpcRoutingTableWOptions(); + testUpdateFirmwareForBareMetalServerWOptions(); vpcService.disableRetries(); - testDeleteVpcRoutingTableWOptions(); + testUpdateFirmwareForBareMetalServerWOptions(); } - // Test the deleteVpcRoutingTable operation with a null options model (negative test) + // Test the updateFirmwareForBareMetalServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpcRoutingTableNoOptions() throws Throwable { + public void testUpdateFirmwareForBareMetalServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpcRoutingTable(null).execute(); + vpcService.updateFirmwareForBareMetalServer(null).execute(); } - // Test the getVpcRoutingTable operation with a valid options model parameter + // Test the getBareMetalServerInitialization operation with a valid options model parameter @Test - public void testGetVpcRoutingTableWOptions() throws Throwable { + public void testGetBareMetalServerInitializationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; - String getVpcRoutingTablePath = "/vpcs/testString/routing_tables/testString"; + String mockResponseBody = "{\"default_trusted_profile\": {\"auto_link\": true, \"target\": {\"crn\": \"crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\", \"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\", \"resource_type\": \"trusted_profile\"}}, \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"keys\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}], \"user_accounts\": [{\"encrypted_password\": \"qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}, \"resource_type\": \"host_user_account\", \"username\": \"Administrator\"}]}"; + String getBareMetalServerInitializationPath = "/bare_metal_servers/testString/initialization"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcRoutingTableOptions model - GetVpcRoutingTableOptions getVpcRoutingTableOptionsModel = new GetVpcRoutingTableOptions.Builder() - .vpcId("testString") + // Construct an instance of the GetBareMetalServerInitializationOptions model + GetBareMetalServerInitializationOptions getBareMetalServerInitializationOptionsModel = new GetBareMetalServerInitializationOptions.Builder() .id("testString") .build(); - // Invoke getVpcRoutingTable() with a valid options model and verify the result - Response response = vpcService.getVpcRoutingTable(getVpcRoutingTableOptionsModel).execute(); + // Invoke getBareMetalServerInitialization() with a valid options model and verify the result + Response response = vpcService.getBareMetalServerInitialization(getBareMetalServerInitializationOptionsModel).execute(); assertNotNull(response); - RoutingTable responseObj = response.getResult(); + BareMetalServerInitialization responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -3892,267 +5131,181 @@ public void testGetVpcRoutingTableWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcRoutingTablePath); + assertEquals(parsedPath, getBareMetalServerInitializationPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpcRoutingTable operation with and without retries enabled + // Test the getBareMetalServerInitialization operation with and without retries enabled @Test - public void testGetVpcRoutingTableWRetries() throws Throwable { + public void testGetBareMetalServerInitializationWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpcRoutingTableWOptions(); + testGetBareMetalServerInitializationWOptions(); vpcService.disableRetries(); - testGetVpcRoutingTableWOptions(); + testGetBareMetalServerInitializationWOptions(); } - // Test the getVpcRoutingTable operation with a null options model (negative test) + // Test the getBareMetalServerInitialization operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcRoutingTableNoOptions() throws Throwable { + public void testGetBareMetalServerInitializationNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpcRoutingTable(null).execute(); + vpcService.getBareMetalServerInitialization(null).execute(); } - // Test the updateVpcRoutingTable operation with a valid options model parameter + // Test the replaceBareMetalServerInitialization operation with a valid options model parameter @Test - public void testUpdateVpcRoutingTableWOptions() throws Throwable { + public void testReplaceBareMetalServerInitializationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; - String updateVpcRoutingTablePath = "/vpcs/testString/routing_tables/testString"; + String mockResponseBody = "{\"default_trusted_profile\": {\"auto_link\": true, \"target\": {\"crn\": \"crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\", \"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\", \"resource_type\": \"trusted_profile\"}}, \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"keys\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}], \"user_accounts\": [{\"encrypted_password\": \"qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}, \"resource_type\": \"host_user_account\", \"username\": \"Administrator\"}]}"; + String replaceBareMetalServerInitializationPath = "/bare_metal_servers/testString/initialization"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ResourceFilter model - ResourceFilter resourceFilterModel = new ResourceFilter.Builder() - .resourceType("vpn_server") + // Construct an instance of the ImageIdentityById model + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() + .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .build(); - // Construct an instance of the RoutingTablePatch model - RoutingTablePatch routingTablePatchModel = new RoutingTablePatch.Builder() - .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) - .advertiseRoutesTo(java.util.Arrays.asList("transit_gateway")) - .name("my-routing-table-2") - .routeDirectLinkIngress(true) - .routeInternetIngress(true) - .routeTransitGatewayIngress(true) - .routeVpcZoneIngress(true) + // Construct an instance of the KeyIdentityById model + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") .build(); - Map routingTablePatchModelAsPatch = routingTablePatchModel.asPatch(); - // Construct an instance of the UpdateVpcRoutingTableOptions model - UpdateVpcRoutingTableOptions updateVpcRoutingTableOptionsModel = new UpdateVpcRoutingTableOptions.Builder() - .vpcId("testString") + // Construct an instance of the TrustedProfileIdentityById model + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + + // Construct an instance of the BareMetalServerInitializationDefaultTrustedProfilePrototype model + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + + // Construct an instance of the ReplaceBareMetalServerInitializationOptions model + ReplaceBareMetalServerInitializationOptions replaceBareMetalServerInitializationOptionsModel = new ReplaceBareMetalServerInitializationOptions.Builder() .id("testString") - .routingTablePatch(routingTablePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .image(imageIdentityModel) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) + .userData("testString") .build(); - // Invoke updateVpcRoutingTable() with a valid options model and verify the result - Response response = vpcService.updateVpcRoutingTable(updateVpcRoutingTableOptionsModel).execute(); + // Invoke replaceBareMetalServerInitialization() with a valid options model and verify the result + Response response = vpcService.replaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModel).execute(); assertNotNull(response); - RoutingTable responseObj = response.getResult(); + BareMetalServerInitialization responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpcRoutingTablePath); + assertEquals(parsedPath, replaceBareMetalServerInitializationPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVpcRoutingTable operation with and without retries enabled + // Test the replaceBareMetalServerInitialization operation with and without retries enabled @Test - public void testUpdateVpcRoutingTableWRetries() throws Throwable { + public void testReplaceBareMetalServerInitializationWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpcRoutingTableWOptions(); + testReplaceBareMetalServerInitializationWOptions(); vpcService.disableRetries(); - testUpdateVpcRoutingTableWOptions(); + testReplaceBareMetalServerInitializationWOptions(); } - // Test the updateVpcRoutingTable operation with a null options model (negative test) + // Test the replaceBareMetalServerInitialization operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpcRoutingTableNoOptions() throws Throwable { + public void testReplaceBareMetalServerInitializationNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpcRoutingTable(null).execute(); + vpcService.replaceBareMetalServerInitialization(null).execute(); } - // Test the listVpcRoutingTableRoutes operation with a valid options model parameter + // Test the restartBareMetalServer operation with a valid options model parameter @Test - public void testListVpcRoutingTableRoutesWOptions() throws Throwable { + public void testRestartBareMetalServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"routes\": [{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; - String listVpcRoutingTableRoutesPath = "/vpcs/testString/routing_tables/testString/routes"; + String mockResponseBody = ""; + String restartBareMetalServerPath = "/bare_metal_servers/testString/restart"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ListVpcRoutingTableRoutesOptions model - ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptionsModel = new ListVpcRoutingTableRoutesOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .start("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the RestartBareMetalServerOptions model + RestartBareMetalServerOptions restartBareMetalServerOptionsModel = new RestartBareMetalServerOptions.Builder() + .id("testString") .build(); - // Invoke listVpcRoutingTableRoutes() with a valid options model and verify the result - Response response = vpcService.listVpcRoutingTableRoutes(listVpcRoutingTableRoutesOptionsModel).execute(); + // Invoke restartBareMetalServer() with a valid options model and verify the result + Response response = vpcService.restartBareMetalServer(restartBareMetalServerOptionsModel).execute(); assertNotNull(response); - RouteCollection responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpcRoutingTableRoutesPath); + assertEquals(parsedPath, restartBareMetalServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listVpcRoutingTableRoutes operation with and without retries enabled + // Test the restartBareMetalServer operation with and without retries enabled @Test - public void testListVpcRoutingTableRoutesWRetries() throws Throwable { + public void testRestartBareMetalServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpcRoutingTableRoutesWOptions(); + testRestartBareMetalServerWOptions(); vpcService.disableRetries(); - testListVpcRoutingTableRoutesWOptions(); + testRestartBareMetalServerWOptions(); } - // Test the listVpcRoutingTableRoutes operation with a null options model (negative test) + // Test the restartBareMetalServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpcRoutingTableRoutesNoOptions() throws Throwable { + public void testRestartBareMetalServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listVpcRoutingTableRoutes(null).execute(); - } - - // Test the listVpcRoutingTableRoutes operation using the VpcRoutingTableRoutesPager.getNext() method - @Test - public void testListVpcRoutingTableRoutesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .limit(Long.valueOf("10")) - .build(); - - List allResults = new ArrayList<>(); - VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(vpcService, listVpcRoutingTableRoutesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + vpcService.restartBareMetalServer(null).execute(); } - - // Test the listVpcRoutingTableRoutes operation using the VpcRoutingTableRoutesPager.getAll() method - @Test - public void testListVpcRoutingTableRoutesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .limit(Long.valueOf("10")) - .build(); - VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(vpcService, listVpcRoutingTableRoutesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createVpcRoutingTableRoute operation with a valid options model parameter + // Test the startBareMetalServer operation with a valid options model parameter @Test - public void testCreateVpcRoutingTableRouteWOptions() throws Throwable { + public void testStartBareMetalServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createVpcRoutingTableRoutePath = "/vpcs/testString/routing_tables/testString/routes"; + String mockResponseBody = ""; + String startBareMetalServerPath = "/bare_metal_servers/testString/start"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model - RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("0.0.0.0") - .build(); - - // Construct an instance of the CreateVpcRoutingTableRouteOptions model - CreateVpcRoutingTableRouteOptions createVpcRoutingTableRouteOptionsModel = new CreateVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .destination("192.168.3.0/24") - .zone(zoneIdentityModel) - .action("deliver") - .advertise(false) - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPrototypeModel) - .priority(Long.valueOf("1")) + // Construct an instance of the StartBareMetalServerOptions model + StartBareMetalServerOptions startBareMetalServerOptionsModel = new StartBareMetalServerOptions.Builder() + .id("testString") .build(); - // Invoke createVpcRoutingTableRoute() with a valid options model and verify the result - Response response = vpcService.createVpcRoutingTableRoute(createVpcRoutingTableRouteOptionsModel).execute(); + // Invoke startBareMetalServer() with a valid options model and verify the result + Response response = vpcService.startBareMetalServer(startBareMetalServerOptionsModel).execute(); assertNotNull(response); - Route responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -4160,50 +5313,49 @@ public void testCreateVpcRoutingTableRouteWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpcRoutingTableRoutePath); + assertEquals(parsedPath, startBareMetalServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpcRoutingTableRoute operation with and without retries enabled + // Test the startBareMetalServer operation with and without retries enabled @Test - public void testCreateVpcRoutingTableRouteWRetries() throws Throwable { + public void testStartBareMetalServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpcRoutingTableRouteWOptions(); + testStartBareMetalServerWOptions(); vpcService.disableRetries(); - testCreateVpcRoutingTableRouteWOptions(); + testStartBareMetalServerWOptions(); } - // Test the createVpcRoutingTableRoute operation with a null options model (negative test) + // Test the startBareMetalServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpcRoutingTableRouteNoOptions() throws Throwable { + public void testStartBareMetalServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpcRoutingTableRoute(null).execute(); + vpcService.startBareMetalServer(null).execute(); } - // Test the deleteVpcRoutingTableRoute operation with a valid options model parameter + // Test the stopBareMetalServer operation with a valid options model parameter @Test - public void testDeleteVpcRoutingTableRouteWOptions() throws Throwable { + public void testStopBareMetalServerWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteVpcRoutingTableRoutePath = "/vpcs/testString/routing_tables/testString/routes/testString"; + String stopBareMetalServerPath = "/bare_metal_servers/testString/stop"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpcRoutingTableRouteOptions model - DeleteVpcRoutingTableRouteOptions deleteVpcRoutingTableRouteOptionsModel = new DeleteVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") + // Construct an instance of the StopBareMetalServerOptions model + StopBareMetalServerOptions stopBareMetalServerOptionsModel = new StopBareMetalServerOptions.Builder() .id("testString") + .type("hard") .build(); - // Invoke deleteVpcRoutingTableRoute() with a valid options model and verify the result - Response response = vpcService.deleteVpcRoutingTableRoute(deleteVpcRoutingTableRouteOptionsModel).execute(); + // Invoke stopBareMetalServer() with a valid options model and verify the result + Response response = vpcService.stopBareMetalServer(stopBareMetalServerOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -4211,56 +5363,55 @@ public void testDeleteVpcRoutingTableRouteWOptions() throws Throwable { // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpcRoutingTableRoutePath); + assertEquals(parsedPath, stopBareMetalServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpcRoutingTableRoute operation with and without retries enabled + // Test the stopBareMetalServer operation with and without retries enabled @Test - public void testDeleteVpcRoutingTableRouteWRetries() throws Throwable { + public void testStopBareMetalServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpcRoutingTableRouteWOptions(); + testStopBareMetalServerWOptions(); vpcService.disableRetries(); - testDeleteVpcRoutingTableRouteWOptions(); + testStopBareMetalServerWOptions(); } - // Test the deleteVpcRoutingTableRoute operation with a null options model (negative test) + // Test the stopBareMetalServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpcRoutingTableRouteNoOptions() throws Throwable { + public void testStopBareMetalServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpcRoutingTableRoute(null).execute(); + vpcService.stopBareMetalServer(null).execute(); } - // Test the getVpcRoutingTableRoute operation with a valid options model parameter + // Test the listClusterNetworkProfiles operation with a valid options model parameter @Test - public void testGetVpcRoutingTableRouteWOptions() throws Throwable { + public void testListClusterNetworkProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getVpcRoutingTableRoutePath = "/vpcs/testString/routing_tables/testString/routes/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"family\": \"vela\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}], \"total_count\": 132}"; + String listClusterNetworkProfilesPath = "/cluster_network/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpcRoutingTableRouteOptions model - GetVpcRoutingTableRouteOptions getVpcRoutingTableRouteOptionsModel = new GetVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .id("testString") + // Construct an instance of the ListClusterNetworkProfilesOptions model + ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptionsModel = new ListClusterNetworkProfilesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke getVpcRoutingTableRoute() with a valid options model and verify the result - Response response = vpcService.getVpcRoutingTableRoute(getVpcRoutingTableRouteOptionsModel).execute(); + // Invoke listClusterNetworkProfiles() with a valid options model and verify the result + Response response = vpcService.listClusterNetworkProfiles(listClusterNetworkProfilesOptionsModel).execute(); assertNotNull(response); - Route responseObj = response.getResult(); + ClusterNetworkProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -4269,129 +5420,168 @@ public void testGetVpcRoutingTableRouteWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpcRoutingTableRoutePath); + assertEquals(parsedPath, listClusterNetworkProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the getVpcRoutingTableRoute operation with and without retries enabled + // Test the listClusterNetworkProfiles operation with and without retries enabled @Test - public void testGetVpcRoutingTableRouteWRetries() throws Throwable { + public void testListClusterNetworkProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpcRoutingTableRouteWOptions(); + testListClusterNetworkProfilesWOptions(); vpcService.disableRetries(); - testGetVpcRoutingTableRouteWOptions(); - } - - // Test the getVpcRoutingTableRoute operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpcRoutingTableRouteNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getVpcRoutingTableRoute(null).execute(); + testListClusterNetworkProfilesWOptions(); } - // Test the updateVpcRoutingTableRoute operation with a valid options model parameter + // Test the listClusterNetworkProfiles operation using the ClusterNetworkProfilesPager.getNext() method @Test - public void testUpdateVpcRoutingTableRouteWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateVpcRoutingTableRoutePath = "/vpcs/testString/routing_tables/testString/routes/testString"; + public void testListClusterNetworkProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"vela\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zones\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"vela\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zones\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}]}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model - RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPatchModel = new RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.Builder() - .address("0.0.0.0") + ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptions = new ListClusterNetworkProfilesOptions.Builder() + .limit(Long.valueOf("10")) .build(); - // Construct an instance of the RoutePatch model - RoutePatch routePatchModel = new RoutePatch.Builder() - .advertise(false) - .name("my-vpc-routing-table-route") - .nextHop(routeNextHopPatchModel) - .priority(Long.valueOf("1")) + List allResults = new ArrayList<>(); + ClusterNetworkProfilesPager pager = new ClusterNetworkProfilesPager(vpcService, listClusterNetworkProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listClusterNetworkProfiles operation using the ClusterNetworkProfilesPager.getAll() method + @Test + public void testListClusterNetworkProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"vela\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zones\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"vela\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zones\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}]}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptions = new ListClusterNetworkProfilesOptions.Builder() + .limit(Long.valueOf("10")) .build(); - Map routePatchModelAsPatch = routePatchModel.asPatch(); - // Construct an instance of the UpdateVpcRoutingTableRouteOptions model - UpdateVpcRoutingTableRouteOptions updateVpcRoutingTableRouteOptionsModel = new UpdateVpcRoutingTableRouteOptions.Builder() - .vpcId("testString") - .routingTableId("testString") - .id("testString") - .routePatch(routePatchModelAsPatch) + ClusterNetworkProfilesPager pager = new ClusterNetworkProfilesPager(vpcService, listClusterNetworkProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the getClusterNetworkProfile operation with a valid options model parameter + @Test + public void testGetClusterNetworkProfileWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"family\": \"vela\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}"; + String getClusterNetworkProfilePath = "/cluster_network/profiles/h100"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetClusterNetworkProfileOptions model + GetClusterNetworkProfileOptions getClusterNetworkProfileOptionsModel = new GetClusterNetworkProfileOptions.Builder() + .name("h100") .build(); - // Invoke updateVpcRoutingTableRoute() with a valid options model and verify the result - Response response = vpcService.updateVpcRoutingTableRoute(updateVpcRoutingTableRouteOptionsModel).execute(); + // Invoke getClusterNetworkProfile() with a valid options model and verify the result + Response response = vpcService.getClusterNetworkProfile(getClusterNetworkProfileOptionsModel).execute(); assertNotNull(response); - Route responseObj = response.getResult(); + ClusterNetworkProfile responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpcRoutingTableRoutePath); + assertEquals(parsedPath, getClusterNetworkProfilePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVpcRoutingTableRoute operation with and without retries enabled + // Test the getClusterNetworkProfile operation with and without retries enabled @Test - public void testUpdateVpcRoutingTableRouteWRetries() throws Throwable { + public void testGetClusterNetworkProfileWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpcRoutingTableRouteWOptions(); + testGetClusterNetworkProfileWOptions(); vpcService.disableRetries(); - testUpdateVpcRoutingTableRouteWOptions(); + testGetClusterNetworkProfileWOptions(); } - // Test the updateVpcRoutingTableRoute operation with a null options model (negative test) + // Test the getClusterNetworkProfile operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpcRoutingTableRouteNoOptions() throws Throwable { + public void testGetClusterNetworkProfileNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpcRoutingTableRoute(null).execute(); + vpcService.getClusterNetworkProfile(null).execute(); } - // Test the listSubnets operation with a valid options model parameter + // Test the listClusterNetworks operation with a valid options model parameter @Test - public void testListSubnetsWOptions() throws Throwable { + public void testListClusterNetworksWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"subnets\": [{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"name\": \"my-subnet\", \"network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"public_gateway\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_type\": \"public_gateway\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"subnet\", \"routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"status\": \"available\", \"total_ipv4_address_count\": 256, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; - String listSubnetsPath = "/subnets"; + String mockResponseBody = "{\"cluster_networks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listClusterNetworksPath = "/cluster_networks"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListSubnetsOptions model - ListSubnetsOptions listSubnetsOptionsModel = new ListSubnetsOptions.Builder() + // Construct an instance of the ListClusterNetworksOptions model + ListClusterNetworksOptions listClusterNetworksOptionsModel = new ListClusterNetworksOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("us-south-1") + .name("my-name") + .sort("name") .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") - .routingTableId("testString") - .routingTableName("my-routing-table") .build(); - // Invoke listSubnets() with a valid options model and verify the result - Response response = vpcService.listSubnets(listSubnetsOptionsModel).execute(); + // Invoke listClusterNetworks() with a valid options model and verify the result + Response response = vpcService.listClusterNetworks(listClusterNetworksOptionsModel).execute(); assertNotNull(response); - SubnetCollection responseObj = response.getResult(); + ClusterNetworkCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -4400,39 +5590,38 @@ public void testListSubnetsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSubnetsPath); + assertEquals(parsedPath, listClusterNetworksPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("zone.name"), "us-south-1"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("sort"), "name"); assertEquals(query.get("vpc.id"), "testString"); assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); assertEquals(query.get("vpc.name"), "my-vpc"); - assertEquals(query.get("routing_table.id"), "testString"); - assertEquals(query.get("routing_table.name"), "my-routing-table"); } - // Test the listSubnets operation with and without retries enabled + // Test the listClusterNetworks operation with and without retries enabled @Test - public void testListSubnetsWRetries() throws Throwable { + public void testListClusterNetworksWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSubnetsWOptions(); + testListClusterNetworksWOptions(); vpcService.disableRetries(); - testListSubnetsWOptions(); + testListClusterNetworksWOptions(); } - // Test the listSubnets operation using the SubnetsPager.getNext() method + // Test the listClusterNetworks operation using the ClusterNetworksPager.getNext() method @Test - public void testListSubnetsWithPagerGetNext() throws Throwable { + public void testListClusterNetworksWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"cluster_networks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"cluster_network\",\"subnet_prefixes\":[{\"allocation_policy\":\"auto\",\"cidr\":\"10.0.0.0/24\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"cluster_networks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"cluster_network\",\"subnet_prefixes\":[{\"allocation_policy\":\"auto\",\"cidr\":\"10.0.0.0/24\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -4446,33 +5635,32 @@ public void testListSubnetsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() + ListClusterNetworksOptions listClusterNetworksOptions = new ListClusterNetworksOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("us-south-1") + .name("my-name") + .sort("name") .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") - .routingTableId("testString") - .routingTableName("my-routing-table") .build(); - List allResults = new ArrayList<>(); - SubnetsPager pager = new SubnetsPager(vpcService, listSubnetsOptions); + List allResults = new ArrayList<>(); + ClusterNetworksPager pager = new ClusterNetworksPager(vpcService, listClusterNetworksOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listSubnets operation using the SubnetsPager.getAll() method + // Test the listClusterNetworks operation using the ClusterNetworksPager.getAll() method @Test - public void testListSubnetsWithPagerGetAll() throws Throwable { + public void testListClusterNetworksWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"cluster_networks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"cluster_network\",\"subnet_prefixes\":[{\"allocation_policy\":\"auto\",\"cidr\":\"10.0.0.0/24\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"cluster_networks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"cluster_network\",\"subnet_prefixes\":[{\"allocation_policy\":\"auto\",\"cidr\":\"10.0.0.0/24\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -4486,52 +5674,36 @@ public void testListSubnetsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() + ListClusterNetworksOptions listClusterNetworksOptions = new ListClusterNetworksOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("us-south-1") + .name("my-name") + .sort("name") .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") - .routingTableId("testString") - .routingTableName("my-routing-table") .build(); - SubnetsPager pager = new SubnetsPager(vpcService, listSubnetsOptions); - List allResults = pager.getAll(); + ClusterNetworksPager pager = new ClusterNetworksPager(vpcService, listClusterNetworksOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createSubnet operation with a valid options model parameter + // Test the createClusterNetwork operation with a valid options model parameter @Test - public void testCreateSubnetWOptions() throws Throwable { + public void testCreateClusterNetworkWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"name\": \"my-subnet\", \"network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"public_gateway\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_type\": \"public_gateway\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"subnet\", \"routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"status\": \"available\", \"total_ipv4_address_count\": 256, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createSubnetPath = "/subnets"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createClusterNetworkPath = "/cluster_networks"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the NetworkACLIdentityById model - NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") - .build(); - - // Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityById model - PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() - .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") - .build(); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the RoutingTableIdentityByCRN model - RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") + // Construct an instance of the ClusterNetworkProfileIdentityByName model + ClusterNetworkProfileIdentityByName clusterNetworkProfileIdentityModel = new ClusterNetworkProfileIdentityByName.Builder() + .name("h100") .build(); // Construct an instance of the VPCIdentityById model @@ -4544,133 +5716,87 @@ public void testCreateSubnetWOptions() throws Throwable { .name("us-south-1") .build(); - // Construct an instance of the SubnetPrototypeSubnetByTotalCount model - SubnetPrototypeSubnetByTotalCount subnetPrototypeModel = new SubnetPrototypeSubnetByTotalCount.Builder() - .ipVersion("ipv4") - .name("my-subnet") - .networkAcl(networkAclIdentityModel) - .publicGateway(publicGatewayIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .routingTable(routingTableIdentityModel) - .vpc(vpcIdentityModel) - .totalIpv4AddressCount(Long.valueOf("256")) - .zone(zoneIdentityModel) + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the CreateSubnetOptions model - CreateSubnetOptions createSubnetOptionsModel = new CreateSubnetOptions.Builder() - .subnetPrototype(subnetPrototypeModel) + // Construct an instance of the ClusterNetworkSubnetPrefixPrototype model + ClusterNetworkSubnetPrefixPrototype clusterNetworkSubnetPrefixPrototypeModel = new ClusterNetworkSubnetPrefixPrototype.Builder() + .cidr("10.0.0.0/24") .build(); - // Invoke createSubnet() with a valid options model and verify the result - Response response = vpcService.createSubnet(createSubnetOptionsModel).execute(); - assertNotNull(response); - Subnet responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSubnetPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the createSubnet operation with and without retries enabled - @Test - public void testCreateSubnetWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testCreateSubnetWOptions(); - - vpcService.disableRetries(); - testCreateSubnetWOptions(); - } - - // Test the createSubnet operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateSubnetNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createSubnet(null).execute(); - } - - // Test the deleteSubnet operation with a valid options model parameter - @Test - public void testDeleteSubnetWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteSubnetPath = "/subnets/testString"; - server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteSubnetOptions model - DeleteSubnetOptions deleteSubnetOptionsModel = new DeleteSubnetOptions.Builder() - .id("testString") + // Construct an instance of the CreateClusterNetworkOptions model + CreateClusterNetworkOptions createClusterNetworkOptionsModel = new CreateClusterNetworkOptions.Builder() + .profile(clusterNetworkProfileIdentityModel) + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .name("my-cluster-network") + .resourceGroup(resourceGroupIdentityModel) + .subnetPrefixes(java.util.Arrays.asList(clusterNetworkSubnetPrefixPrototypeModel)) .build(); - // Invoke deleteSubnet() with a valid options model and verify the result - Response response = vpcService.deleteSubnet(deleteSubnetOptionsModel).execute(); + // Invoke createClusterNetwork() with a valid options model and verify the result + Response response = vpcService.createClusterNetwork(createClusterNetworkOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ClusterNetwork responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSubnetPath); + assertEquals(parsedPath, createClusterNetworkPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteSubnet operation with and without retries enabled + // Test the createClusterNetwork operation with and without retries enabled @Test - public void testDeleteSubnetWRetries() throws Throwable { + public void testCreateClusterNetworkWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSubnetWOptions(); + testCreateClusterNetworkWOptions(); vpcService.disableRetries(); - testDeleteSubnetWOptions(); + testCreateClusterNetworkWOptions(); } - // Test the deleteSubnet operation with a null options model (negative test) + // Test the createClusterNetwork operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSubnetNoOptions() throws Throwable { + public void testCreateClusterNetworkNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSubnet(null).execute(); + vpcService.createClusterNetwork(null).execute(); } - // Test the getSubnet operation with a valid options model parameter + // Test the listClusterNetworkInterfaces operation with a valid options model parameter @Test - public void testGetSubnetWOptions() throws Throwable { + public void testListClusterNetworkInterfacesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"name\": \"my-subnet\", \"network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"public_gateway\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_type\": \"public_gateway\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"subnet\", \"routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"status\": \"available\", \"total_ipv4_address_count\": 256, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getSubnetPath = "/subnets/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"interfaces\": [{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listClusterNetworkInterfacesPath = "/cluster_networks/testString/interfaces"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetSubnetOptions model - GetSubnetOptions getSubnetOptionsModel = new GetSubnetOptions.Builder() - .id("testString") + // Construct an instance of the ListClusterNetworkInterfacesOptions model + ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptionsModel = new ListClusterNetworkInterfacesOptions.Builder() + .clusterNetworkId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") .build(); - // Invoke getSubnet() with a valid options model and verify the result - Response response = vpcService.getSubnet(getSubnetOptionsModel).execute(); + // Invoke listClusterNetworkInterfaces() with a valid options model and verify the result + Response response = vpcService.listClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModel).execute(); assertNotNull(response); - Subnet responseObj = response.getResult(); + ClusterNetworkInterfaceCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -4679,241 +5805,194 @@ public void testGetSubnetWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSubnetPath); + assertEquals(parsedPath, listClusterNetworkInterfacesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("sort"), "name"); } - // Test the getSubnet operation with and without retries enabled + // Test the listClusterNetworkInterfaces operation with and without retries enabled @Test - public void testGetSubnetWRetries() throws Throwable { + public void testListClusterNetworkInterfacesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSubnetWOptions(); + testListClusterNetworkInterfacesWOptions(); vpcService.disableRetries(); - testGetSubnetWOptions(); + testListClusterNetworkInterfacesWOptions(); } - // Test the getSubnet operation with a null options model (negative test) + // Test the listClusterNetworkInterfaces operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSubnetNoOptions() throws Throwable { + public void testListClusterNetworkInterfacesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSubnet(null).execute(); + vpcService.listClusterNetworkInterfaces(null).execute(); } - // Test the updateSubnet operation with a valid options model parameter + // Test the listClusterNetworkInterfaces operation using the ClusterNetworkInterfacesPager.getNext() method @Test - public void testUpdateSubnetWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"name\": \"my-subnet\", \"network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"public_gateway\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_type\": \"public_gateway\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"subnet\", \"routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"status\": \"available\", \"total_ipv4_address_count\": 256, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateSubnetPath = "/subnets/testString"; + public void testListClusterNetworkInterfacesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"},\"target\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"},\"target\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the NetworkACLIdentityById model - NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") - .build(); - - // Construct an instance of the SubnetPublicGatewayPatchPublicGatewayIdentityById model - SubnetPublicGatewayPatchPublicGatewayIdentityById subnetPublicGatewayPatchModel = new SubnetPublicGatewayPatchPublicGatewayIdentityById.Builder() - .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") - .build(); - - // Construct an instance of the RoutingTableIdentityByCRN model - RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") - .build(); - - // Construct an instance of the SubnetPatch model - SubnetPatch subnetPatchModel = new SubnetPatch.Builder() - .name("my-subnet") - .networkAcl(networkAclIdentityModel) - .publicGateway(subnetPublicGatewayPatchModel) - .routingTable(routingTableIdentityModel) - .build(); - Map subnetPatchModelAsPatch = subnetPatchModel.asPatch(); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the UpdateSubnetOptions model - UpdateSubnetOptions updateSubnetOptionsModel = new UpdateSubnetOptions.Builder() - .id("testString") - .subnetPatch(subnetPatchModelAsPatch) + ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptions = new ListClusterNetworkInterfacesOptions.Builder() + .clusterNetworkId("testString") + .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") .build(); - // Invoke updateSubnet() with a valid options model and verify the result - Response response = vpcService.updateSubnet(updateSubnetOptionsModel).execute(); - assertNotNull(response); - Subnet responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateSubnetPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the updateSubnet operation with and without retries enabled - @Test - public void testUpdateSubnetWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testUpdateSubnetWOptions(); - - vpcService.disableRetries(); - testUpdateSubnetWOptions(); - } - - // Test the updateSubnet operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateSubnetNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.updateSubnet(null).execute(); + List allResults = new ArrayList<>(); + ClusterNetworkInterfacesPager pager = new ClusterNetworkInterfacesPager(vpcService, listClusterNetworkInterfacesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } - - // Test the getSubnetNetworkAcl operation with a valid options model parameter + + // Test the listClusterNetworkInterfaces operation using the ClusterNetworkInterfacesPager.getAll() method @Test - public void testGetSubnetNetworkAclWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getSubnetNetworkAclPath = "/subnets/testString/network_acl"; + public void testListClusterNetworkInterfacesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"},\"target\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"},\"target\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the GetSubnetNetworkAclOptions model - GetSubnetNetworkAclOptions getSubnetNetworkAclOptionsModel = new GetSubnetNetworkAclOptions.Builder() - .id("testString") + ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptions = new ListClusterNetworkInterfacesOptions.Builder() + .clusterNetworkId("testString") + .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") .build(); - // Invoke getSubnetNetworkAcl() with a valid options model and verify the result - Response response = vpcService.getSubnetNetworkAcl(getSubnetNetworkAclOptionsModel).execute(); - assertNotNull(response); - NetworkACL responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSubnetNetworkAclPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the getSubnetNetworkAcl operation with and without retries enabled - @Test - public void testGetSubnetNetworkAclWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetSubnetNetworkAclWOptions(); - - vpcService.disableRetries(); - testGetSubnetNetworkAclWOptions(); - } - - // Test the getSubnetNetworkAcl operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSubnetNetworkAclNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getSubnetNetworkAcl(null).execute(); + ClusterNetworkInterfacesPager pager = new ClusterNetworkInterfacesPager(vpcService, listClusterNetworkInterfacesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the replaceSubnetNetworkAcl operation with a valid options model parameter + + // Test the createClusterNetworkInterface operation with a valid options model parameter @Test - public void testReplaceSubnetNetworkAclWOptions() throws Throwable { + public void testCreateClusterNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String replaceSubnetNetworkAclPath = "/subnets/testString/network_acl"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createClusterNetworkInterfacePath = "/cluster_networks/testString/interfaces"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the NetworkACLIdentityById model - NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() - .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") + // Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") .build(); - // Construct an instance of the ReplaceSubnetNetworkAclOptions model - ReplaceSubnetNetworkAclOptions replaceSubnetNetworkAclOptionsModel = new ReplaceSubnetNetworkAclOptions.Builder() - .id("testString") - .networkAclIdentity(networkAclIdentityModel) + // Construct an instance of the ClusterNetworkSubnetIdentityById model + ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() + .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") .build(); - // Invoke replaceSubnetNetworkAcl() with a valid options model and verify the result - Response response = vpcService.replaceSubnetNetworkAcl(replaceSubnetNetworkAclOptionsModel).execute(); + // Construct an instance of the CreateClusterNetworkInterfaceOptions model + CreateClusterNetworkInterfaceOptions createClusterNetworkInterfaceOptionsModel = new CreateClusterNetworkInterfaceOptions.Builder() + .clusterNetworkId("testString") + .name("my-cluster-network-interface") + .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) + .subnet(clusterNetworkSubnetIdentityModel) + .build(); + + // Invoke createClusterNetworkInterface() with a valid options model and verify the result + Response response = vpcService.createClusterNetworkInterface(createClusterNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - NetworkACL responseObj = response.getResult(); + ClusterNetworkInterface responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, replaceSubnetNetworkAclPath); + assertEquals(parsedPath, createClusterNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the replaceSubnetNetworkAcl operation with and without retries enabled + // Test the createClusterNetworkInterface operation with and without retries enabled @Test - public void testReplaceSubnetNetworkAclWRetries() throws Throwable { + public void testCreateClusterNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testReplaceSubnetNetworkAclWOptions(); + testCreateClusterNetworkInterfaceWOptions(); vpcService.disableRetries(); - testReplaceSubnetNetworkAclWOptions(); + testCreateClusterNetworkInterfaceWOptions(); } - // Test the replaceSubnetNetworkAcl operation with a null options model (negative test) + // Test the createClusterNetworkInterface operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testReplaceSubnetNetworkAclNoOptions() throws Throwable { + public void testCreateClusterNetworkInterfaceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.replaceSubnetNetworkAcl(null).execute(); + vpcService.createClusterNetworkInterface(null).execute(); } - // Test the unsetSubnetPublicGateway operation with a valid options model parameter + // Test the deleteClusterNetworkInterface operation with a valid options model parameter @Test - public void testUnsetSubnetPublicGatewayWOptions() throws Throwable { + public void testDeleteClusterNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String unsetSubnetPublicGatewayPath = "/subnets/testString/public_gateway"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String deleteClusterNetworkInterfacePath = "/cluster_networks/testString/interfaces/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the UnsetSubnetPublicGatewayOptions model - UnsetSubnetPublicGatewayOptions unsetSubnetPublicGatewayOptionsModel = new UnsetSubnetPublicGatewayOptions.Builder() + // Construct an instance of the DeleteClusterNetworkInterfaceOptions model + DeleteClusterNetworkInterfaceOptions deleteClusterNetworkInterfaceOptionsModel = new DeleteClusterNetworkInterfaceOptions.Builder() + .clusterNetworkId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke unsetSubnetPublicGateway() with a valid options model and verify the result - Response response = vpcService.unsetSubnetPublicGateway(unsetSubnetPublicGatewayOptionsModel).execute(); + // Invoke deleteClusterNetworkInterface() with a valid options model and verify the result + Response response = vpcService.deleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ClusterNetworkInterface responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -4921,51 +6000,52 @@ public void testUnsetSubnetPublicGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, unsetSubnetPublicGatewayPath); + assertEquals(parsedPath, deleteClusterNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the unsetSubnetPublicGateway operation with and without retries enabled + // Test the deleteClusterNetworkInterface operation with and without retries enabled @Test - public void testUnsetSubnetPublicGatewayWRetries() throws Throwable { + public void testDeleteClusterNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUnsetSubnetPublicGatewayWOptions(); + testDeleteClusterNetworkInterfaceWOptions(); vpcService.disableRetries(); - testUnsetSubnetPublicGatewayWOptions(); + testDeleteClusterNetworkInterfaceWOptions(); } - // Test the unsetSubnetPublicGateway operation with a null options model (negative test) + // Test the deleteClusterNetworkInterface operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUnsetSubnetPublicGatewayNoOptions() throws Throwable { + public void testDeleteClusterNetworkInterfaceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.unsetSubnetPublicGateway(null).execute(); + vpcService.deleteClusterNetworkInterface(null).execute(); } - // Test the getSubnetPublicGateway operation with a valid options model parameter + // Test the getClusterNetworkInterface operation with a valid options model parameter @Test - public void testGetSubnetPublicGatewayWOptions() throws Throwable { + public void testGetClusterNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getSubnetPublicGatewayPath = "/subnets/testString/public_gateway"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getClusterNetworkInterfacePath = "/cluster_networks/testString/interfaces/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetSubnetPublicGatewayOptions model - GetSubnetPublicGatewayOptions getSubnetPublicGatewayOptionsModel = new GetSubnetPublicGatewayOptions.Builder() + // Construct an instance of the GetClusterNetworkInterfaceOptions model + GetClusterNetworkInterfaceOptions getClusterNetworkInterfaceOptionsModel = new GetClusterNetworkInterfaceOptions.Builder() + .clusterNetworkId("testString") .id("testString") .build(); - // Invoke getSubnetPublicGateway() with a valid options model and verify the result - Response response = vpcService.getSubnetPublicGateway(getSubnetPublicGatewayOptionsModel).execute(); + // Invoke getClusterNetworkInterface() with a valid options model and verify the result + Response response = vpcService.getClusterNetworkInterface(getClusterNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - PublicGateway responseObj = response.getResult(); + ClusterNetworkInterface responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -4974,110 +6054,118 @@ public void testGetSubnetPublicGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSubnetPublicGatewayPath); + assertEquals(parsedPath, getClusterNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getSubnetPublicGateway operation with and without retries enabled + // Test the getClusterNetworkInterface operation with and without retries enabled @Test - public void testGetSubnetPublicGatewayWRetries() throws Throwable { + public void testGetClusterNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSubnetPublicGatewayWOptions(); + testGetClusterNetworkInterfaceWOptions(); vpcService.disableRetries(); - testGetSubnetPublicGatewayWOptions(); + testGetClusterNetworkInterfaceWOptions(); } - // Test the getSubnetPublicGateway operation with a null options model (negative test) + // Test the getClusterNetworkInterface operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSubnetPublicGatewayNoOptions() throws Throwable { + public void testGetClusterNetworkInterfaceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSubnetPublicGateway(null).execute(); + vpcService.getClusterNetworkInterface(null).execute(); } - // Test the setSubnetPublicGateway operation with a valid options model parameter + // Test the updateClusterNetworkInterface operation with a valid options model parameter @Test - public void testSetSubnetPublicGatewayWOptions() throws Throwable { + public void testUpdateClusterNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String setSubnetPublicGatewayPath = "/subnets/testString/public_gateway"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateClusterNetworkInterfacePath = "/cluster_networks/testString/interfaces/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityById model - PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() - .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") + // Construct an instance of the ClusterNetworkInterfacePatch model + ClusterNetworkInterfacePatch clusterNetworkInterfacePatchModel = new ClusterNetworkInterfacePatch.Builder() + .autoDelete(false) + .name("my-cluster-network-interface") .build(); + Map clusterNetworkInterfacePatchModelAsPatch = clusterNetworkInterfacePatchModel.asPatch(); - // Construct an instance of the SetSubnetPublicGatewayOptions model - SetSubnetPublicGatewayOptions setSubnetPublicGatewayOptionsModel = new SetSubnetPublicGatewayOptions.Builder() + // Construct an instance of the UpdateClusterNetworkInterfaceOptions model + UpdateClusterNetworkInterfaceOptions updateClusterNetworkInterfaceOptionsModel = new UpdateClusterNetworkInterfaceOptions.Builder() + .clusterNetworkId("testString") .id("testString") - .publicGatewayIdentity(publicGatewayIdentityModel) + .clusterNetworkInterfacePatch(clusterNetworkInterfacePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke setSubnetPublicGateway() with a valid options model and verify the result - Response response = vpcService.setSubnetPublicGateway(setSubnetPublicGatewayOptionsModel).execute(); + // Invoke updateClusterNetworkInterface() with a valid options model and verify the result + Response response = vpcService.updateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - PublicGateway responseObj = response.getResult(); + ClusterNetworkInterface responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, setSubnetPublicGatewayPath); + assertEquals(parsedPath, updateClusterNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the setSubnetPublicGateway operation with and without retries enabled + // Test the updateClusterNetworkInterface operation with and without retries enabled @Test - public void testSetSubnetPublicGatewayWRetries() throws Throwable { + public void testUpdateClusterNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testSetSubnetPublicGatewayWOptions(); + testUpdateClusterNetworkInterfaceWOptions(); vpcService.disableRetries(); - testSetSubnetPublicGatewayWOptions(); + testUpdateClusterNetworkInterfaceWOptions(); } - // Test the setSubnetPublicGateway operation with a null options model (negative test) + // Test the updateClusterNetworkInterface operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testSetSubnetPublicGatewayNoOptions() throws Throwable { + public void testUpdateClusterNetworkInterfaceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.setSubnetPublicGateway(null).execute(); + vpcService.updateClusterNetworkInterface(null).execute(); } - // Test the getSubnetRoutingTable operation with a valid options model parameter + // Test the listClusterNetworkSubnets operation with a valid options model parameter @Test - public void testGetSubnetRoutingTableWOptions() throws Throwable { + public void testListClusterNetworkSubnetsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; - String getSubnetRoutingTablePath = "/subnets/testString/routing_table"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"subnets\": [{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}], \"total_count\": 132}"; + String listClusterNetworkSubnetsPath = "/cluster_networks/testString/subnets"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetSubnetRoutingTableOptions model - GetSubnetRoutingTableOptions getSubnetRoutingTableOptionsModel = new GetSubnetRoutingTableOptions.Builder() - .id("testString") + // Construct an instance of the ListClusterNetworkSubnetsOptions model + ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptionsModel = new ListClusterNetworkSubnetsOptions.Builder() + .clusterNetworkId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") .build(); - // Invoke getSubnetRoutingTable() with a valid options model and verify the result - Response response = vpcService.getSubnetRoutingTable(getSubnetRoutingTableOptionsModel).execute(); + // Invoke listClusterNetworkSubnets() with a valid options model and verify the result + Response response = vpcService.listClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModel).execute(); assertNotNull(response); - RoutingTable responseObj = response.getResult(); + ClusterNetworkSubnetCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -5086,117 +6174,189 @@ public void testGetSubnetRoutingTableWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSubnetRoutingTablePath); + assertEquals(parsedPath, listClusterNetworkSubnetsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("sort"), "name"); } - // Test the getSubnetRoutingTable operation with and without retries enabled + // Test the listClusterNetworkSubnets operation with and without retries enabled @Test - public void testGetSubnetRoutingTableWRetries() throws Throwable { + public void testListClusterNetworkSubnetsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSubnetRoutingTableWOptions(); + testListClusterNetworkSubnetsWOptions(); vpcService.disableRetries(); - testGetSubnetRoutingTableWOptions(); + testListClusterNetworkSubnetsWOptions(); } - // Test the getSubnetRoutingTable operation with a null options model (negative test) + // Test the listClusterNetworkSubnets operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSubnetRoutingTableNoOptions() throws Throwable { + public void testListClusterNetworkSubnetsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSubnetRoutingTable(null).execute(); + vpcService.listClusterNetworkSubnets(null).execute(); } - // Test the replaceSubnetRoutingTable operation with a valid options model parameter + // Test the listClusterNetworkSubnets operation using the ClusterNetworkSubnetsPager.getNext() method @Test - public void testReplaceSubnetRoutingTableWOptions() throws Throwable { + public void testListClusterNetworkSubnetsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\",\"total_ipv4_address_count\":256}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\",\"total_ipv4_address_count\":256}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptions = new ListClusterNetworkSubnetsOptions.Builder() + .clusterNetworkId("testString") + .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") + .build(); + + List allResults = new ArrayList<>(); + ClusterNetworkSubnetsPager pager = new ClusterNetworkSubnetsPager(vpcService, listClusterNetworkSubnetsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listClusterNetworkSubnets operation using the ClusterNetworkSubnetsPager.getAll() method + @Test + public void testListClusterNetworkSubnetsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\",\"total_ipv4_address_count\":256}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\",\"total_ipv4_address_count\":256}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptions = new ListClusterNetworkSubnetsOptions.Builder() + .clusterNetworkId("testString") + .limit(Long.valueOf("10")) + .name("my-name") + .sort("name") + .build(); + + ClusterNetworkSubnetsPager pager = new ClusterNetworkSubnetsPager(vpcService, listClusterNetworkSubnetsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createClusterNetworkSubnet operation with a valid options model parameter + @Test + public void testCreateClusterNetworkSubnetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; - String replaceSubnetRoutingTablePath = "/subnets/testString/routing_table"; + String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}"; + String createClusterNetworkSubnetPath = "/cluster_networks/testString/subnets"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the RoutingTableIdentityByCRN model - RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") + // Construct an instance of the ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model + ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype clusterNetworkSubnetPrototypeModel = new ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype.Builder() + .ipVersion("ipv4") + .name("my-cluster-network-subnet") + .totalIpv4AddressCount(Long.valueOf("256")) .build(); - // Construct an instance of the ReplaceSubnetRoutingTableOptions model - ReplaceSubnetRoutingTableOptions replaceSubnetRoutingTableOptionsModel = new ReplaceSubnetRoutingTableOptions.Builder() - .id("testString") - .routingTableIdentity(routingTableIdentityModel) + // Construct an instance of the CreateClusterNetworkSubnetOptions model + CreateClusterNetworkSubnetOptions createClusterNetworkSubnetOptionsModel = new CreateClusterNetworkSubnetOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetPrototype(clusterNetworkSubnetPrototypeModel) .build(); - // Invoke replaceSubnetRoutingTable() with a valid options model and verify the result - Response response = vpcService.replaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModel).execute(); + // Invoke createClusterNetworkSubnet() with a valid options model and verify the result + Response response = vpcService.createClusterNetworkSubnet(createClusterNetworkSubnetOptionsModel).execute(); assertNotNull(response); - RoutingTable responseObj = response.getResult(); + ClusterNetworkSubnet responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, replaceSubnetRoutingTablePath); + assertEquals(parsedPath, createClusterNetworkSubnetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the replaceSubnetRoutingTable operation with and without retries enabled + // Test the createClusterNetworkSubnet operation with and without retries enabled @Test - public void testReplaceSubnetRoutingTableWRetries() throws Throwable { + public void testCreateClusterNetworkSubnetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testReplaceSubnetRoutingTableWOptions(); + testCreateClusterNetworkSubnetWOptions(); vpcService.disableRetries(); - testReplaceSubnetRoutingTableWOptions(); + testCreateClusterNetworkSubnetWOptions(); } - // Test the replaceSubnetRoutingTable operation with a null options model (negative test) + // Test the createClusterNetworkSubnet operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testReplaceSubnetRoutingTableNoOptions() throws Throwable { + public void testCreateClusterNetworkSubnetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.replaceSubnetRoutingTable(null).execute(); + vpcService.createClusterNetworkSubnet(null).execute(); } - // Test the listSubnetReservedIps operation with a valid options model parameter + // Test the listClusterNetworkSubnetReservedIps operation with a valid options model parameter @Test - public void testListSubnetReservedIpsWOptions() throws Throwable { + public void testListClusterNetworkSubnetReservedIpsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"reserved_ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"total_count\": 132}"; - String listSubnetReservedIpsPath = "/subnets/testString/reserved_ips"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"reserved_ips\": [{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}], \"total_count\": 132}"; + String listClusterNetworkSubnetReservedIpsPath = "/cluster_networks/testString/subnets/testString/reserved_ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListSubnetReservedIpsOptions model - ListSubnetReservedIpsOptions listSubnetReservedIpsOptionsModel = new ListSubnetReservedIpsOptions.Builder() - .subnetId("testString") + // Construct an instance of the ListClusterNetworkSubnetReservedIpsOptions model + ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptionsModel = new ListClusterNetworkSubnetReservedIpsOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .start("testString") .limit(Long.valueOf("10")) + .name("my-name") .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); - // Invoke listSubnetReservedIps() with a valid options model and verify the result - Response response = vpcService.listSubnetReservedIps(listSubnetReservedIpsOptionsModel).execute(); + // Invoke listClusterNetworkSubnetReservedIps() with a valid options model and verify the result + Response response = vpcService.listClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModel).execute(); assertNotNull(response); - ReservedIPCollection responseObj = response.getResult(); + ClusterNetworkSubnetReservedIPCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -5205,44 +6365,41 @@ public void testListSubnetReservedIpsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSubnetReservedIpsPath); + assertEquals(parsedPath, listClusterNetworkSubnetReservedIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("name"), "my-name"); assertEquals(query.get("sort"), "name"); - assertEquals(query.get("target.id"), "testString"); - assertEquals(query.get("target.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"); - assertEquals(query.get("target.name"), "my-resource"); - assertEquals(query.get("target.resource_type"), "testString"); } - // Test the listSubnetReservedIps operation with and without retries enabled + // Test the listClusterNetworkSubnetReservedIps operation with and without retries enabled @Test - public void testListSubnetReservedIpsWRetries() throws Throwable { + public void testListClusterNetworkSubnetReservedIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSubnetReservedIpsWOptions(); + testListClusterNetworkSubnetReservedIpsWOptions(); vpcService.disableRetries(); - testListSubnetReservedIpsWOptions(); + testListClusterNetworkSubnetReservedIpsWOptions(); } - // Test the listSubnetReservedIps operation with a null options model (negative test) + // Test the listClusterNetworkSubnetReservedIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListSubnetReservedIpsNoOptions() throws Throwable { + public void testListClusterNetworkSubnetReservedIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listSubnetReservedIps(null).execute(); + vpcService.listClusterNetworkSubnetReservedIps(null).execute(); } - // Test the listSubnetReservedIps operation using the SubnetReservedIpsPager.getNext() method + // Test the listClusterNetworkSubnetReservedIps operation using the ClusterNetworkSubnetReservedIpsPager.getNext() method @Test - public void testListSubnetReservedIpsWithPagerGetNext() throws Throwable { + public void testListClusterNetworkSubnetReservedIpsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"10.1.0.6\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"cluster_network_subnet_reserved_ip\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"resource_type\":\"cluster_network_interface\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"10.1.0.6\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"cluster_network_subnet_reserved_ip\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"resource_type\":\"cluster_network_interface\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -5256,32 +6413,30 @@ public void testListSubnetReservedIpsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() - .subnetId("testString") + ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptions = new ListClusterNetworkSubnetReservedIpsOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .limit(Long.valueOf("10")) + .name("my-name") .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); - List allResults = new ArrayList<>(); - SubnetReservedIpsPager pager = new SubnetReservedIpsPager(vpcService, listSubnetReservedIpsOptions); + List allResults = new ArrayList<>(); + ClusterNetworkSubnetReservedIpsPager pager = new ClusterNetworkSubnetReservedIpsPager(vpcService, listClusterNetworkSubnetReservedIpsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listSubnetReservedIps operation using the SubnetReservedIpsPager.getAll() method + // Test the listClusterNetworkSubnetReservedIps operation using the ClusterNetworkSubnetReservedIpsPager.getAll() method @Test - public void testListSubnetReservedIpsWithPagerGetAll() throws Throwable { + public void testListClusterNetworkSubnetReservedIpsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"10.1.0.6\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"cluster_network_subnet_reserved_ip\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"resource_type\":\"cluster_network_interface\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"10.1.0.6\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"cluster_network_subnet_reserved_ip\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"resource_type\":\"cluster_network_interface\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -5295,51 +6450,43 @@ public void testListSubnetReservedIpsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() - .subnetId("testString") + ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptions = new ListClusterNetworkSubnetReservedIpsOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .limit(Long.valueOf("10")) + .name("my-name") .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); - SubnetReservedIpsPager pager = new SubnetReservedIpsPager(vpcService, listSubnetReservedIpsOptions); - List allResults = pager.getAll(); + ClusterNetworkSubnetReservedIpsPager pager = new ClusterNetworkSubnetReservedIpsPager(vpcService, listClusterNetworkSubnetReservedIpsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createSubnetReservedIp operation with a valid options model parameter + // Test the createClusterNetworkSubnetReservedIp operation with a valid options model parameter @Test - public void testCreateSubnetReservedIpWOptions() throws Throwable { + public void testCreateClusterNetworkSubnetReservedIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; - String createSubnetReservedIpPath = "/subnets/testString/reserved_ips"; + String mockResponseBody = "{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}"; + String createClusterNetworkSubnetReservedIpPath = "/cluster_networks/testString/subnets/testString/reserved_ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById model - ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById reservedIpTargetPrototypeModel = new ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.Builder() - .id("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0") - .build(); - - // Construct an instance of the CreateSubnetReservedIpOptions model - CreateSubnetReservedIpOptions createSubnetReservedIpOptionsModel = new CreateSubnetReservedIpOptions.Builder() - .subnetId("testString") + // Construct an instance of the CreateClusterNetworkSubnetReservedIpOptions model + CreateClusterNetworkSubnetReservedIpOptions createClusterNetworkSubnetReservedIpOptionsModel = new CreateClusterNetworkSubnetReservedIpOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .address("192.168.3.4") - .autoDelete(false) - .name("my-reserved-ip") - .target(reservedIpTargetPrototypeModel) + .name("my-cluster-network-subnet-reserved-ip") .build(); - // Invoke createSubnetReservedIp() with a valid options model and verify the result - Response response = vpcService.createSubnetReservedIp(createSubnetReservedIpOptionsModel).execute(); + // Invoke createClusterNetworkSubnetReservedIp() with a valid options model and verify the result + Response response = vpcService.createClusterNetworkSubnetReservedIp(createClusterNetworkSubnetReservedIpOptionsModel).execute(); assertNotNull(response); - ReservedIP responseObj = response.getResult(); + ClusterNetworkSubnetReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -5348,712 +6495,569 @@ public void testCreateSubnetReservedIpWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSubnetReservedIpPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the createSubnetReservedIp operation with and without retries enabled - @Test - public void testCreateSubnetReservedIpWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testCreateSubnetReservedIpWOptions(); - - vpcService.disableRetries(); - testCreateSubnetReservedIpWOptions(); - } - - // Test the createSubnetReservedIp operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateSubnetReservedIpNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createSubnetReservedIp(null).execute(); - } - - // Test the deleteSubnetReservedIp operation with a valid options model parameter - @Test - public void testDeleteSubnetReservedIpWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteSubnetReservedIpPath = "/subnets/testString/reserved_ips/testString"; - server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteSubnetReservedIpOptions model - DeleteSubnetReservedIpOptions deleteSubnetReservedIpOptionsModel = new DeleteSubnetReservedIpOptions.Builder() - .subnetId("testString") - .id("testString") - .build(); - - // Invoke deleteSubnetReservedIp() with a valid options model and verify the result - Response response = vpcService.deleteSubnetReservedIp(deleteSubnetReservedIpOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSubnetReservedIpPath); + assertEquals(parsedPath, createClusterNetworkSubnetReservedIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteSubnetReservedIp operation with and without retries enabled + // Test the createClusterNetworkSubnetReservedIp operation with and without retries enabled @Test - public void testDeleteSubnetReservedIpWRetries() throws Throwable { + public void testCreateClusterNetworkSubnetReservedIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSubnetReservedIpWOptions(); + testCreateClusterNetworkSubnetReservedIpWOptions(); vpcService.disableRetries(); - testDeleteSubnetReservedIpWOptions(); + testCreateClusterNetworkSubnetReservedIpWOptions(); } - // Test the deleteSubnetReservedIp operation with a null options model (negative test) + // Test the createClusterNetworkSubnetReservedIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSubnetReservedIpNoOptions() throws Throwable { + public void testCreateClusterNetworkSubnetReservedIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSubnetReservedIp(null).execute(); + vpcService.createClusterNetworkSubnetReservedIp(null).execute(); } - // Test the getSubnetReservedIp operation with a valid options model parameter + // Test the deleteClusterNetworkSubnetReservedIp operation with a valid options model parameter @Test - public void testGetSubnetReservedIpWOptions() throws Throwable { + public void testDeleteClusterNetworkSubnetReservedIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; - String getSubnetReservedIpPath = "/subnets/testString/reserved_ips/testString"; + String mockResponseBody = "{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}"; + String deleteClusterNetworkSubnetReservedIpPath = "/cluster_networks/testString/subnets/testString/reserved_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the GetSubnetReservedIpOptions model - GetSubnetReservedIpOptions getSubnetReservedIpOptionsModel = new GetSubnetReservedIpOptions.Builder() - .subnetId("testString") + // Construct an instance of the DeleteClusterNetworkSubnetReservedIpOptions model + DeleteClusterNetworkSubnetReservedIpOptions deleteClusterNetworkSubnetReservedIpOptionsModel = new DeleteClusterNetworkSubnetReservedIpOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke getSubnetReservedIp() with a valid options model and verify the result - Response response = vpcService.getSubnetReservedIp(getSubnetReservedIpOptionsModel).execute(); + // Invoke deleteClusterNetworkSubnetReservedIp() with a valid options model and verify the result + Response response = vpcService.deleteClusterNetworkSubnetReservedIp(deleteClusterNetworkSubnetReservedIpOptionsModel).execute(); assertNotNull(response); - ReservedIP responseObj = response.getResult(); + ClusterNetworkSubnetReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSubnetReservedIpPath); + assertEquals(parsedPath, deleteClusterNetworkSubnetReservedIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getSubnetReservedIp operation with and without retries enabled + // Test the deleteClusterNetworkSubnetReservedIp operation with and without retries enabled @Test - public void testGetSubnetReservedIpWRetries() throws Throwable { + public void testDeleteClusterNetworkSubnetReservedIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSubnetReservedIpWOptions(); + testDeleteClusterNetworkSubnetReservedIpWOptions(); vpcService.disableRetries(); - testGetSubnetReservedIpWOptions(); + testDeleteClusterNetworkSubnetReservedIpWOptions(); } - // Test the getSubnetReservedIp operation with a null options model (negative test) + // Test the deleteClusterNetworkSubnetReservedIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSubnetReservedIpNoOptions() throws Throwable { + public void testDeleteClusterNetworkSubnetReservedIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSubnetReservedIp(null).execute(); + vpcService.deleteClusterNetworkSubnetReservedIp(null).execute(); } - // Test the updateSubnetReservedIp operation with a valid options model parameter + // Test the getClusterNetworkSubnetReservedIp operation with a valid options model parameter @Test - public void testUpdateSubnetReservedIpWOptions() throws Throwable { + public void testGetClusterNetworkSubnetReservedIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; - String updateSubnetReservedIpPath = "/subnets/testString/reserved_ips/testString"; + String mockResponseBody = "{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}"; + String getClusterNetworkSubnetReservedIpPath = "/cluster_networks/testString/subnets/testString/reserved_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ReservedIPPatch model - ReservedIPPatch reservedIpPatchModel = new ReservedIPPatch.Builder() - .autoDelete(false) - .name("my-reserved-ip-updated") - .build(); - Map reservedIpPatchModelAsPatch = reservedIpPatchModel.asPatch(); - - // Construct an instance of the UpdateSubnetReservedIpOptions model - UpdateSubnetReservedIpOptions updateSubnetReservedIpOptionsModel = new UpdateSubnetReservedIpOptions.Builder() - .subnetId("testString") + // Construct an instance of the GetClusterNetworkSubnetReservedIpOptions model + GetClusterNetworkSubnetReservedIpOptions getClusterNetworkSubnetReservedIpOptionsModel = new GetClusterNetworkSubnetReservedIpOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") .id("testString") - .reservedIpPatch(reservedIpPatchModelAsPatch) .build(); - // Invoke updateSubnetReservedIp() with a valid options model and verify the result - Response response = vpcService.updateSubnetReservedIp(updateSubnetReservedIpOptionsModel).execute(); + // Invoke getClusterNetworkSubnetReservedIp() with a valid options model and verify the result + Response response = vpcService.getClusterNetworkSubnetReservedIp(getClusterNetworkSubnetReservedIpOptionsModel).execute(); assertNotNull(response); - ReservedIP responseObj = response.getResult(); + ClusterNetworkSubnetReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateSubnetReservedIpPath); + assertEquals(parsedPath, getClusterNetworkSubnetReservedIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateSubnetReservedIp operation with and without retries enabled + // Test the getClusterNetworkSubnetReservedIp operation with and without retries enabled @Test - public void testUpdateSubnetReservedIpWRetries() throws Throwable { + public void testGetClusterNetworkSubnetReservedIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateSubnetReservedIpWOptions(); + testGetClusterNetworkSubnetReservedIpWOptions(); vpcService.disableRetries(); - testUpdateSubnetReservedIpWOptions(); + testGetClusterNetworkSubnetReservedIpWOptions(); } - // Test the updateSubnetReservedIp operation with a null options model (negative test) + // Test the getClusterNetworkSubnetReservedIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateSubnetReservedIpNoOptions() throws Throwable { + public void testGetClusterNetworkSubnetReservedIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateSubnetReservedIp(null).execute(); + vpcService.getClusterNetworkSubnetReservedIp(null).execute(); } - // Test the listImages operation with a valid options model parameter + // Test the updateClusterNetworkSubnetReservedIp operation with a valid options model parameter @Test - public void testListImagesWOptions() throws Throwable { + public void testUpdateClusterNetworkSubnetReservedIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"images\": [{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deprecation_at\": \"2019-01-01T12:00:00.000Z\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"image\", \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_data_format\": \"cloud_init\", \"visibility\": \"private\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listImagesPath = "/images"; + String mockResponseBody = "{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}"; + String updateClusterNetworkSubnetReservedIpPath = "/cluster_networks/testString/subnets/testString/reserved_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListImagesOptions model - ListImagesOptions listImagesOptionsModel = new ListImagesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .status(java.util.Arrays.asList("available")) - .visibility("private") - .userDataFormat(java.util.Arrays.asList("cloud_init")) - .remoteAccountId("bb1b52262f7441a586f49068482f1e60") + // Construct an instance of the ClusterNetworkSubnetReservedIPPatch model + ClusterNetworkSubnetReservedIPPatch clusterNetworkSubnetReservedIpPatchModel = new ClusterNetworkSubnetReservedIPPatch.Builder() + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") .build(); + Map clusterNetworkSubnetReservedIpPatchModelAsPatch = clusterNetworkSubnetReservedIpPatchModel.asPatch(); - // Invoke listImages() with a valid options model and verify the result - Response response = vpcService.listImages(listImagesOptionsModel).execute(); + // Construct an instance of the UpdateClusterNetworkSubnetReservedIpOptions model + UpdateClusterNetworkSubnetReservedIpOptions updateClusterNetworkSubnetReservedIpOptionsModel = new UpdateClusterNetworkSubnetReservedIpOptions.Builder() + .clusterNetworkId("testString") + .clusterNetworkSubnetId("testString") + .id("testString") + .clusterNetworkSubnetReservedIpPatch(clusterNetworkSubnetReservedIpPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .build(); + + // Invoke updateClusterNetworkSubnetReservedIp() with a valid options model and verify the result + Response response = vpcService.updateClusterNetworkSubnetReservedIp(updateClusterNetworkSubnetReservedIpOptionsModel).execute(); assertNotNull(response); - ImageCollection responseObj = response.getResult(); + ClusterNetworkSubnetReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listImagesPath); + assertEquals(parsedPath, updateClusterNetworkSubnetReservedIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("status"), RequestUtils.join(java.util.Arrays.asList("available"), ",")); - assertEquals(query.get("visibility"), "private"); - assertEquals(query.get("user_data_format"), RequestUtils.join(java.util.Arrays.asList("cloud_init"), ",")); - assertEquals(query.get("remote.account.id"), "bb1b52262f7441a586f49068482f1e60"); } - // Test the listImages operation with and without retries enabled + // Test the updateClusterNetworkSubnetReservedIp operation with and without retries enabled @Test - public void testListImagesWRetries() throws Throwable { + public void testUpdateClusterNetworkSubnetReservedIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListImagesWOptions(); + testUpdateClusterNetworkSubnetReservedIpWOptions(); vpcService.disableRetries(); - testListImagesWOptions(); + testUpdateClusterNetworkSubnetReservedIpWOptions(); } - // Test the listImages operation using the ImagesPager.getNext() method - @Test - public void testListImagesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deprecation_at\":\"2019-01-01T12:00:00.000Z\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"}},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"image\",\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_data_format\":\"cloud_init\",\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deprecation_at\":\"2019-01-01T12:00:00.000Z\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"}},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"image\",\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_data_format\":\"cloud_init\",\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .status(java.util.Arrays.asList("available")) - .visibility("private") - .userDataFormat(java.util.Arrays.asList("cloud_init")) - .remoteAccountId("bb1b52262f7441a586f49068482f1e60") - .build(); - - List allResults = new ArrayList<>(); - ImagesPager pager = new ImagesPager(vpcService, listImagesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Test the updateClusterNetworkSubnetReservedIp operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateClusterNetworkSubnetReservedIpNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateClusterNetworkSubnetReservedIp(null).execute(); } - - // Test the listImages operation using the ImagesPager.getAll() method - @Test - public void testListImagesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deprecation_at\":\"2019-01-01T12:00:00.000Z\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"}},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"image\",\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_data_format\":\"cloud_init\",\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"images\":[{\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deprecation_at\":\"2019-01-01T12:00:00.000Z\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"}},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"image\",\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_data_format\":\"cloud_init\",\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .status(java.util.Arrays.asList("available")) - .visibility("private") - .userDataFormat(java.util.Arrays.asList("cloud_init")) - .remoteAccountId("bb1b52262f7441a586f49068482f1e60") - .build(); - ImagesPager pager = new ImagesPager(vpcService, listImagesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createImage operation with a valid options model parameter + // Test the deleteClusterNetworkSubnet operation with a valid options model parameter @Test - public void testCreateImageWOptions() throws Throwable { + public void testDeleteClusterNetworkSubnetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deprecation_at\": \"2019-01-01T12:00:00.000Z\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"image\", \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_data_format\": \"cloud_init\", \"visibility\": \"private\"}"; - String createImagePath = "/images"; + String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}"; + String deleteClusterNetworkSubnetPath = "/cluster_networks/testString/subnets/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the EncryptionKeyIdentityByCRN model - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - // Construct an instance of the ImageFilePrototype model - ImageFilePrototype imageFilePrototypeModel = new ImageFilePrototype.Builder() - .href("cos://us-south/my-bucket/my-image.qcow2") - .build(); - - // Construct an instance of the OperatingSystemIdentityByName model - OperatingSystemIdentityByName operatingSystemIdentityModel = new OperatingSystemIdentityByName.Builder() - .name("debian-9-amd64") - .build(); - - // Construct an instance of the ImagePrototypeImageByFile model - ImagePrototypeImageByFile imagePrototypeModel = new ImagePrototypeImageByFile.Builder() - .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .name("my-image") - .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resourceGroup(resourceGroupIdentityModel) - .encryptedDataKey("testString") - .encryptionKey(encryptionKeyIdentityModel) - .file(imageFilePrototypeModel) - .operatingSystem(operatingSystemIdentityModel) - .build(); - - // Construct an instance of the CreateImageOptions model - CreateImageOptions createImageOptionsModel = new CreateImageOptions.Builder() - .imagePrototype(imagePrototypeModel) + // Construct an instance of the DeleteClusterNetworkSubnetOptions model + DeleteClusterNetworkSubnetOptions deleteClusterNetworkSubnetOptionsModel = new DeleteClusterNetworkSubnetOptions.Builder() + .clusterNetworkId("testString") + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke createImage() with a valid options model and verify the result - Response response = vpcService.createImage(createImageOptionsModel).execute(); + // Invoke deleteClusterNetworkSubnet() with a valid options model and verify the result + Response response = vpcService.deleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModel).execute(); assertNotNull(response); - Image responseObj = response.getResult(); + ClusterNetworkSubnet responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createImagePath); + assertEquals(parsedPath, deleteClusterNetworkSubnetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createImage operation with and without retries enabled + // Test the deleteClusterNetworkSubnet operation with and without retries enabled @Test - public void testCreateImageWRetries() throws Throwable { + public void testDeleteClusterNetworkSubnetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateImageWOptions(); + testDeleteClusterNetworkSubnetWOptions(); vpcService.disableRetries(); - testCreateImageWOptions(); + testDeleteClusterNetworkSubnetWOptions(); } - // Test the createImage operation with a null options model (negative test) + // Test the deleteClusterNetworkSubnet operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateImageNoOptions() throws Throwable { + public void testDeleteClusterNetworkSubnetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createImage(null).execute(); + vpcService.deleteClusterNetworkSubnet(null).execute(); } - // Test the deleteImage operation with a valid options model parameter + // Test the getClusterNetworkSubnet operation with a valid options model parameter @Test - public void testDeleteImageWOptions() throws Throwable { + public void testGetClusterNetworkSubnetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteImagePath = "/images/testString"; + String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}"; + String getClusterNetworkSubnetPath = "/cluster_networks/testString/subnets/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteImageOptions model - DeleteImageOptions deleteImageOptionsModel = new DeleteImageOptions.Builder() + // Construct an instance of the GetClusterNetworkSubnetOptions model + GetClusterNetworkSubnetOptions getClusterNetworkSubnetOptionsModel = new GetClusterNetworkSubnetOptions.Builder() + .clusterNetworkId("testString") .id("testString") .build(); - // Invoke deleteImage() with a valid options model and verify the result - Response response = vpcService.deleteImage(deleteImageOptionsModel).execute(); + // Invoke getClusterNetworkSubnet() with a valid options model and verify the result + Response response = vpcService.getClusterNetworkSubnet(getClusterNetworkSubnetOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ClusterNetworkSubnet responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteImagePath); + assertEquals(parsedPath, getClusterNetworkSubnetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteImage operation with and without retries enabled + // Test the getClusterNetworkSubnet operation with and without retries enabled @Test - public void testDeleteImageWRetries() throws Throwable { + public void testGetClusterNetworkSubnetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteImageWOptions(); + testGetClusterNetworkSubnetWOptions(); vpcService.disableRetries(); - testDeleteImageWOptions(); + testGetClusterNetworkSubnetWOptions(); } - // Test the deleteImage operation with a null options model (negative test) + // Test the getClusterNetworkSubnet operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteImageNoOptions() throws Throwable { + public void testGetClusterNetworkSubnetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteImage(null).execute(); + vpcService.getClusterNetworkSubnet(null).execute(); } - // Test the getImage operation with a valid options model parameter + // Test the updateClusterNetworkSubnet operation with a valid options model parameter @Test - public void testGetImageWOptions() throws Throwable { + public void testUpdateClusterNetworkSubnetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deprecation_at\": \"2019-01-01T12:00:00.000Z\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"image\", \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_data_format\": \"cloud_init\", \"visibility\": \"private\"}"; - String getImagePath = "/images/testString"; + String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}"; + String updateClusterNetworkSubnetPath = "/cluster_networks/testString/subnets/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetImageOptions model - GetImageOptions getImageOptionsModel = new GetImageOptions.Builder() + // Construct an instance of the ClusterNetworkSubnetPatch model + ClusterNetworkSubnetPatch clusterNetworkSubnetPatchModel = new ClusterNetworkSubnetPatch.Builder() + .name("my-cluster-network-subnet") + .build(); + Map clusterNetworkSubnetPatchModelAsPatch = clusterNetworkSubnetPatchModel.asPatch(); + + // Construct an instance of the UpdateClusterNetworkSubnetOptions model + UpdateClusterNetworkSubnetOptions updateClusterNetworkSubnetOptionsModel = new UpdateClusterNetworkSubnetOptions.Builder() + .clusterNetworkId("testString") .id("testString") + .clusterNetworkSubnetPatch(clusterNetworkSubnetPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke getImage() with a valid options model and verify the result - Response response = vpcService.getImage(getImageOptionsModel).execute(); + // Invoke updateClusterNetworkSubnet() with a valid options model and verify the result + Response response = vpcService.updateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModel).execute(); assertNotNull(response); - Image responseObj = response.getResult(); + ClusterNetworkSubnet responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getImagePath); + assertEquals(parsedPath, updateClusterNetworkSubnetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getImage operation with and without retries enabled + // Test the updateClusterNetworkSubnet operation with and without retries enabled @Test - public void testGetImageWRetries() throws Throwable { + public void testUpdateClusterNetworkSubnetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetImageWOptions(); + testUpdateClusterNetworkSubnetWOptions(); vpcService.disableRetries(); - testGetImageWOptions(); + testUpdateClusterNetworkSubnetWOptions(); } - // Test the getImage operation with a null options model (negative test) + // Test the updateClusterNetworkSubnet operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetImageNoOptions() throws Throwable { + public void testUpdateClusterNetworkSubnetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getImage(null).execute(); + vpcService.updateClusterNetworkSubnet(null).execute(); } - // Test the updateImage operation with a valid options model parameter + // Test the deleteClusterNetwork operation with a valid options model parameter @Test - public void testUpdateImageWOptions() throws Throwable { + public void testDeleteClusterNetworkWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deprecation_at\": \"2019-01-01T12:00:00.000Z\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"image\", \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_data_format\": \"cloud_init\", \"visibility\": \"private\"}"; - String updateImagePath = "/images/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String deleteClusterNetworkPath = "/cluster_networks/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the ImagePatch model - ImagePatch imagePatchModel = new ImagePatch.Builder() - .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .name("my-image") - .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .build(); - Map imagePatchModelAsPatch = imagePatchModel.asPatch(); - - // Construct an instance of the UpdateImageOptions model - UpdateImageOptions updateImageOptionsModel = new UpdateImageOptions.Builder() + // Construct an instance of the DeleteClusterNetworkOptions model + DeleteClusterNetworkOptions deleteClusterNetworkOptionsModel = new DeleteClusterNetworkOptions.Builder() .id("testString") - .imagePatch(imagePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateImage() with a valid options model and verify the result - Response response = vpcService.updateImage(updateImageOptionsModel).execute(); + // Invoke deleteClusterNetwork() with a valid options model and verify the result + Response response = vpcService.deleteClusterNetwork(deleteClusterNetworkOptionsModel).execute(); assertNotNull(response); - Image responseObj = response.getResult(); + ClusterNetwork responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateImagePath); + assertEquals(parsedPath, deleteClusterNetworkPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateImage operation with and without retries enabled + // Test the deleteClusterNetwork operation with and without retries enabled @Test - public void testUpdateImageWRetries() throws Throwable { + public void testDeleteClusterNetworkWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateImageWOptions(); + testDeleteClusterNetworkWOptions(); vpcService.disableRetries(); - testUpdateImageWOptions(); + testDeleteClusterNetworkWOptions(); } - // Test the updateImage operation with a null options model (negative test) + // Test the deleteClusterNetwork operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateImageNoOptions() throws Throwable { + public void testDeleteClusterNetworkNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateImage(null).execute(); + vpcService.deleteClusterNetwork(null).execute(); } - // Test the deprecateImage operation with a valid options model parameter + // Test the getClusterNetwork operation with a valid options model parameter @Test - public void testDeprecateImageWOptions() throws Throwable { + public void testGetClusterNetworkWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deprecateImagePath = "/images/testString/deprecate"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getClusterNetworkPath = "/cluster_networks/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeprecateImageOptions model - DeprecateImageOptions deprecateImageOptionsModel = new DeprecateImageOptions.Builder() + // Construct an instance of the GetClusterNetworkOptions model + GetClusterNetworkOptions getClusterNetworkOptionsModel = new GetClusterNetworkOptions.Builder() .id("testString") .build(); - // Invoke deprecateImage() with a valid options model and verify the result - Response response = vpcService.deprecateImage(deprecateImageOptionsModel).execute(); + // Invoke getClusterNetwork() with a valid options model and verify the result + Response response = vpcService.getClusterNetwork(getClusterNetworkOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ClusterNetwork responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deprecateImagePath); + assertEquals(parsedPath, getClusterNetworkPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deprecateImage operation with and without retries enabled + // Test the getClusterNetwork operation with and without retries enabled @Test - public void testDeprecateImageWRetries() throws Throwable { + public void testGetClusterNetworkWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeprecateImageWOptions(); + testGetClusterNetworkWOptions(); vpcService.disableRetries(); - testDeprecateImageWOptions(); + testGetClusterNetworkWOptions(); } - // Test the deprecateImage operation with a null options model (negative test) + // Test the getClusterNetwork operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeprecateImageNoOptions() throws Throwable { + public void testGetClusterNetworkNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deprecateImage(null).execute(); + vpcService.getClusterNetwork(null).execute(); } - // Test the obsoleteImage operation with a valid options model parameter + // Test the updateClusterNetwork operation with a valid options model parameter @Test - public void testObsoleteImageWOptions() throws Throwable { + public void testUpdateClusterNetworkWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String obsoleteImagePath = "/images/testString/obsolete"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateClusterNetworkPath = "/cluster_networks/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ObsoleteImageOptions model - ObsoleteImageOptions obsoleteImageOptionsModel = new ObsoleteImageOptions.Builder() + // Construct an instance of the ClusterNetworkPatch model + ClusterNetworkPatch clusterNetworkPatchModel = new ClusterNetworkPatch.Builder() + .name("my-cluster-network") + .build(); + Map clusterNetworkPatchModelAsPatch = clusterNetworkPatchModel.asPatch(); + + // Construct an instance of the UpdateClusterNetworkOptions model + UpdateClusterNetworkOptions updateClusterNetworkOptionsModel = new UpdateClusterNetworkOptions.Builder() .id("testString") + .clusterNetworkPatch(clusterNetworkPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke obsoleteImage() with a valid options model and verify the result - Response response = vpcService.obsoleteImage(obsoleteImageOptionsModel).execute(); + // Invoke updateClusterNetwork() with a valid options model and verify the result + Response response = vpcService.updateClusterNetwork(updateClusterNetworkOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ClusterNetwork responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, obsoleteImagePath); + assertEquals(parsedPath, updateClusterNetworkPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the obsoleteImage operation with and without retries enabled + // Test the updateClusterNetwork operation with and without retries enabled @Test - public void testObsoleteImageWRetries() throws Throwable { + public void testUpdateClusterNetworkWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testObsoleteImageWOptions(); + testUpdateClusterNetworkWOptions(); vpcService.disableRetries(); - testObsoleteImageWOptions(); + testUpdateClusterNetworkWOptions(); } - // Test the obsoleteImage operation with a null options model (negative test) + // Test the updateClusterNetwork operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testObsoleteImageNoOptions() throws Throwable { + public void testUpdateClusterNetworkNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.obsoleteImage(null).execute(); + vpcService.updateClusterNetwork(null).execute(); } - // Test the listImageExportJobs operation with a valid options model parameter + // Test the listDedicatedHostGroups operation with a valid options model parameter @Test - public void testListImageExportJobsWOptions() throws Throwable { + public void testListDedicatedHostGroupsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"export_jobs\": [{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encrypted_data_key\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"format\": \"qcow2\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"id\": \"r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"name\": \"my-image-export-job\", \"resource_type\": \"image_export_job\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_access_storage_bucket\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq\"}], \"storage_bucket\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\", \"name\": \"bucket-27200-lwx4cfvcue\"}, \"storage_href\": \"cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2\", \"storage_object\": {\"name\": \"my-object\"}}]}"; - String listImageExportJobsPath = "/images/testString/export_jobs"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"groups\": [{\"class\": \"bx2\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"dedicated_hosts\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host_group\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listDedicatedHostGroupsPath = "/dedicated_host/groups"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListImageExportJobsOptions model - ListImageExportJobsOptions listImageExportJobsOptionsModel = new ListImageExportJobsOptions.Builder() - .imageId("testString") + // Construct an instance of the ListDedicatedHostGroupsOptions model + ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptionsModel = new ListDedicatedHostGroupsOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("us-south-1") .name("my-name") .build(); - // Invoke listImageExportJobs() with a valid options model and verify the result - Response response = vpcService.listImageExportJobs(listImageExportJobsOptionsModel).execute(); + // Invoke listDedicatedHostGroups() with a valid options model and verify the result + Response response = vpcService.listDedicatedHostGroups(listDedicatedHostGroupsOptionsModel).execute(); assertNotNull(response); - ImageExportJobUnpaginatedCollection responseObj = response.getResult(); + DedicatedHostGroupCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6062,60 +7066,131 @@ public void testListImageExportJobsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listImageExportJobsPath); + assertEquals(parsedPath, listDedicatedHostGroupsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); assertEquals(query.get("name"), "my-name"); } - // Test the listImageExportJobs operation with and without retries enabled + // Test the listDedicatedHostGroups operation with and without retries enabled @Test - public void testListImageExportJobsWRetries() throws Throwable { + public void testListDedicatedHostGroupsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListImageExportJobsWOptions(); + testListDedicatedHostGroupsWOptions(); + + vpcService.disableRetries(); + testListDedicatedHostGroupsWOptions(); + } + + // Test the listDedicatedHostGroups operation using the DedicatedHostGroupsPager.getNext() method + @Test + public void testListDedicatedHostGroupsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"bx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"bx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("us-south-1") + .name("my-name") + .build(); + + List allResults = new ArrayList<>(); + DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(vpcService, listDedicatedHostGroupsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listDedicatedHostGroups operation using the DedicatedHostGroupsPager.getAll() method + @Test + public void testListDedicatedHostGroupsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"bx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"bx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testListImageExportJobsWOptions(); - } + ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .zoneName("us-south-1") + .name("my-name") + .build(); - // Test the listImageExportJobs operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListImageExportJobsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listImageExportJobs(null).execute(); + DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(vpcService, listDedicatedHostGroupsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the createImageExportJob operation with a valid options model parameter + + // Test the createDedicatedHostGroup operation with a valid options model parameter @Test - public void testCreateImageExportJobWOptions() throws Throwable { + public void testCreateDedicatedHostGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encrypted_data_key\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"format\": \"qcow2\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"id\": \"r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"name\": \"my-image-export-job\", \"resource_type\": \"image_export_job\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_access_storage_bucket\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq\"}], \"storage_bucket\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\", \"name\": \"bucket-27200-lwx4cfvcue\"}, \"storage_href\": \"cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2\", \"storage_object\": {\"name\": \"my-object\"}}"; - String createImageExportJobPath = "/images/testString/export_jobs"; + String mockResponseBody = "{\"class\": \"bx2\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"dedicated_hosts\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host_group\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createDedicatedHostGroupPath = "/dedicated_host/groups"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model - CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName cloudObjectStorageBucketIdentityModel = new CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() - .name("bucket-27200-lwx4cfvcue") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Construct an instance of the CreateImageExportJobOptions model - CreateImageExportJobOptions createImageExportJobOptionsModel = new CreateImageExportJobOptions.Builder() - .imageId("testString") - .storageBucket(cloudObjectStorageBucketIdentityModel) - .format("qcow2") - .name("my-image-export") + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Invoke createImageExportJob() with a valid options model and verify the result - Response response = vpcService.createImageExportJob(createImageExportJobOptionsModel).execute(); + // Construct an instance of the CreateDedicatedHostGroupOptions model + CreateDedicatedHostGroupOptions createDedicatedHostGroupOptionsModel = new CreateDedicatedHostGroupOptions.Builder() + .xClass("mx2") + .family("balanced") + .zone(zoneIdentityModel) + .name("testString") + .resourceGroup(resourceGroupIdentityModel) + .build(); + + // Invoke createDedicatedHostGroup() with a valid options model and verify the result + Response response = vpcService.createDedicatedHostGroup(createDedicatedHostGroupOptionsModel).execute(); assertNotNull(response); - ImageExportJob responseObj = response.getResult(); + DedicatedHostGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6124,49 +7199,48 @@ public void testCreateImageExportJobWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createImageExportJobPath); + assertEquals(parsedPath, createDedicatedHostGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createImageExportJob operation with and without retries enabled + // Test the createDedicatedHostGroup operation with and without retries enabled @Test - public void testCreateImageExportJobWRetries() throws Throwable { + public void testCreateDedicatedHostGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateImageExportJobWOptions(); + testCreateDedicatedHostGroupWOptions(); vpcService.disableRetries(); - testCreateImageExportJobWOptions(); + testCreateDedicatedHostGroupWOptions(); } - // Test the createImageExportJob operation with a null options model (negative test) + // Test the createDedicatedHostGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateImageExportJobNoOptions() throws Throwable { + public void testCreateDedicatedHostGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createImageExportJob(null).execute(); + vpcService.createDedicatedHostGroup(null).execute(); } - // Test the deleteImageExportJob operation with a valid options model parameter + // Test the deleteDedicatedHostGroup operation with a valid options model parameter @Test - public void testDeleteImageExportJobWOptions() throws Throwable { + public void testDeleteDedicatedHostGroupWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteImageExportJobPath = "/images/testString/export_jobs/testString"; + String deleteDedicatedHostGroupPath = "/dedicated_host/groups/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteImageExportJobOptions model - DeleteImageExportJobOptions deleteImageExportJobOptionsModel = new DeleteImageExportJobOptions.Builder() - .imageId("testString") + // Construct an instance of the DeleteDedicatedHostGroupOptions model + DeleteDedicatedHostGroupOptions deleteDedicatedHostGroupOptionsModel = new DeleteDedicatedHostGroupOptions.Builder() .id("testString") .build(); - // Invoke deleteImageExportJob() with a valid options model and verify the result - Response response = vpcService.deleteImageExportJob(deleteImageExportJobOptionsModel).execute(); + // Invoke deleteDedicatedHostGroup() with a valid options model and verify the result + Response response = vpcService.deleteDedicatedHostGroup(deleteDedicatedHostGroupOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -6177,52 +7251,51 @@ public void testDeleteImageExportJobWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteImageExportJobPath); + assertEquals(parsedPath, deleteDedicatedHostGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteImageExportJob operation with and without retries enabled + // Test the deleteDedicatedHostGroup operation with and without retries enabled @Test - public void testDeleteImageExportJobWRetries() throws Throwable { + public void testDeleteDedicatedHostGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteImageExportJobWOptions(); + testDeleteDedicatedHostGroupWOptions(); vpcService.disableRetries(); - testDeleteImageExportJobWOptions(); + testDeleteDedicatedHostGroupWOptions(); } - // Test the deleteImageExportJob operation with a null options model (negative test) + // Test the deleteDedicatedHostGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteImageExportJobNoOptions() throws Throwable { + public void testDeleteDedicatedHostGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteImageExportJob(null).execute(); + vpcService.deleteDedicatedHostGroup(null).execute(); } - // Test the getImageExportJob operation with a valid options model parameter + // Test the getDedicatedHostGroup operation with a valid options model parameter @Test - public void testGetImageExportJobWOptions() throws Throwable { + public void testGetDedicatedHostGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encrypted_data_key\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"format\": \"qcow2\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"id\": \"r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"name\": \"my-image-export-job\", \"resource_type\": \"image_export_job\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_access_storage_bucket\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq\"}], \"storage_bucket\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\", \"name\": \"bucket-27200-lwx4cfvcue\"}, \"storage_href\": \"cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2\", \"storage_object\": {\"name\": \"my-object\"}}"; - String getImageExportJobPath = "/images/testString/export_jobs/testString"; + String mockResponseBody = "{\"class\": \"bx2\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"dedicated_hosts\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host_group\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getDedicatedHostGroupPath = "/dedicated_host/groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetImageExportJobOptions model - GetImageExportJobOptions getImageExportJobOptionsModel = new GetImageExportJobOptions.Builder() - .imageId("testString") + // Construct an instance of the GetDedicatedHostGroupOptions model + GetDedicatedHostGroupOptions getDedicatedHostGroupOptionsModel = new GetDedicatedHostGroupOptions.Builder() .id("testString") .build(); - // Invoke getImageExportJob() with a valid options model and verify the result - Response response = vpcService.getImageExportJob(getImageExportJobOptionsModel).execute(); + // Invoke getDedicatedHostGroup() with a valid options model and verify the result + Response response = vpcService.getDedicatedHostGroup(getDedicatedHostGroupOptionsModel).execute(); assertNotNull(response); - ImageExportJob responseObj = response.getResult(); + DedicatedHostGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6231,59 +7304,58 @@ public void testGetImageExportJobWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getImageExportJobPath); + assertEquals(parsedPath, getDedicatedHostGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getImageExportJob operation with and without retries enabled + // Test the getDedicatedHostGroup operation with and without retries enabled @Test - public void testGetImageExportJobWRetries() throws Throwable { + public void testGetDedicatedHostGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetImageExportJobWOptions(); + testGetDedicatedHostGroupWOptions(); vpcService.disableRetries(); - testGetImageExportJobWOptions(); + testGetDedicatedHostGroupWOptions(); } - // Test the getImageExportJob operation with a null options model (negative test) + // Test the getDedicatedHostGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetImageExportJobNoOptions() throws Throwable { + public void testGetDedicatedHostGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getImageExportJob(null).execute(); + vpcService.getDedicatedHostGroup(null).execute(); } - // Test the updateImageExportJob operation with a valid options model parameter + // Test the updateDedicatedHostGroup operation with a valid options model parameter @Test - public void testUpdateImageExportJobWOptions() throws Throwable { + public void testUpdateDedicatedHostGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encrypted_data_key\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"format\": \"qcow2\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"id\": \"r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"name\": \"my-image-export-job\", \"resource_type\": \"image_export_job\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_access_storage_bucket\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq\"}], \"storage_bucket\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\", \"name\": \"bucket-27200-lwx4cfvcue\"}, \"storage_href\": \"cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2\", \"storage_object\": {\"name\": \"my-object\"}}"; - String updateImageExportJobPath = "/images/testString/export_jobs/testString"; + String mockResponseBody = "{\"class\": \"bx2\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"dedicated_hosts\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host_group\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateDedicatedHostGroupPath = "/dedicated_host/groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ImageExportJobPatch model - ImageExportJobPatch imageExportJobPatchModel = new ImageExportJobPatch.Builder() - .name("my-image-export-job-updated") + // Construct an instance of the DedicatedHostGroupPatch model + DedicatedHostGroupPatch dedicatedHostGroupPatchModel = new DedicatedHostGroupPatch.Builder() + .name("my-dedicated-host-group-updated") .build(); - Map imageExportJobPatchModelAsPatch = imageExportJobPatchModel.asPatch(); + Map dedicatedHostGroupPatchModelAsPatch = dedicatedHostGroupPatchModel.asPatch(); - // Construct an instance of the UpdateImageExportJobOptions model - UpdateImageExportJobOptions updateImageExportJobOptionsModel = new UpdateImageExportJobOptions.Builder() - .imageId("testString") + // Construct an instance of the UpdateDedicatedHostGroupOptions model + UpdateDedicatedHostGroupOptions updateDedicatedHostGroupOptionsModel = new UpdateDedicatedHostGroupOptions.Builder() .id("testString") - .imageExportJobPatch(imageExportJobPatchModelAsPatch) + .dedicatedHostGroupPatch(dedicatedHostGroupPatchModelAsPatch) .build(); - // Invoke updateImageExportJob() with a valid options model and verify the result - Response response = vpcService.updateImageExportJob(updateImageExportJobOptionsModel).execute(); + // Invoke updateDedicatedHostGroup() with a valid options model and verify the result + Response response = vpcService.updateDedicatedHostGroup(updateDedicatedHostGroupOptionsModel).execute(); assertNotNull(response); - ImageExportJob responseObj = response.getResult(); + DedicatedHostGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6292,52 +7364,52 @@ public void testUpdateImageExportJobWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateImageExportJobPath); + assertEquals(parsedPath, updateDedicatedHostGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateImageExportJob operation with and without retries enabled + // Test the updateDedicatedHostGroup operation with and without retries enabled @Test - public void testUpdateImageExportJobWRetries() throws Throwable { + public void testUpdateDedicatedHostGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateImageExportJobWOptions(); + testUpdateDedicatedHostGroupWOptions(); vpcService.disableRetries(); - testUpdateImageExportJobWOptions(); + testUpdateDedicatedHostGroupWOptions(); } - // Test the updateImageExportJob operation with a null options model (negative test) + // Test the updateDedicatedHostGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateImageExportJobNoOptions() throws Throwable { + public void testUpdateDedicatedHostGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateImageExportJob(null).execute(); + vpcService.updateDedicatedHostGroup(null).execute(); } - // Test the listOperatingSystems operation with a valid options model parameter + // Test the listDedicatedHostProfiles operation with a valid options model parameter @Test - public void testListOperatingSystemsWOptions() throws Throwable { + public void testListDedicatedHostProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"operating_systems\": [{\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}], \"total_count\": 132}"; - String listOperatingSystemsPath = "/operating_systems"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"class\": \"bx2\", \"disks\": [{\"interface_type\": {\"type\": \"fixed\", \"value\": \"nvme\"}, \"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 3200}, \"supported_instance_interface_types\": {\"type\": \"fixed\", \"value\": [\"nvme\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"mx2-host-152x1216\", \"socket_count\": {\"type\": \"fixed\", \"value\": 2}, \"status\": \"current\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"vcpu_count\": {\"type\": \"fixed\", \"value\": 16}, \"vcpu_manufacturer\": {\"type\": \"fixed\", \"value\": \"intel\"}}], \"total_count\": 132}"; + String listDedicatedHostProfilesPath = "/dedicated_host/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListOperatingSystemsOptions model - ListOperatingSystemsOptions listOperatingSystemsOptionsModel = new ListOperatingSystemsOptions.Builder() + // Construct an instance of the ListDedicatedHostProfilesOptions model + ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptionsModel = new ListDedicatedHostProfilesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .build(); - // Invoke listOperatingSystems() with a valid options model and verify the result - Response response = vpcService.listOperatingSystems(listOperatingSystemsOptionsModel).execute(); + // Invoke listDedicatedHostProfiles() with a valid options model and verify the result + Response response = vpcService.listDedicatedHostProfiles(listDedicatedHostProfilesOptionsModel).execute(); assertNotNull(response); - OperatingSystemCollection responseObj = response.getResult(); + DedicatedHostProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6346,32 +7418,32 @@ public void testListOperatingSystemsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listOperatingSystemsPath); + assertEquals(parsedPath, listDedicatedHostProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listOperatingSystems operation with and without retries enabled + // Test the listDedicatedHostProfiles operation with and without retries enabled @Test - public void testListOperatingSystemsWRetries() throws Throwable { + public void testListDedicatedHostProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListOperatingSystemsWOptions(); + testListDedicatedHostProfilesWOptions(); vpcService.disableRetries(); - testListOperatingSystemsWOptions(); + testListDedicatedHostProfilesWOptions(); } - // Test the listOperatingSystems operation using the OperatingSystemsPager.getNext() method + // Test the listDedicatedHostProfiles operation using the DedicatedHostProfilesPager.getNext() method @Test - public void testListOperatingSystemsWithPagerGetNext() throws Throwable { + public void testListDedicatedHostProfilesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"operating_systems\":[{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"operating_systems\":[{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"bx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"status\":\"current\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16},\"vcpu_manufacturer\":{\"type\":\"fixed\",\"value\":\"intel\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"bx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"status\":\"current\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16},\"vcpu_manufacturer\":{\"type\":\"fixed\",\"value\":\"intel\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -6385,26 +7457,26 @@ public void testListOperatingSystemsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() + ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() .limit(Long.valueOf("10")) .build(); - List allResults = new ArrayList<>(); - OperatingSystemsPager pager = new OperatingSystemsPager(vpcService, listOperatingSystemsOptions); + List allResults = new ArrayList<>(); + DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(vpcService, listDedicatedHostProfilesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listOperatingSystems operation using the OperatingSystemsPager.getAll() method + // Test the listDedicatedHostProfiles operation using the DedicatedHostProfilesPager.getAll() method @Test - public void testListOperatingSystemsWithPagerGetAll() throws Throwable { + public void testListDedicatedHostProfilesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"operating_systems\":[{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"operating_systems\":[{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"bx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"status\":\"current\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16},\"vcpu_manufacturer\":{\"type\":\"fixed\",\"value\":\"intel\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"bx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"status\":\"current\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16},\"vcpu_manufacturer\":{\"type\":\"fixed\",\"value\":\"intel\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -6418,36 +7490,36 @@ public void testListOperatingSystemsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() + ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() .limit(Long.valueOf("10")) .build(); - OperatingSystemsPager pager = new OperatingSystemsPager(vpcService, listOperatingSystemsOptions); - List allResults = pager.getAll(); + DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(vpcService, listDedicatedHostProfilesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the getOperatingSystem operation with a valid options model parameter + // Test the getDedicatedHostProfile operation with a valid options model parameter @Test - public void testGetOperatingSystemWOptions() throws Throwable { + public void testGetDedicatedHostProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}"; - String getOperatingSystemPath = "/operating_systems/red-7-amd64"; + String mockResponseBody = "{\"class\": \"bx2\", \"disks\": [{\"interface_type\": {\"type\": \"fixed\", \"value\": \"nvme\"}, \"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 3200}, \"supported_instance_interface_types\": {\"type\": \"fixed\", \"value\": [\"nvme\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"mx2-host-152x1216\", \"socket_count\": {\"type\": \"fixed\", \"value\": 2}, \"status\": \"current\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"vcpu_count\": {\"type\": \"fixed\", \"value\": 16}, \"vcpu_manufacturer\": {\"type\": \"fixed\", \"value\": \"intel\"}}"; + String getDedicatedHostProfilePath = "/dedicated_host/profiles/mx2-host-152x1216"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetOperatingSystemOptions model - GetOperatingSystemOptions getOperatingSystemOptionsModel = new GetOperatingSystemOptions.Builder() - .name("red-7-amd64") + // Construct an instance of the GetDedicatedHostProfileOptions model + GetDedicatedHostProfileOptions getDedicatedHostProfileOptionsModel = new GetDedicatedHostProfileOptions.Builder() + .name("mx2-host-152x1216") .build(); - // Invoke getOperatingSystem() with a valid options model and verify the result - Response response = vpcService.getOperatingSystem(getOperatingSystemOptionsModel).execute(); + // Invoke getDedicatedHostProfile() with a valid options model and verify the result + Response response = vpcService.getDedicatedHostProfile(getDedicatedHostProfileOptionsModel).execute(); assertNotNull(response); - OperatingSystem responseObj = response.getResult(); + DedicatedHostProfile responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6456,53 +7528,56 @@ public void testGetOperatingSystemWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getOperatingSystemPath); + assertEquals(parsedPath, getDedicatedHostProfilePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getOperatingSystem operation with and without retries enabled + // Test the getDedicatedHostProfile operation with and without retries enabled @Test - public void testGetOperatingSystemWRetries() throws Throwable { + public void testGetDedicatedHostProfileWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetOperatingSystemWOptions(); + testGetDedicatedHostProfileWOptions(); vpcService.disableRetries(); - testGetOperatingSystemWOptions(); + testGetDedicatedHostProfileWOptions(); } - // Test the getOperatingSystem operation with a null options model (negative test) + // Test the getDedicatedHostProfile operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetOperatingSystemNoOptions() throws Throwable { + public void testGetDedicatedHostProfileNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getOperatingSystem(null).execute(); + vpcService.getDedicatedHostProfile(null).execute(); } - // Test the listKeys operation with a valid options model parameter + // Test the listDedicatedHosts operation with a valid options model parameter @Test - public void testListKeysWOptions() throws Throwable { + public void testListDedicatedHostsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"keys\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"length\": 2048, \"name\": \"my-key-1\", \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"type\": \"ed25519\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listKeysPath = "/keys"; + String mockResponseBody = "{\"dedicated_hosts\": [{\"available_memory\": 128, \"available_vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}], \"group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"instance_placement_enabled\": true, \"instances\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}], \"lifecycle_state\": \"stable\", \"memory\": 128, \"name\": \"my-host\", \"numa\": {\"count\": 2, \"nodes\": [{\"available_vcpu\": 24, \"vcpu\": 56}]}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"mx2-host-152x1216\"}, \"provisionable\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host\", \"socket_count\": 4, \"state\": \"available\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listDedicatedHostsPath = "/dedicated_hosts"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListKeysOptions model - ListKeysOptions listKeysOptionsModel = new ListKeysOptions.Builder() + // Construct an instance of the ListDedicatedHostsOptions model + ListDedicatedHostsOptions listDedicatedHostsOptionsModel = new ListDedicatedHostsOptions.Builder() + .dedicatedHostGroupId("testString") .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") + .name("my-name") .build(); - // Invoke listKeys() with a valid options model and verify the result - Response response = vpcService.listKeys(listKeysOptionsModel).execute(); + // Invoke listDedicatedHosts() with a valid options model and verify the result + Response response = vpcService.listDedicatedHosts(listDedicatedHostsOptionsModel).execute(); assertNotNull(response); - KeyCollection responseObj = response.getResult(); + DedicatedHostCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6511,33 +7586,36 @@ public void testListKeysWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listKeysPath); + assertEquals(parsedPath, listDedicatedHostsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("dedicated_host_group.id"), "testString"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); + assertEquals(query.get("name"), "my-name"); } - // Test the listKeys operation with and without retries enabled + // Test the listDedicatedHosts operation with and without retries enabled @Test - public void testListKeysWRetries() throws Throwable { + public void testListDedicatedHostsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListKeysWOptions(); + testListDedicatedHostsWOptions(); vpcService.disableRetries(); - testListKeysWOptions(); + testListDedicatedHostsWOptions(); } - // Test the listKeys operation using the KeysPager.getNext() method + // Test the listDedicatedHosts operation using the DedicatedHostsPager.getNext() method @Test - public void testListKeysWithPagerGetNext() throws Throwable { + public void testListDedicatedHostsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"id\":\"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"length\":2048,\"name\":\"my-key-1\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"ed25519\"}],\"limit\":1}"; - String mockResponsePage2 = "{\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"id\":\"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"length\":2048,\"name\":\"my-key-1\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"ed25519\"}],\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"id\":\"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"numa\":{\"count\":2,\"nodes\":[{\"available_vcpu\":24,\"vcpu\":56}]},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"id\":\"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"numa\":{\"count\":2,\"nodes\":[{\"available_vcpu\":24,\"vcpu\":56}]},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -6551,27 +7629,30 @@ public void testListKeysWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() + ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() + .dedicatedHostGroupId("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") + .name("my-name") .build(); - List allResults = new ArrayList<>(); - KeysPager pager = new KeysPager(vpcService, listKeysOptions); + List allResults = new ArrayList<>(); + DedicatedHostsPager pager = new DedicatedHostsPager(vpcService, listDedicatedHostsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listKeys operation using the KeysPager.getAll() method + // Test the listDedicatedHosts operation using the DedicatedHostsPager.getAll() method @Test - public void testListKeysWithPagerGetAll() throws Throwable { + public void testListDedicatedHostsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"id\":\"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"length\":2048,\"name\":\"my-key-1\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"ed25519\"}],\"limit\":1}"; - String mockResponsePage2 = "{\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"id\":\"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"length\":2048,\"name\":\"my-key-1\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"ed25519\"}],\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"id\":\"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"numa\":{\"count\":2,\"nodes\":[{\"available_vcpu\":24,\"vcpu\":56}]},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"id\":\"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"numa\":{\"count\":2,\"nodes\":[{\"available_vcpu\":24,\"vcpu\":56}]},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -6585,45 +7666,64 @@ public void testListKeysWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() + ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() + .dedicatedHostGroupId("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") + .name("my-name") .build(); - KeysPager pager = new KeysPager(vpcService, listKeysOptions); - List allResults = pager.getAll(); + DedicatedHostsPager pager = new DedicatedHostsPager(vpcService, listDedicatedHostsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createKey operation with a valid options model parameter + // Test the createDedicatedHost operation with a valid options model parameter @Test - public void testCreateKeyWOptions() throws Throwable { + public void testCreateDedicatedHostWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"length\": 2048, \"name\": \"my-key-1\", \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"type\": \"ed25519\"}"; - String createKeyPath = "/keys"; + String mockResponseBody = "{\"available_memory\": 128, \"available_vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}], \"group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"instance_placement_enabled\": true, \"instances\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}], \"lifecycle_state\": \"stable\", \"memory\": 128, \"name\": \"my-host\", \"numa\": {\"count\": 2, \"nodes\": [{\"available_vcpu\": 24, \"vcpu\": 56}]}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"mx2-host-152x1216\"}, \"provisionable\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host\", \"socket_count\": 4, \"state\": \"available\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createDedicatedHostPath = "/dedicated_hosts"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); + // Construct an instance of the DedicatedHostProfileIdentityByName model + DedicatedHostProfileIdentityByName dedicatedHostProfileIdentityModel = new DedicatedHostProfileIdentityByName.Builder() + .name("mx2-host-152x1216") + .build(); + // Construct an instance of the ResourceGroupIdentityById model ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the CreateKeyOptions model - CreateKeyOptions createKeyOptionsModel = new CreateKeyOptions.Builder() - .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En") - .name("my-key-1") + // Construct an instance of the DedicatedHostGroupIdentityById model + DedicatedHostGroupIdentityById dedicatedHostGroupIdentityModel = new DedicatedHostGroupIdentityById.Builder() + .id("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0") + .build(); + + // Construct an instance of the DedicatedHostPrototypeDedicatedHostByGroup model + DedicatedHostPrototypeDedicatedHostByGroup dedicatedHostPrototypeModel = new DedicatedHostPrototypeDedicatedHostByGroup.Builder() + .instancePlacementEnabled(true) + .name("my-host") + .profile(dedicatedHostProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) - .type("rsa") + .group(dedicatedHostGroupIdentityModel) .build(); - // Invoke createKey() with a valid options model and verify the result - Response response = vpcService.createKey(createKeyOptionsModel).execute(); + // Construct an instance of the CreateDedicatedHostOptions model + CreateDedicatedHostOptions createDedicatedHostOptionsModel = new CreateDedicatedHostOptions.Builder() + .dedicatedHostPrototype(dedicatedHostPrototypeModel) + .build(); + + // Invoke createDedicatedHost() with a valid options model and verify the result + Response response = vpcService.createDedicatedHost(createDedicatedHostOptionsModel).execute(); assertNotNull(response); - Key responseObj = response.getResult(); + DedicatedHost responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6632,214 +7732,271 @@ public void testCreateKeyWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createKeyPath); + assertEquals(parsedPath, createDedicatedHostPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createKey operation with and without retries enabled + // Test the createDedicatedHost operation with and without retries enabled @Test - public void testCreateKeyWRetries() throws Throwable { + public void testCreateDedicatedHostWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateKeyWOptions(); + testCreateDedicatedHostWOptions(); vpcService.disableRetries(); - testCreateKeyWOptions(); + testCreateDedicatedHostWOptions(); } - // Test the createKey operation with a null options model (negative test) + // Test the createDedicatedHost operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateKeyNoOptions() throws Throwable { + public void testCreateDedicatedHostNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createKey(null).execute(); + vpcService.createDedicatedHost(null).execute(); } - // Test the deleteKey operation with a valid options model parameter + // Test the listDedicatedHostDisks operation with a valid options model parameter @Test - public void testDeleteKeyWOptions() throws Throwable { + public void testListDedicatedHostDisksWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteKeyPath = "/keys/testString"; + String mockResponseBody = "{\"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}]}"; + String listDedicatedHostDisksPath = "/dedicated_hosts/testString/disks"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteKeyOptions model - DeleteKeyOptions deleteKeyOptionsModel = new DeleteKeyOptions.Builder() + // Construct an instance of the ListDedicatedHostDisksOptions model + ListDedicatedHostDisksOptions listDedicatedHostDisksOptionsModel = new ListDedicatedHostDisksOptions.Builder() + .dedicatedHostId("testString") + .build(); + + // Invoke listDedicatedHostDisks() with a valid options model and verify the result + Response response = vpcService.listDedicatedHostDisks(listDedicatedHostDisksOptionsModel).execute(); + assertNotNull(response); + DedicatedHostDiskCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listDedicatedHostDisksPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the listDedicatedHostDisks operation with and without retries enabled + @Test + public void testListDedicatedHostDisksWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListDedicatedHostDisksWOptions(); + + vpcService.disableRetries(); + testListDedicatedHostDisksWOptions(); + } + + // Test the listDedicatedHostDisks operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListDedicatedHostDisksNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listDedicatedHostDisks(null).execute(); + } + + // Test the getDedicatedHostDisk operation with a valid options model parameter + @Test + public void testGetDedicatedHostDiskWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}"; + String getDedicatedHostDiskPath = "/dedicated_hosts/testString/disks/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetDedicatedHostDiskOptions model + GetDedicatedHostDiskOptions getDedicatedHostDiskOptionsModel = new GetDedicatedHostDiskOptions.Builder() + .dedicatedHostId("testString") .id("testString") .build(); - // Invoke deleteKey() with a valid options model and verify the result - Response response = vpcService.deleteKey(deleteKeyOptionsModel).execute(); + // Invoke getDedicatedHostDisk() with a valid options model and verify the result + Response response = vpcService.getDedicatedHostDisk(getDedicatedHostDiskOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + DedicatedHostDisk responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteKeyPath); + assertEquals(parsedPath, getDedicatedHostDiskPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteKey operation with and without retries enabled + // Test the getDedicatedHostDisk operation with and without retries enabled @Test - public void testDeleteKeyWRetries() throws Throwable { + public void testGetDedicatedHostDiskWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteKeyWOptions(); + testGetDedicatedHostDiskWOptions(); vpcService.disableRetries(); - testDeleteKeyWOptions(); + testGetDedicatedHostDiskWOptions(); } - // Test the deleteKey operation with a null options model (negative test) + // Test the getDedicatedHostDisk operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteKeyNoOptions() throws Throwable { + public void testGetDedicatedHostDiskNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteKey(null).execute(); + vpcService.getDedicatedHostDisk(null).execute(); } - // Test the getKey operation with a valid options model parameter + // Test the updateDedicatedHostDisk operation with a valid options model parameter @Test - public void testGetKeyWOptions() throws Throwable { + public void testUpdateDedicatedHostDiskWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"length\": 2048, \"name\": \"my-key-1\", \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"type\": \"ed25519\"}"; - String getKeyPath = "/keys/testString"; + String mockResponseBody = "{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}"; + String updateDedicatedHostDiskPath = "/dedicated_hosts/testString/disks/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetKeyOptions model - GetKeyOptions getKeyOptionsModel = new GetKeyOptions.Builder() + // Construct an instance of the DedicatedHostDiskPatch model + DedicatedHostDiskPatch dedicatedHostDiskPatchModel = new DedicatedHostDiskPatch.Builder() + .name("my-dedicated-host-disk-updated") + .build(); + Map dedicatedHostDiskPatchModelAsPatch = dedicatedHostDiskPatchModel.asPatch(); + + // Construct an instance of the UpdateDedicatedHostDiskOptions model + UpdateDedicatedHostDiskOptions updateDedicatedHostDiskOptionsModel = new UpdateDedicatedHostDiskOptions.Builder() + .dedicatedHostId("testString") .id("testString") + .dedicatedHostDiskPatch(dedicatedHostDiskPatchModelAsPatch) .build(); - // Invoke getKey() with a valid options model and verify the result - Response response = vpcService.getKey(getKeyOptionsModel).execute(); + // Invoke updateDedicatedHostDisk() with a valid options model and verify the result + Response response = vpcService.updateDedicatedHostDisk(updateDedicatedHostDiskOptionsModel).execute(); assertNotNull(response); - Key responseObj = response.getResult(); + DedicatedHostDisk responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getKeyPath); + assertEquals(parsedPath, updateDedicatedHostDiskPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getKey operation with and without retries enabled + // Test the updateDedicatedHostDisk operation with and without retries enabled @Test - public void testGetKeyWRetries() throws Throwable { + public void testUpdateDedicatedHostDiskWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetKeyWOptions(); + testUpdateDedicatedHostDiskWOptions(); vpcService.disableRetries(); - testGetKeyWOptions(); + testUpdateDedicatedHostDiskWOptions(); } - // Test the getKey operation with a null options model (negative test) + // Test the updateDedicatedHostDisk operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetKeyNoOptions() throws Throwable { + public void testUpdateDedicatedHostDiskNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getKey(null).execute(); + vpcService.updateDedicatedHostDisk(null).execute(); } - // Test the updateKey operation with a valid options model parameter + // Test the deleteDedicatedHost operation with a valid options model parameter @Test - public void testUpdateKeyWOptions() throws Throwable { + public void testDeleteDedicatedHostWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"length\": 2048, \"name\": \"my-key-1\", \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"type\": \"ed25519\"}"; - String updateKeyPath = "/keys/testString"; + String mockResponseBody = ""; + String deleteDedicatedHostPath = "/dedicated_hosts/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the KeyPatch model - KeyPatch keyPatchModel = new KeyPatch.Builder() - .name("my-key-1") - .build(); - Map keyPatchModelAsPatch = keyPatchModel.asPatch(); - - // Construct an instance of the UpdateKeyOptions model - UpdateKeyOptions updateKeyOptionsModel = new UpdateKeyOptions.Builder() + // Construct an instance of the DeleteDedicatedHostOptions model + DeleteDedicatedHostOptions deleteDedicatedHostOptionsModel = new DeleteDedicatedHostOptions.Builder() .id("testString") - .keyPatch(keyPatchModelAsPatch) .build(); - // Invoke updateKey() with a valid options model and verify the result - Response response = vpcService.updateKey(updateKeyOptionsModel).execute(); + // Invoke deleteDedicatedHost() with a valid options model and verify the result + Response response = vpcService.deleteDedicatedHost(deleteDedicatedHostOptionsModel).execute(); assertNotNull(response); - Key responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateKeyPath); + assertEquals(parsedPath, deleteDedicatedHostPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateKey operation with and without retries enabled + // Test the deleteDedicatedHost operation with and without retries enabled @Test - public void testUpdateKeyWRetries() throws Throwable { + public void testDeleteDedicatedHostWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateKeyWOptions(); + testDeleteDedicatedHostWOptions(); vpcService.disableRetries(); - testUpdateKeyWOptions(); + testDeleteDedicatedHostWOptions(); } - // Test the updateKey operation with a null options model (negative test) + // Test the deleteDedicatedHost operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateKeyNoOptions() throws Throwable { + public void testDeleteDedicatedHostNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateKey(null).execute(); + vpcService.deleteDedicatedHost(null).execute(); } - // Test the listInstanceProfiles operation with a valid options model parameter + // Test the getDedicatedHost operation with a valid options model parameter @Test - public void testListInstanceProfilesWOptions() throws Throwable { + public void testGetDedicatedHostWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"profiles\": [{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"cluster_network_attachment_count\": {\"type\": \"dependent\"}, \"confidential_compute_modes\": {\"default\": \"disabled\", \"type\": \"enum\", \"values\": [\"disabled\"]}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"nvme\", \"type\": \"enum\", \"values\": [\"nvme\"]}}], \"family\": \"balanced\", \"gpu_count\": {\"type\": \"fixed\", \"value\": 2}, \"gpu_manufacturer\": {\"type\": \"enum\", \"values\": [\"amd\"]}, \"gpu_memory\": {\"type\": \"fixed\", \"value\": 16}, \"gpu_model\": {\"type\": \"enum\", \"values\": [\"Tesla V100\"]}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-4x16\", \"network_attachment_count\": {\"max\": 5, \"min\": 1, \"type\": \"range\"}, \"network_interface_count\": {\"max\": 5, \"min\": 1, \"type\": \"range\"}, \"numa_count\": {\"type\": \"fixed\", \"value\": 2}, \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"port_speed\": {\"type\": \"fixed\", \"value\": 1000}, \"reservation_terms\": {\"type\": \"enum\", \"values\": [\"one_year\"]}, \"resource_type\": \"instance_profile\", \"secure_boot_modes\": {\"default\": true, \"type\": \"enum\", \"values\": [true]}, \"status\": \"current\", \"supported_cluster_network_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}], \"total_volume_bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"vcpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"vcpu_count\": {\"type\": \"fixed\", \"value\": 16}, \"vcpu_manufacturer\": {\"type\": \"fixed\", \"value\": \"intel\"}}]}"; - String listInstanceProfilesPath = "/instance/profiles"; + String mockResponseBody = "{\"available_memory\": 128, \"available_vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}], \"group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"instance_placement_enabled\": true, \"instances\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}], \"lifecycle_state\": \"stable\", \"memory\": 128, \"name\": \"my-host\", \"numa\": {\"count\": 2, \"nodes\": [{\"available_vcpu\": 24, \"vcpu\": 56}]}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"mx2-host-152x1216\"}, \"provisionable\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host\", \"socket_count\": 4, \"state\": \"available\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getDedicatedHostPath = "/dedicated_hosts/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceProfilesOptions model - ListInstanceProfilesOptions listInstanceProfilesOptionsModel = new ListInstanceProfilesOptions(); + // Construct an instance of the GetDedicatedHostOptions model + GetDedicatedHostOptions getDedicatedHostOptionsModel = new GetDedicatedHostOptions.Builder() + .id("testString") + .build(); - // Invoke listInstanceProfiles() with a valid options model and verify the result - Response response = vpcService.listInstanceProfiles(listInstanceProfilesOptionsModel).execute(); + // Invoke getDedicatedHost() with a valid options model and verify the result + Response response = vpcService.getDedicatedHost(getDedicatedHostOptionsModel).execute(); assertNotNull(response); - InstanceProfileCollection responseObj = response.getResult(); + DedicatedHost responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6848,95 +8005,120 @@ public void testListInstanceProfilesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceProfilesPath); + assertEquals(parsedPath, getDedicatedHostPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listInstanceProfiles operation with and without retries enabled + // Test the getDedicatedHost operation with and without retries enabled @Test - public void testListInstanceProfilesWRetries() throws Throwable { + public void testGetDedicatedHostWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceProfilesWOptions(); + testGetDedicatedHostWOptions(); vpcService.disableRetries(); - testListInstanceProfilesWOptions(); + testGetDedicatedHostWOptions(); } - // Test the getInstanceProfile operation with a valid options model parameter + // Test the getDedicatedHost operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetDedicatedHostNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getDedicatedHost(null).execute(); + } + + // Test the updateDedicatedHost operation with a valid options model parameter @Test - public void testGetInstanceProfileWOptions() throws Throwable { + public void testUpdateDedicatedHostWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"cluster_network_attachment_count\": {\"type\": \"dependent\"}, \"confidential_compute_modes\": {\"default\": \"disabled\", \"type\": \"enum\", \"values\": [\"disabled\"]}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"nvme\", \"type\": \"enum\", \"values\": [\"nvme\"]}}], \"family\": \"balanced\", \"gpu_count\": {\"type\": \"fixed\", \"value\": 2}, \"gpu_manufacturer\": {\"type\": \"enum\", \"values\": [\"amd\"]}, \"gpu_memory\": {\"type\": \"fixed\", \"value\": 16}, \"gpu_model\": {\"type\": \"enum\", \"values\": [\"Tesla V100\"]}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-4x16\", \"network_attachment_count\": {\"max\": 5, \"min\": 1, \"type\": \"range\"}, \"network_interface_count\": {\"max\": 5, \"min\": 1, \"type\": \"range\"}, \"numa_count\": {\"type\": \"fixed\", \"value\": 2}, \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"port_speed\": {\"type\": \"fixed\", \"value\": 1000}, \"reservation_terms\": {\"type\": \"enum\", \"values\": [\"one_year\"]}, \"resource_type\": \"instance_profile\", \"secure_boot_modes\": {\"default\": true, \"type\": \"enum\", \"values\": [true]}, \"status\": \"current\", \"supported_cluster_network_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}], \"total_volume_bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"vcpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"vcpu_count\": {\"type\": \"fixed\", \"value\": 16}, \"vcpu_manufacturer\": {\"type\": \"fixed\", \"value\": \"intel\"}}"; - String getInstanceProfilePath = "/instance/profiles/mx2-host-152x1216"; + String mockResponseBody = "{\"available_memory\": 128, \"available_vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}], \"group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"instance_placement_enabled\": true, \"instances\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}], \"lifecycle_state\": \"stable\", \"memory\": 128, \"name\": \"my-host\", \"numa\": {\"count\": 2, \"nodes\": [{\"available_vcpu\": 24, \"vcpu\": 56}]}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"mx2-host-152x1216\"}, \"provisionable\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host\", \"socket_count\": 4, \"state\": \"available\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateDedicatedHostPath = "/dedicated_hosts/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceProfileOptions model - GetInstanceProfileOptions getInstanceProfileOptionsModel = new GetInstanceProfileOptions.Builder() - .name("mx2-host-152x1216") + // Construct an instance of the DedicatedHostPatch model + DedicatedHostPatch dedicatedHostPatchModel = new DedicatedHostPatch.Builder() + .instancePlacementEnabled(false) + .name("my-host") .build(); + Map dedicatedHostPatchModelAsPatch = dedicatedHostPatchModel.asPatch(); - // Invoke getInstanceProfile() with a valid options model and verify the result - Response response = vpcService.getInstanceProfile(getInstanceProfileOptionsModel).execute(); + // Construct an instance of the UpdateDedicatedHostOptions model + UpdateDedicatedHostOptions updateDedicatedHostOptionsModel = new UpdateDedicatedHostOptions.Builder() + .id("testString") + .dedicatedHostPatch(dedicatedHostPatchModelAsPatch) + .build(); + + // Invoke updateDedicatedHost() with a valid options model and verify the result + Response response = vpcService.updateDedicatedHost(updateDedicatedHostOptionsModel).execute(); assertNotNull(response); - InstanceProfile responseObj = response.getResult(); + DedicatedHost responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceProfilePath); + assertEquals(parsedPath, updateDedicatedHostPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceProfile operation with and without retries enabled + // Test the updateDedicatedHost operation with and without retries enabled @Test - public void testGetInstanceProfileWRetries() throws Throwable { + public void testUpdateDedicatedHostWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceProfileWOptions(); + testUpdateDedicatedHostWOptions(); vpcService.disableRetries(); - testGetInstanceProfileWOptions(); + testUpdateDedicatedHostWOptions(); } - // Test the getInstanceProfile operation with a null options model (negative test) + // Test the updateDedicatedHost operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceProfileNoOptions() throws Throwable { + public void testUpdateDedicatedHostNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceProfile(null).execute(); + vpcService.updateDedicatedHost(null).execute(); } - // Test the listInstanceTemplates operation with a valid options model parameter + // Test the listEndpointGateways operation with a valid options model parameter @Test - public void testListInstanceTemplatesWOptions() throws Throwable { + public void testListEndpointGatewaysWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"templates\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"cluster_network_attachments\": [{\"cluster_network_interface\": {\"auto_delete\": false, \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\"}, \"subnet\": {\"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\"}}, \"name\": \"my-instance-network-attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"enable_secure_boot\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"keys\": [{\"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": false, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"bandwidth\": 1000, \"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"zone\": {\"name\": \"us-south-1\"}, \"network_attachments\": [{\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}], \"primary_network_attachment\": {\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}}], \"total_count\": 132}"; - String listInstanceTemplatesPath = "/instance/templates"; + String mockResponseBody = "{\"endpoint_gateways\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"dns_resolution_binding_mode\": \"primary\", \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_reasons\": [{\"code\": \"dns_resolution_binding_pending\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-endpoint-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"endpoint_gateway\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"service_endpoint\": \"my-cloudant-instance.appdomain.cloud\", \"service_endpoints\": [\"my-cloudant-instance.appdomain.cloud\"], \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"name\": \"my-private-path-service-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"private_path_service_gateway\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listEndpointGatewaysPath = "/endpoint_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceTemplatesOptions model - ListInstanceTemplatesOptions listInstanceTemplatesOptionsModel = new ListInstanceTemplatesOptions(); + // Construct an instance of the ListEndpointGatewaysOptions model + ListEndpointGatewaysOptions listEndpointGatewaysOptionsModel = new ListEndpointGatewaysOptions.Builder() + .name("my-name") + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .lifecycleState(java.util.Arrays.asList("stable")) + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .dnsResolutionBindingMode(java.util.Arrays.asList("disabled")) + .build(); - // Invoke listInstanceTemplates() with a valid options model and verify the result - Response response = vpcService.listInstanceTemplates(listInstanceTemplatesOptionsModel).execute(); + // Invoke listEndpointGateways() with a valid options model and verify the result + Response response = vpcService.listEndpointGateways(listEndpointGatewaysOptionsModel).execute(); assertNotNull(response); - InstanceTemplateCollection responseObj = response.getResult(); + EndpointGatewayCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -6945,125 +8127,124 @@ public void testListInstanceTemplatesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceTemplatesPath); + assertEquals(parsedPath, listEndpointGatewaysPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("lifecycle_state"), RequestUtils.join(java.util.Arrays.asList("stable"), ",")); + assertEquals(query.get("vpc.id"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); + assertEquals(query.get("dns_resolution_binding_mode"), RequestUtils.join(java.util.Arrays.asList("disabled"), ",")); } - // Test the listInstanceTemplates operation with and without retries enabled + // Test the listEndpointGateways operation with and without retries enabled @Test - public void testListInstanceTemplatesWRetries() throws Throwable { + public void testListEndpointGatewaysWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceTemplatesWOptions(); + testListEndpointGatewaysWOptions(); vpcService.disableRetries(); - testListInstanceTemplatesWOptions(); + testListEndpointGatewaysWOptions(); } - // Test the createInstanceTemplate operation with a valid options model parameter + // Test the listEndpointGateways operation using the EndpointGatewaysPager.getNext() method @Test - public void testCreateInstanceTemplateWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"cluster_network_attachments\": [{\"cluster_network_interface\": {\"auto_delete\": false, \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\"}, \"subnet\": {\"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\"}}, \"name\": \"my-instance-network-attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"enable_secure_boot\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"keys\": [{\"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": false, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"bandwidth\": 1000, \"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"zone\": {\"name\": \"us-south-1\"}, \"network_attachments\": [{\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}], \"primary_network_attachment\": {\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}}"; - String createInstanceTemplatePath = "/instance/templates"; + public void testListEndpointGatewaysWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"endpoint_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"dns_resolution_binding_mode\":\"primary\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_reasons\":[{\"code\":\"dns_resolution_binding_pending\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"name\":\"my-private-path-service-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"private_path_service_gateway\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"endpoint_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"dns_resolution_binding_mode\":\"primary\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_reasons\":[{\"code\":\"dns_resolution_binding_pending\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"name\":\"my-private-path-service-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"private_path_service_gateway\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the InstanceAvailabilityPolicyPrototype model - InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() - .hostFailure("restart") - .build(); - - // Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model - ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") - .build(); - - // Construct an instance of the ClusterNetworkSubnetIdentityById model - ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() - .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") - .build(); - - // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model - InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() - .autoDelete(false) - .name("my-cluster-network-interface") - .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) - .subnet(clusterNetworkSubnetIdentityModel) - .build(); - - // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model - InstanceClusterNetworkAttachmentPrototypeInstanceContext instanceClusterNetworkAttachmentPrototypeInstanceContextModel = new InstanceClusterNetworkAttachmentPrototypeInstanceContext.Builder() - .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) - .name("my-instance-network-attachment") - .build(); - - // Construct an instance of the TrustedProfileIdentityById model - TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() - .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") - .build(); - - // Construct an instance of the InstanceDefaultTrustedProfilePrototype model - InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() - .autoLink(false) - .target(trustedProfileIdentityModel) - .build(); - - // Construct an instance of the KeyIdentityById model - KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") - .build(); - - // Construct an instance of the InstanceMetadataServicePrototype model - InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() - .enabled(false) - .protocol("https") - .responseHopLimit(Long.valueOf("2")) - .build(); - - // Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); - - // Construct an instance of the InstanceProfileIdentityByName model - InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() - .name("bx2-4x16") - .build(); + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the ReservationIdentityById model - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() + .name("my-name") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .lifecycleState(java.util.Arrays.asList("stable")) + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .dnsResolutionBindingMode(java.util.Arrays.asList("disabled")) .build(); - // Construct an instance of the InstanceReservationAffinityPrototype model - InstanceReservationAffinityPrototype instanceReservationAffinityPrototypeModel = new InstanceReservationAffinityPrototype.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) - .build(); + List allResults = new ArrayList<>(); + EndpointGatewaysPager pager = new EndpointGatewaysPager(vpcService, listEndpointGatewaysOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listEndpointGateways operation using the EndpointGatewaysPager.getAll() method + @Test + public void testListEndpointGatewaysWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"endpoint_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"dns_resolution_binding_mode\":\"primary\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_reasons\":[{\"code\":\"dns_resolution_binding_pending\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"name\":\"my-private-path-service-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"private_path_service_gateway\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"endpoint_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"dns_resolution_binding_mode\":\"primary\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_reasons\":[{\"code\":\"dns_resolution_binding_pending\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"name\":\"my-private-path-service-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"private_path_service_gateway\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() + .name("my-name") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .lifecycleState(java.util.Arrays.asList("stable")) + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .dnsResolutionBindingMode(java.util.Arrays.asList("disabled")) .build(); - // Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById model - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() - .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .build(); + EndpointGatewaysPager pager = new EndpointGatewaysPager(vpcService, listEndpointGatewaysOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createEndpointGateway operation with a valid options model parameter + @Test + public void testCreateEndpointGatewayWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"dns_resolution_binding_mode\": \"primary\", \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_reasons\": [{\"code\": \"dns_resolution_binding_pending\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-endpoint-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"endpoint_gateway\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"service_endpoint\": \"my-cloudant-instance.appdomain.cloud\", \"service_endpoints\": [\"my-cloudant-instance.appdomain.cloud\"], \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"name\": \"my-private-path-service-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"private_path_service_gateway\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String createEndpointGatewayPath = "/endpoint_gateways"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); - // Construct an instance of the VolumeAttachmentPrototype model - VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype.Builder() - .deleteVolumeOnInstanceDelete(false) - .name("my-volume-attachment") - .volume(volumeAttachmentPrototypeVolumeModel) + // Construct an instance of the EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model + EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype endpointGatewayTargetPrototypeModel = new EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype.Builder() + .name("ibm-ntp-server") + .resourceType("provider_infrastructure_service") .build(); // Construct an instance of the VPCIdentityById model @@ -7071,57 +8252,14 @@ public void testCreateInstanceTemplateWOptions() throws Throwable { .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - // Construct an instance of the EncryptionKeyIdentityByCRN model - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - // Construct an instance of the VolumeProfileIdentityByName model - VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("general-purpose") - .build(); - - // Construct an instance of the VolumePrototypeInstanceByImageContext model - VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() - .bandwidth(Long.valueOf("1000")) - .capacity(Long.valueOf("100")) - .encryptionKey(encryptionKeyIdentityModel) - .iops(Long.valueOf("10000")) - .name("my-boot-volume") - .profile(volumeProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .build(); - - // Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model - VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .volume(volumePrototypeInstanceByImageContextModel) - .build(); - - // Construct an instance of the ImageIdentityById model - ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .build(); - - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") + // Construct an instance of the EndpointGatewayReservedIPReservedIPIdentityById model + EndpointGatewayReservedIPReservedIPIdentityById endpointGatewayReservedIpModel = new EndpointGatewayReservedIPReservedIPIdentityById.Builder() + .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") .build(); - // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); // Construct an instance of the SecurityGroupIdentityById model @@ -7129,115 +8267,197 @@ public void testCreateInstanceTemplateWOptions() throws Throwable { .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") .build(); - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") + // Construct an instance of the CreateEndpointGatewayOptions model + CreateEndpointGatewayOptions createEndpointGatewayOptionsModel = new CreateEndpointGatewayOptions.Builder() + .target(endpointGatewayTargetPrototypeModel) + .vpc(vpcIdentityModel) + .dnsResolutionBindingMode("primary") + .ips(java.util.Arrays.asList(endpointGatewayReservedIpModel)) + .name("testString") .resourceGroup(resourceGroupIdentityModel) .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) .build(); - // Construct an instance of the InstanceNetworkAttachmentPrototype model - InstanceNetworkAttachmentPrototype instanceNetworkAttachmentPrototypeModel = new InstanceNetworkAttachmentPrototype.Builder() - .name("my-instance-network-attachment") - .virtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .build(); + // Invoke createEndpointGateway() with a valid options model and verify the result + Response response = vpcService.createEndpointGateway(createEndpointGatewayOptionsModel).execute(); + assertNotNull(response); + EndpointGateway responseObj = response.getResult(); + assertNotNull(responseObj); - // Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model - InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.Builder() - .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) - .clusterNetworkAttachments(java.util.Arrays.asList(instanceClusterNetworkAttachmentPrototypeInstanceContextModel)) - .confidentialComputeMode("disabled") - .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .enableSecureBoot(true) - .keys(java.util.Arrays.asList(keyIdentityModel)) - .metadataService(instanceMetadataServicePrototypeModel) - .name("my-instance") - .placementTarget(instancePlacementTargetPrototypeModel) - .profile(instanceProfileIdentityModel) - .reservationAffinity(instanceReservationAffinityPrototypeModel) - .resourceGroup(resourceGroupIdentityModel) - .totalVolumeBandwidth(Long.valueOf("500")) - .userData("testString") - .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) - .vpc(vpcIdentityModel) - .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) - .image(imageIdentityModel) - .zone(zoneIdentityModel) - .networkAttachments(java.util.Arrays.asList(instanceNetworkAttachmentPrototypeModel)) - .primaryNetworkAttachment(instanceNetworkAttachmentPrototypeModel) - .build(); + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createEndpointGatewayPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createEndpointGateway operation with and without retries enabled + @Test + public void testCreateEndpointGatewayWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateEndpointGatewayWOptions(); + + vpcService.disableRetries(); + testCreateEndpointGatewayWOptions(); + } + + // Test the createEndpointGateway operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateEndpointGatewayNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createEndpointGateway(null).execute(); + } - // Construct an instance of the CreateInstanceTemplateOptions model - CreateInstanceTemplateOptions createInstanceTemplateOptionsModel = new CreateInstanceTemplateOptions.Builder() - .instanceTemplatePrototype(instanceTemplatePrototypeModel) + // Test the listEndpointGatewayIps operation with a valid options model parameter + @Test + public void testListEndpointGatewayIpsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listEndpointGatewayIpsPath = "/endpoint_gateways/testString/ips"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListEndpointGatewayIpsOptions model + ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptionsModel = new ListEndpointGatewayIpsOptions.Builder() + .endpointGatewayId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .sort("name") .build(); - // Invoke createInstanceTemplate() with a valid options model and verify the result - Response response = vpcService.createInstanceTemplate(createInstanceTemplateOptionsModel).execute(); + // Invoke listEndpointGatewayIps() with a valid options model and verify the result + Response response = vpcService.listEndpointGatewayIps(listEndpointGatewayIpsOptionsModel).execute(); assertNotNull(response); - InstanceTemplate responseObj = response.getResult(); + ReservedIPCollectionEndpointGatewayContext responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createInstanceTemplatePath); + assertEquals(parsedPath, listEndpointGatewayIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("sort"), "name"); } - // Test the createInstanceTemplate operation with and without retries enabled + // Test the listEndpointGatewayIps operation with and without retries enabled @Test - public void testCreateInstanceTemplateWRetries() throws Throwable { + public void testListEndpointGatewayIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateInstanceTemplateWOptions(); + testListEndpointGatewayIpsWOptions(); vpcService.disableRetries(); - testCreateInstanceTemplateWOptions(); + testListEndpointGatewayIpsWOptions(); } - // Test the createInstanceTemplate operation with a null options model (negative test) + // Test the listEndpointGatewayIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateInstanceTemplateNoOptions() throws Throwable { + public void testListEndpointGatewayIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createInstanceTemplate(null).execute(); + vpcService.listEndpointGatewayIps(null).execute(); } - // Test the deleteInstanceTemplate operation with a valid options model parameter + // Test the listEndpointGatewayIps operation using the EndpointGatewayIpsPager.getNext() method @Test - public void testDeleteInstanceTemplateWOptions() throws Throwable { + public void testListEndpointGatewayIpsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() + .endpointGatewayId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + List allResults = new ArrayList<>(); + EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(vpcService, listEndpointGatewayIpsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listEndpointGatewayIps operation using the EndpointGatewayIpsPager.getAll() method + @Test + public void testListEndpointGatewayIpsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() + .endpointGatewayId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); + + EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(vpcService, listEndpointGatewayIpsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the removeEndpointGatewayIp operation with a valid options model parameter + @Test + public void testRemoveEndpointGatewayIpWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteInstanceTemplatePath = "/instance/templates/testString"; + String removeEndpointGatewayIpPath = "/endpoint_gateways/testString/ips/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteInstanceTemplateOptions model - DeleteInstanceTemplateOptions deleteInstanceTemplateOptionsModel = new DeleteInstanceTemplateOptions.Builder() + // Construct an instance of the RemoveEndpointGatewayIpOptions model + RemoveEndpointGatewayIpOptions removeEndpointGatewayIpOptionsModel = new RemoveEndpointGatewayIpOptions.Builder() + .endpointGatewayId("testString") .id("testString") .build(); - // Invoke deleteInstanceTemplate() with a valid options model and verify the result - Response response = vpcService.deleteInstanceTemplate(deleteInstanceTemplateOptionsModel).execute(); + // Invoke removeEndpointGatewayIp() with a valid options model and verify the result + Response response = vpcService.removeEndpointGatewayIp(removeEndpointGatewayIpOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -7248,51 +8468,52 @@ public void testDeleteInstanceTemplateWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteInstanceTemplatePath); + assertEquals(parsedPath, removeEndpointGatewayIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteInstanceTemplate operation with and without retries enabled + // Test the removeEndpointGatewayIp operation with and without retries enabled @Test - public void testDeleteInstanceTemplateWRetries() throws Throwable { + public void testRemoveEndpointGatewayIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteInstanceTemplateWOptions(); + testRemoveEndpointGatewayIpWOptions(); vpcService.disableRetries(); - testDeleteInstanceTemplateWOptions(); + testRemoveEndpointGatewayIpWOptions(); } - // Test the deleteInstanceTemplate operation with a null options model (negative test) + // Test the removeEndpointGatewayIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteInstanceTemplateNoOptions() throws Throwable { + public void testRemoveEndpointGatewayIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteInstanceTemplate(null).execute(); + vpcService.removeEndpointGatewayIp(null).execute(); } - // Test the getInstanceTemplate operation with a valid options model parameter + // Test the getEndpointGatewayIp operation with a valid options model parameter @Test - public void testGetInstanceTemplateWOptions() throws Throwable { + public void testGetEndpointGatewayIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"cluster_network_attachments\": [{\"cluster_network_interface\": {\"auto_delete\": false, \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\"}, \"subnet\": {\"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\"}}, \"name\": \"my-instance-network-attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"enable_secure_boot\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"keys\": [{\"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": false, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"bandwidth\": 1000, \"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"zone\": {\"name\": \"us-south-1\"}, \"network_attachments\": [{\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}], \"primary_network_attachment\": {\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}}"; - String getInstanceTemplatePath = "/instance/templates/testString"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; + String getEndpointGatewayIpPath = "/endpoint_gateways/testString/ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceTemplateOptions model - GetInstanceTemplateOptions getInstanceTemplateOptionsModel = new GetInstanceTemplateOptions.Builder() + // Construct an instance of the GetEndpointGatewayIpOptions model + GetEndpointGatewayIpOptions getEndpointGatewayIpOptionsModel = new GetEndpointGatewayIpOptions.Builder() + .endpointGatewayId("testString") .id("testString") .build(); - // Invoke getInstanceTemplate() with a valid options model and verify the result - Response response = vpcService.getInstanceTemplate(getInstanceTemplateOptionsModel).execute(); + // Invoke getEndpointGatewayIp() with a valid options model and verify the result + Response response = vpcService.getEndpointGatewayIp(getEndpointGatewayIpOptionsModel).execute(); assertNotNull(response); - InstanceTemplate responseObj = response.getResult(); + ReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -7301,130 +8522,107 @@ public void testGetInstanceTemplateWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceTemplatePath); + assertEquals(parsedPath, getEndpointGatewayIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceTemplate operation with and without retries enabled + // Test the getEndpointGatewayIp operation with and without retries enabled @Test - public void testGetInstanceTemplateWRetries() throws Throwable { + public void testGetEndpointGatewayIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceTemplateWOptions(); + testGetEndpointGatewayIpWOptions(); vpcService.disableRetries(); - testGetInstanceTemplateWOptions(); + testGetEndpointGatewayIpWOptions(); } - // Test the getInstanceTemplate operation with a null options model (negative test) + // Test the getEndpointGatewayIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceTemplateNoOptions() throws Throwable { + public void testGetEndpointGatewayIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceTemplate(null).execute(); + vpcService.getEndpointGatewayIp(null).execute(); } - // Test the updateInstanceTemplate operation with a valid options model parameter + // Test the addEndpointGatewayIp operation with a valid options model parameter @Test - public void testUpdateInstanceTemplateWOptions() throws Throwable { + public void testAddEndpointGatewayIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"cluster_network_attachments\": [{\"cluster_network_interface\": {\"auto_delete\": false, \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\"}, \"subnet\": {\"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\"}}, \"name\": \"my-instance-network-attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"enable_secure_boot\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"keys\": [{\"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"volume_attachments\": [{\"delete_volume_on_instance_delete\": false, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"vpc\": {\"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"bandwidth\": 1000, \"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"zone\": {\"name\": \"us-south-1\"}, \"network_attachments\": [{\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}], \"primary_network_attachment\": {\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}}"; - String updateInstanceTemplatePath = "/instance/templates/testString"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; + String addEndpointGatewayIpPath = "/endpoint_gateways/testString/ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the InstanceTemplatePatch model - InstanceTemplatePatch instanceTemplatePatchModel = new InstanceTemplatePatch.Builder() - .name("my-instance-template-updated") - .build(); - Map instanceTemplatePatchModelAsPatch = instanceTemplatePatchModel.asPatch(); - - // Construct an instance of the UpdateInstanceTemplateOptions model - UpdateInstanceTemplateOptions updateInstanceTemplateOptionsModel = new UpdateInstanceTemplateOptions.Builder() + // Construct an instance of the AddEndpointGatewayIpOptions model + AddEndpointGatewayIpOptions addEndpointGatewayIpOptionsModel = new AddEndpointGatewayIpOptions.Builder() + .endpointGatewayId("testString") .id("testString") - .instanceTemplatePatch(instanceTemplatePatchModelAsPatch) .build(); - // Invoke updateInstanceTemplate() with a valid options model and verify the result - Response response = vpcService.updateInstanceTemplate(updateInstanceTemplateOptionsModel).execute(); + // Invoke addEndpointGatewayIp() with a valid options model and verify the result + Response response = vpcService.addEndpointGatewayIp(addEndpointGatewayIpOptionsModel).execute(); assertNotNull(response); - InstanceTemplate responseObj = response.getResult(); + ReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateInstanceTemplatePath); + assertEquals(parsedPath, addEndpointGatewayIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateInstanceTemplate operation with and without retries enabled + // Test the addEndpointGatewayIp operation with and without retries enabled @Test - public void testUpdateInstanceTemplateWRetries() throws Throwable { + public void testAddEndpointGatewayIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateInstanceTemplateWOptions(); + testAddEndpointGatewayIpWOptions(); vpcService.disableRetries(); - testUpdateInstanceTemplateWOptions(); + testAddEndpointGatewayIpWOptions(); } - // Test the updateInstanceTemplate operation with a null options model (negative test) + // Test the addEndpointGatewayIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateInstanceTemplateNoOptions() throws Throwable { + public void testAddEndpointGatewayIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateInstanceTemplate(null).execute(); + vpcService.addEndpointGatewayIp(null).execute(); } - // Test the listInstances operation with a valid options model parameter + // Test the listEndpointGatewayResourceBindings operation with a valid options model parameter @Test - public void testListInstancesWOptions() throws Throwable { + public void testListEndpointGatewayResourceBindingsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"instances\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"cluster_network\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"name\": \"my-cluster-network\", \"resource_type\": \"cluster_network\"}, \"cluster_network_attachments\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"enable_secure_boot\": true, \"gpu\": {\"count\": 1, \"manufacturer\": \"amd\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 64, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"numa_count\": 2, \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listInstancesPath = "/instances"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"resource_bindings\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373\", \"id\": \"r006-a7ba95b6-a254-47e4-b129-10593df8a373\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-resource-binding\", \"resource_type\": \"endpoint_gateway_resource_binding\", \"service_endpoint\": \"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud\", \"target\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\"}, \"type\": \"weak\"}], \"total_count\": 132}"; + String listEndpointGatewayResourceBindingsPath = "/endpoint_gateways/testString/resource_bindings"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstancesOptions model - ListInstancesOptions listInstancesOptionsModel = new ListInstancesOptions.Builder() + // Construct an instance of the ListEndpointGatewayResourceBindingsOptions model + ListEndpointGatewayResourceBindingsOptions listEndpointGatewayResourceBindingsOptionsModel = new ListEndpointGatewayResourceBindingsOptions.Builder() + .endpointGatewayId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .clusterNetworkId("testString") - .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") - .clusterNetworkName("my-cluster-network") - .dedicatedHostId("testString") - .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .dedicatedHostName("my-dedicated-host") - .placementGroupId("testString") - .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") - .placementGroupName("my-placement-group") - .reservationAffinityPolicy("automatic") - .reservationId("testString") - .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .reservationName("my-reservation") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") .build(); - // Invoke listInstances() with a valid options model and verify the result - Response response = vpcService.listInstances(listInstancesOptionsModel).execute(); + // Invoke listEndpointGatewayResourceBindings() with a valid options model and verify the result + Response response = vpcService.listEndpointGatewayResourceBindings(listEndpointGatewayResourceBindingsOptionsModel).execute(); assertNotNull(response); - InstanceCollection responseObj = response.getResult(); + EndpointGatewayResourceBindingCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -7433,50 +8631,39 @@ public void testListInstancesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstancesPath); + assertEquals(parsedPath, listEndpointGatewayResourceBindingsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("cluster_network.id"), "testString"); - assertEquals(query.get("cluster_network.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573"); - assertEquals(query.get("cluster_network.name"), "my-cluster-network"); - assertEquals(query.get("dedicated_host.id"), "testString"); - assertEquals(query.get("dedicated_host.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"); - assertEquals(query.get("dedicated_host.name"), "my-dedicated-host"); - assertEquals(query.get("placement_group.id"), "testString"); - assertEquals(query.get("placement_group.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"); - assertEquals(query.get("placement_group.name"), "my-placement-group"); - assertEquals(query.get("reservation_affinity.policy"), "automatic"); - assertEquals(query.get("reservation.id"), "testString"); - assertEquals(query.get("reservation.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"); - assertEquals(query.get("reservation.name"), "my-reservation"); - assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); - assertEquals(query.get("vpc.name"), "my-vpc"); } - // Test the listInstances operation with and without retries enabled + // Test the listEndpointGatewayResourceBindings operation with and without retries enabled @Test - public void testListInstancesWRetries() throws Throwable { + public void testListEndpointGatewayResourceBindingsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstancesWOptions(); + testListEndpointGatewayResourceBindingsWOptions(); vpcService.disableRetries(); - testListInstancesWOptions(); + testListEndpointGatewayResourceBindingsWOptions(); } - // Test the listInstances operation using the InstancesPager.getNext() method + // Test the listEndpointGatewayResourceBindings operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListEndpointGatewayResourceBindingsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listEndpointGatewayResourceBindings(null).execute(); + } + + // Test the listEndpointGatewayResourceBindings operation using the EndpointGatewayResourceBindingsPager.getNext() method @Test - public void testListInstancesWithPagerGetNext() throws Throwable { + public void testListEndpointGatewayResourceBindingsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"cluster_network\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"name\":\"my-cluster-network\",\"resource_type\":\"cluster_network\"},\"cluster_network_attachments\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"confidential_compute_mode\":\"disabled\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"enable_secure_boot\":true,\"gpu\":{\"count\":1,\"manufacturer\":\"amd\",\"memory\":1,\"model\":\"Tesla V100\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":64,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"numa_count\":2,\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"cluster_network\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"name\":\"my-cluster-network\",\"resource_type\":\"cluster_network\"},\"cluster_network_attachments\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"confidential_compute_mode\":\"disabled\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"enable_secure_boot\":true,\"gpu\":{\"count\":1,\"manufacturer\":\"amd\",\"memory\":1,\"model\":\"Tesla V100\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":64,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"numa_count\":2,\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"resource_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373\",\"id\":\"r006-a7ba95b6-a254-47e4-b129-10593df8a373\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-resource-binding\",\"resource_type\":\"endpoint_gateway_resource_binding\",\"service_endpoint\":\"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud\",\"target\":{\"crn\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\"},\"type\":\"weak\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"resource_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373\",\"id\":\"r006-a7ba95b6-a254-47e4-b129-10593df8a373\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-resource-binding\",\"resource_type\":\"endpoint_gateway_resource_binding\",\"service_endpoint\":\"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud\",\"target\":{\"crn\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\"},\"type\":\"weak\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -7490,44 +8677,27 @@ public void testListInstancesWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() + ListEndpointGatewayResourceBindingsOptions listEndpointGatewayResourceBindingsOptions = new ListEndpointGatewayResourceBindingsOptions.Builder() + .endpointGatewayId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .clusterNetworkId("testString") - .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") - .clusterNetworkName("my-cluster-network") - .dedicatedHostId("testString") - .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .dedicatedHostName("my-dedicated-host") - .placementGroupId("testString") - .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") - .placementGroupName("my-placement-group") - .reservationAffinityPolicy("automatic") - .reservationId("testString") - .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .reservationName("my-reservation") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") .build(); - List allResults = new ArrayList<>(); - InstancesPager pager = new InstancesPager(vpcService, listInstancesOptions); + List allResults = new ArrayList<>(); + EndpointGatewayResourceBindingsPager pager = new EndpointGatewayResourceBindingsPager(vpcService, listEndpointGatewayResourceBindingsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listInstances operation using the InstancesPager.getAll() method + // Test the listEndpointGatewayResourceBindings operation using the EndpointGatewayResourceBindingsPager.getAll() method @Test - public void testListInstancesWithPagerGetAll() throws Throwable { + public void testListEndpointGatewayResourceBindingsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"cluster_network\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"name\":\"my-cluster-network\",\"resource_type\":\"cluster_network\"},\"cluster_network_attachments\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"confidential_compute_mode\":\"disabled\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"enable_secure_boot\":true,\"gpu\":{\"count\":1,\"manufacturer\":\"amd\",\"memory\":1,\"model\":\"Tesla V100\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":64,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"numa_count\":2,\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"cluster_network\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"name\":\"my-cluster-network\",\"resource_type\":\"cluster_network\"},\"cluster_network_attachments\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"confidential_compute_mode\":\"disabled\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"enable_secure_boot\":true,\"gpu\":{\"count\":1,\"manufacturer\":\"amd\",\"memory\":1,\"model\":\"Tesla V100\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":64,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"numa_count\":2,\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"resource_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373\",\"id\":\"r006-a7ba95b6-a254-47e4-b129-10593df8a373\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-resource-binding\",\"resource_type\":\"endpoint_gateway_resource_binding\",\"service_endpoint\":\"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud\",\"target\":{\"crn\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\"},\"type\":\"weak\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"resource_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373\",\"id\":\"r006-a7ba95b6-a254-47e4-b129-10593df8a373\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-resource-binding\",\"resource_type\":\"endpoint_gateway_resource_binding\",\"service_endpoint\":\"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud\",\"target\":{\"crn\":\"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\"},\"type\":\"weak\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -7541,248 +8711,44 @@ public void testListInstancesWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() + ListEndpointGatewayResourceBindingsOptions listEndpointGatewayResourceBindingsOptions = new ListEndpointGatewayResourceBindingsOptions.Builder() + .endpointGatewayId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .clusterNetworkId("testString") - .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") - .clusterNetworkName("my-cluster-network") - .dedicatedHostId("testString") - .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .dedicatedHostName("my-dedicated-host") - .placementGroupId("testString") - .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") - .placementGroupName("my-placement-group") - .reservationAffinityPolicy("automatic") - .reservationId("testString") - .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .reservationName("my-reservation") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .build(); - - InstancesPager pager = new InstancesPager(vpcService, listInstancesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createInstance operation with a valid options model parameter - @Test - public void testCreateInstanceWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"cluster_network\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"name\": \"my-cluster-network\", \"resource_type\": \"cluster_network\"}, \"cluster_network_attachments\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"enable_secure_boot\": true, \"gpu\": {\"count\": 1, \"manufacturer\": \"amd\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 64, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"numa_count\": 2, \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createInstancePath = "/instances"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the InstanceAvailabilityPolicyPrototype model - InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() - .hostFailure("restart") - .build(); - - // Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model - ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") - .build(); - - // Construct an instance of the ClusterNetworkSubnetIdentityById model - ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() - .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") - .build(); - - // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model - InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() - .autoDelete(false) - .name("my-cluster-network-interface") - .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) - .subnet(clusterNetworkSubnetIdentityModel) - .build(); - - // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model - InstanceClusterNetworkAttachmentPrototypeInstanceContext instanceClusterNetworkAttachmentPrototypeInstanceContextModel = new InstanceClusterNetworkAttachmentPrototypeInstanceContext.Builder() - .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) - .name("my-instance-network-attachment") - .build(); - - // Construct an instance of the TrustedProfileIdentityById model - TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() - .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") - .build(); - - // Construct an instance of the InstanceDefaultTrustedProfilePrototype model - InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() - .autoLink(false) - .target(trustedProfileIdentityModel) - .build(); - - // Construct an instance of the KeyIdentityById model - KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") - .build(); - - // Construct an instance of the InstanceMetadataServicePrototype model - InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() - .enabled(false) - .protocol("https") - .responseHopLimit(Long.valueOf("2")) - .build(); - - // Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model - InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("r006-418fe842-a3e9-47b9-a938-1aa5bd632871") - .build(); - - // Construct an instance of the InstanceProfileIdentityByName model - InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() - .name("bx2-2x8") - .build(); - - // Construct an instance of the ReservationIdentityById model - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .build(); - - // Construct an instance of the InstanceReservationAffinityPrototype model - InstanceReservationAffinityPrototype instanceReservationAffinityPrototypeModel = new InstanceReservationAffinityPrototype.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) - .build(); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the VolumeProfileIdentityByName model - VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("5iops-tier") - .build(); - - // Construct an instance of the EncryptionKeyIdentityByCRN model - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - // Construct an instance of the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model - VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.Builder() - .bandwidth(Long.valueOf("1000")) - .iops(Long.valueOf("10000")) - .name("my-data-volume") - .profile(volumeProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .capacity(Long.valueOf("1000")) - .encryptionKey(encryptionKeyIdentityModel) - .build(); - - // Construct an instance of the VolumeAttachmentPrototype model - VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype.Builder() - .deleteVolumeOnInstanceDelete(false) - .name("my-volume-attachment") - .volume(volumeAttachmentPrototypeVolumeModel) - .build(); - - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - // Construct an instance of the VolumePrototypeInstanceByImageContext model - VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() - .bandwidth(Long.valueOf("1000")) - .capacity(Long.valueOf("100")) - .encryptionKey(encryptionKeyIdentityModel) - .iops(Long.valueOf("10000")) - .name("my-boot-volume") - .profile(volumeProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .build(); - - // Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model - VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") - .volume(volumePrototypeInstanceByImageContextModel) - .build(); - - // Construct an instance of the ImageIdentityById model - ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .build(); - - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - // Construct an instance of the NetworkInterfacePrototype model - NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() - .allowIpSpoofing(true) - .name("my-instance-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); + EndpointGatewayResourceBindingsPager pager = new EndpointGatewayResourceBindingsPager(vpcService, listEndpointGatewayResourceBindingsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createEndpointGatewayResourceBinding operation with a valid options model parameter + @Test + public void testCreateEndpointGatewayResourceBindingWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373\", \"id\": \"r006-a7ba95b6-a254-47e4-b129-10593df8a373\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-resource-binding\", \"resource_type\": \"endpoint_gateway_resource_binding\", \"service_endpoint\": \"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud\", \"target\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\"}, \"type\": \"weak\"}"; + String createEndpointGatewayResourceBindingPath = "/endpoint_gateways/testString/resource_bindings"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); - // Construct an instance of the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model - InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface instancePrototypeModel = new InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.Builder() - .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) - .clusterNetworkAttachments(java.util.Arrays.asList(instanceClusterNetworkAttachmentPrototypeInstanceContextModel)) - .confidentialComputeMode("disabled") - .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) - .enableSecureBoot(true) - .keys(java.util.Arrays.asList(keyIdentityModel)) - .metadataService(instanceMetadataServicePrototypeModel) - .name("my-instance") - .placementTarget(instancePlacementTargetPrototypeModel) - .profile(instanceProfileIdentityModel) - .reservationAffinity(instanceReservationAffinityPrototypeModel) - .resourceGroup(resourceGroupIdentityModel) - .totalVolumeBandwidth(Long.valueOf("500")) - .userData("testString") - .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) - .vpc(vpcIdentityModel) - .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) - .image(imageIdentityModel) - .zone(zoneIdentityModel) - .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) - .primaryNetworkInterface(networkInterfacePrototypeModel) + // Construct an instance of the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN model + EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN endpointGatewayResourceBindingTargetPrototypeModel = new EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.Builder() + .crn("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue") .build(); - // Construct an instance of the CreateInstanceOptions model - CreateInstanceOptions createInstanceOptionsModel = new CreateInstanceOptions.Builder() - .instancePrototype(instancePrototypeModel) + // Construct an instance of the CreateEndpointGatewayResourceBindingOptions model + CreateEndpointGatewayResourceBindingOptions createEndpointGatewayResourceBindingOptionsModel = new CreateEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .target(endpointGatewayResourceBindingTargetPrototypeModel) + .name("my-resource-binding") .build(); - // Invoke createInstance() with a valid options model and verify the result - Response response = vpcService.createInstance(createInstanceOptionsModel).execute(); + // Invoke createEndpointGatewayResourceBinding() with a valid options model and verify the result + Response response = vpcService.createEndpointGatewayResourceBinding(createEndpointGatewayResourceBindingOptionsModel).execute(); assertNotNull(response); - Instance responseObj = response.getResult(); + EndpointGatewayResourceBinding responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -7791,49 +8757,49 @@ public void testCreateInstanceWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createInstancePath); + assertEquals(parsedPath, createEndpointGatewayResourceBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createInstance operation with and without retries enabled + // Test the createEndpointGatewayResourceBinding operation with and without retries enabled @Test - public void testCreateInstanceWRetries() throws Throwable { + public void testCreateEndpointGatewayResourceBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateInstanceWOptions(); + testCreateEndpointGatewayResourceBindingWOptions(); vpcService.disableRetries(); - testCreateInstanceWOptions(); + testCreateEndpointGatewayResourceBindingWOptions(); } - // Test the createInstance operation with a null options model (negative test) + // Test the createEndpointGatewayResourceBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateInstanceNoOptions() throws Throwable { + public void testCreateEndpointGatewayResourceBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createInstance(null).execute(); + vpcService.createEndpointGatewayResourceBinding(null).execute(); } - // Test the deleteInstance operation with a valid options model parameter + // Test the deleteEndpointGatewayResourceBinding operation with a valid options model parameter @Test - public void testDeleteInstanceWOptions() throws Throwable { + public void testDeleteEndpointGatewayResourceBindingWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteInstancePath = "/instances/testString"; + String deleteEndpointGatewayResourceBindingPath = "/endpoint_gateways/testString/resource_bindings/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteInstanceOptions model - DeleteInstanceOptions deleteInstanceOptionsModel = new DeleteInstanceOptions.Builder() + // Construct an instance of the DeleteEndpointGatewayResourceBindingOptions model + DeleteEndpointGatewayResourceBindingOptions deleteEndpointGatewayResourceBindingOptionsModel = new DeleteEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteInstance() with a valid options model and verify the result - Response response = vpcService.deleteInstance(deleteInstanceOptionsModel).execute(); + // Invoke deleteEndpointGatewayResourceBinding() with a valid options model and verify the result + Response response = vpcService.deleteEndpointGatewayResourceBinding(deleteEndpointGatewayResourceBindingOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -7844,51 +8810,52 @@ public void testDeleteInstanceWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteInstancePath); + assertEquals(parsedPath, deleteEndpointGatewayResourceBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteInstance operation with and without retries enabled + // Test the deleteEndpointGatewayResourceBinding operation with and without retries enabled @Test - public void testDeleteInstanceWRetries() throws Throwable { + public void testDeleteEndpointGatewayResourceBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteInstanceWOptions(); + testDeleteEndpointGatewayResourceBindingWOptions(); vpcService.disableRetries(); - testDeleteInstanceWOptions(); + testDeleteEndpointGatewayResourceBindingWOptions(); } - // Test the deleteInstance operation with a null options model (negative test) + // Test the deleteEndpointGatewayResourceBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteInstanceNoOptions() throws Throwable { + public void testDeleteEndpointGatewayResourceBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteInstance(null).execute(); + vpcService.deleteEndpointGatewayResourceBinding(null).execute(); } - // Test the getInstance operation with a valid options model parameter + // Test the getEndpointGatewayResourceBinding operation with a valid options model parameter @Test - public void testGetInstanceWOptions() throws Throwable { + public void testGetEndpointGatewayResourceBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"cluster_network\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"name\": \"my-cluster-network\", \"resource_type\": \"cluster_network\"}, \"cluster_network_attachments\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"enable_secure_boot\": true, \"gpu\": {\"count\": 1, \"manufacturer\": \"amd\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 64, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"numa_count\": 2, \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getInstancePath = "/instances/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373\", \"id\": \"r006-a7ba95b6-a254-47e4-b129-10593df8a373\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-resource-binding\", \"resource_type\": \"endpoint_gateway_resource_binding\", \"service_endpoint\": \"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud\", \"target\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\"}, \"type\": \"weak\"}"; + String getEndpointGatewayResourceBindingPath = "/endpoint_gateways/testString/resource_bindings/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceOptions model - GetInstanceOptions getInstanceOptionsModel = new GetInstanceOptions.Builder() + // Construct an instance of the GetEndpointGatewayResourceBindingOptions model + GetEndpointGatewayResourceBindingOptions getEndpointGatewayResourceBindingOptionsModel = new GetEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") .id("testString") .build(); - // Invoke getInstance() with a valid options model and verify the result - Response response = vpcService.getInstance(getInstanceOptionsModel).execute(); + // Invoke getEndpointGatewayResourceBinding() with a valid options model and verify the result + Response response = vpcService.getEndpointGatewayResourceBinding(getEndpointGatewayResourceBindingOptionsModel).execute(); assertNotNull(response); - Instance responseObj = response.getResult(); + EndpointGatewayResourceBinding responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -7897,153 +8864,164 @@ public void testGetInstanceWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstancePath); + assertEquals(parsedPath, getEndpointGatewayResourceBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstance operation with and without retries enabled + // Test the getEndpointGatewayResourceBinding operation with and without retries enabled @Test - public void testGetInstanceWRetries() throws Throwable { + public void testGetEndpointGatewayResourceBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceWOptions(); + testGetEndpointGatewayResourceBindingWOptions(); vpcService.disableRetries(); - testGetInstanceWOptions(); + testGetEndpointGatewayResourceBindingWOptions(); } - // Test the getInstance operation with a null options model (negative test) + // Test the getEndpointGatewayResourceBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceNoOptions() throws Throwable { + public void testGetEndpointGatewayResourceBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstance(null).execute(); + vpcService.getEndpointGatewayResourceBinding(null).execute(); } - // Test the updateInstance operation with a valid options model parameter + // Test the updateEndpointGatewayResourceBinding operation with a valid options model parameter @Test - public void testUpdateInstanceWOptions() throws Throwable { + public void testUpdateEndpointGatewayResourceBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"cluster_network\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"name\": \"my-cluster-network\", \"resource_type\": \"cluster_network\"}, \"cluster_network_attachments\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"enable_secure_boot\": true, \"gpu\": {\"count\": 1, \"manufacturer\": \"amd\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 64, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"numa_count\": 2, \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateInstancePath = "/instances/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0/resource_bindings/r006-a7ba95b6-a254-47e4-b129-10593df8a373\", \"id\": \"r006-a7ba95b6-a254-47e4-b129-10593df8a373\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-resource-binding\", \"resource_type\": \"endpoint_gateway_resource_binding\", \"service_endpoint\": \"bucket-27200-lwx4cfvcue.s3.direct.us-south.cloud-object-storage.appdomain.cloud\", \"target\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\"}, \"type\": \"weak\"}"; + String updateEndpointGatewayResourceBindingPath = "/endpoint_gateways/testString/resource_bindings/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the InstanceAvailabilityPolicyPatch model - InstanceAvailabilityPolicyPatch instanceAvailabilityPolicyPatchModel = new InstanceAvailabilityPolicyPatch.Builder() - .hostFailure("restart") + // Construct an instance of the EndpointGatewayResourceBindingPatch model + EndpointGatewayResourceBindingPatch endpointGatewayResourceBindingPatchModel = new EndpointGatewayResourceBindingPatch.Builder() + .name("my-resource-binding-updated") .build(); + Map endpointGatewayResourceBindingPatchModelAsPatch = endpointGatewayResourceBindingPatchModel.asPatch(); - // Construct an instance of the InstanceMetadataServicePatch model - InstanceMetadataServicePatch instanceMetadataServicePatchModel = new InstanceMetadataServicePatch.Builder() - .enabled(true) - .protocol("http") - .responseHopLimit(Long.valueOf("1")) + // Construct an instance of the UpdateEndpointGatewayResourceBindingOptions model + UpdateEndpointGatewayResourceBindingOptions updateEndpointGatewayResourceBindingOptionsModel = new UpdateEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .id("testString") + .endpointGatewayResourceBindingPatch(endpointGatewayResourceBindingPatchModelAsPatch) .build(); - // Construct an instance of the InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById model - InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPatchModel = new InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.Builder() - .id("0717-1e09281b-f177-46fb-baf1-bc152b2e391a") - .build(); + // Invoke updateEndpointGatewayResourceBinding() with a valid options model and verify the result + Response response = vpcService.updateEndpointGatewayResourceBinding(updateEndpointGatewayResourceBindingOptionsModel).execute(); + assertNotNull(response); + EndpointGatewayResourceBinding responseObj = response.getResult(); + assertNotNull(responseObj); - // Construct an instance of the InstancePatchProfileInstanceProfileIdentityByName model - InstancePatchProfileInstanceProfileIdentityByName instancePatchProfileModel = new InstancePatchProfileInstanceProfileIdentityByName.Builder() - .name("bx2-4x16") - .build(); + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateEndpointGatewayResourceBindingPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } - // Construct an instance of the ReservationIdentityById model - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .build(); + // Test the updateEndpointGatewayResourceBinding operation with and without retries enabled + @Test + public void testUpdateEndpointGatewayResourceBindingWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testUpdateEndpointGatewayResourceBindingWOptions(); - // Construct an instance of the InstanceReservationAffinityPatch model - InstanceReservationAffinityPatch instanceReservationAffinityPatchModel = new InstanceReservationAffinityPatch.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) - .build(); + vpcService.disableRetries(); + testUpdateEndpointGatewayResourceBindingWOptions(); + } - // Construct an instance of the InstancePatch model - InstancePatch instancePatchModel = new InstancePatch.Builder() - .availabilityPolicy(instanceAvailabilityPolicyPatchModel) - .confidentialComputeMode("disabled") - .enableSecureBoot(true) - .metadataService(instanceMetadataServicePatchModel) - .name("my-instance") - .placementTarget(instancePlacementTargetPatchModel) - .profile(instancePatchProfileModel) - .reservationAffinity(instanceReservationAffinityPatchModel) - .totalVolumeBandwidth(Long.valueOf("500")) - .build(); - Map instancePatchModelAsPatch = instancePatchModel.asPatch(); + // Test the updateEndpointGatewayResourceBinding operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateEndpointGatewayResourceBindingNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateEndpointGatewayResourceBinding(null).execute(); + } - // Construct an instance of the UpdateInstanceOptions model - UpdateInstanceOptions updateInstanceOptionsModel = new UpdateInstanceOptions.Builder() + // Test the deleteEndpointGateway operation with a valid options model parameter + @Test + public void testDeleteEndpointGatewayWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteEndpointGatewayPath = "/endpoint_gateways/testString"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteEndpointGatewayOptions model + DeleteEndpointGatewayOptions deleteEndpointGatewayOptionsModel = new DeleteEndpointGatewayOptions.Builder() .id("testString") - .instancePatch(instancePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateInstance() with a valid options model and verify the result - Response response = vpcService.updateInstance(updateInstanceOptionsModel).execute(); + // Invoke deleteEndpointGateway() with a valid options model and verify the result + Response response = vpcService.deleteEndpointGateway(deleteEndpointGatewayOptionsModel).execute(); assertNotNull(response); - Instance responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateInstancePath); + assertEquals(parsedPath, deleteEndpointGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateInstance operation with and without retries enabled + // Test the deleteEndpointGateway operation with and without retries enabled @Test - public void testUpdateInstanceWRetries() throws Throwable { + public void testDeleteEndpointGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateInstanceWOptions(); + testDeleteEndpointGatewayWOptions(); vpcService.disableRetries(); - testUpdateInstanceWOptions(); + testDeleteEndpointGatewayWOptions(); } - // Test the updateInstance operation with a null options model (negative test) + // Test the deleteEndpointGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateInstanceNoOptions() throws Throwable { + public void testDeleteEndpointGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateInstance(null).execute(); + vpcService.deleteEndpointGateway(null).execute(); } - // Test the getInstanceInitialization operation with a valid options model parameter + // Test the getEndpointGateway operation with a valid options model parameter @Test - public void testGetInstanceInitializationWOptions() throws Throwable { + public void testGetEndpointGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"default_trusted_profile\": {\"auto_link\": true, \"target\": {\"crn\": \"crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\", \"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\", \"resource_type\": \"trusted_profile\"}}, \"keys\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}], \"password\": {\"encrypted_password\": \"qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==\", \"encryption_key\": {\"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\"}}}"; - String getInstanceInitializationPath = "/instances/testString/initialization"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"dns_resolution_binding_mode\": \"primary\", \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_reasons\": [{\"code\": \"dns_resolution_binding_pending\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-endpoint-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"endpoint_gateway\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"service_endpoint\": \"my-cloudant-instance.appdomain.cloud\", \"service_endpoints\": [\"my-cloudant-instance.appdomain.cloud\"], \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"name\": \"my-private-path-service-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"private_path_service_gateway\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getEndpointGatewayPath = "/endpoint_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceInitializationOptions model - GetInstanceInitializationOptions getInstanceInitializationOptionsModel = new GetInstanceInitializationOptions.Builder() + // Construct an instance of the GetEndpointGatewayOptions model + GetEndpointGatewayOptions getEndpointGatewayOptionsModel = new GetEndpointGatewayOptions.Builder() .id("testString") .build(); - // Invoke getInstanceInitialization() with a valid options model and verify the result - Response response = vpcService.getInstanceInitialization(getInstanceInitializationOptionsModel).execute(); + // Invoke getEndpointGateway() with a valid options model and verify the result + Response response = vpcService.getEndpointGateway(getEndpointGatewayOptionsModel).execute(); assertNotNull(response); - InstanceInitialization responseObj = response.getResult(); + EndpointGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -8052,108 +9030,119 @@ public void testGetInstanceInitializationWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceInitializationPath); + assertEquals(parsedPath, getEndpointGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceInitialization operation with and without retries enabled + // Test the getEndpointGateway operation with and without retries enabled @Test - public void testGetInstanceInitializationWRetries() throws Throwable { + public void testGetEndpointGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceInitializationWOptions(); + testGetEndpointGatewayWOptions(); vpcService.disableRetries(); - testGetInstanceInitializationWOptions(); + testGetEndpointGatewayWOptions(); } - // Test the getInstanceInitialization operation with a null options model (negative test) + // Test the getEndpointGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceInitializationNoOptions() throws Throwable { + public void testGetEndpointGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceInitialization(null).execute(); + vpcService.getEndpointGateway(null).execute(); } - // Test the createInstanceAction operation with a valid options model parameter + // Test the updateEndpointGateway operation with a valid options model parameter @Test - public void testCreateInstanceActionWOptions() throws Throwable { + public void testUpdateEndpointGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"force\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/actions/109a1b6e-1242-4de1-be44-38705e9474ed\", \"id\": \"109a1b6e-1242-4de1-be44-38705e9474ed\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"completed\", \"type\": \"reboot\"}"; - String createInstanceActionPath = "/instances/testString/actions"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"dns_resolution_binding_mode\": \"primary\", \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_reasons\": [{\"code\": \"dns_resolution_binding_pending\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-endpoint-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"endpoint_gateway\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"service_endpoint\": \"my-cloudant-instance.appdomain.cloud\", \"service_endpoints\": [\"my-cloudant-instance.appdomain.cloud\"], \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"name\": \"my-private-path-service-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"private_path_service_gateway\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String updateEndpointGatewayPath = "/endpoint_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the CreateInstanceActionOptions model - CreateInstanceActionOptions createInstanceActionOptionsModel = new CreateInstanceActionOptions.Builder() - .instanceId("testString") - .type("reboot") - .force(true) + // Construct an instance of the EndpointGatewayPatch model + EndpointGatewayPatch endpointGatewayPatchModel = new EndpointGatewayPatch.Builder() + .dnsResolutionBindingMode("disabled") + .name("my-endpoint-gateway") .build(); + Map endpointGatewayPatchModelAsPatch = endpointGatewayPatchModel.asPatch(); - // Invoke createInstanceAction() with a valid options model and verify the result - Response response = vpcService.createInstanceAction(createInstanceActionOptionsModel).execute(); + // Construct an instance of the UpdateEndpointGatewayOptions model + UpdateEndpointGatewayOptions updateEndpointGatewayOptionsModel = new UpdateEndpointGatewayOptions.Builder() + .id("testString") + .endpointGatewayPatch(endpointGatewayPatchModelAsPatch) + .build(); + + // Invoke updateEndpointGateway() with a valid options model and verify the result + Response response = vpcService.updateEndpointGateway(updateEndpointGatewayOptionsModel).execute(); assertNotNull(response); - InstanceAction responseObj = response.getResult(); + EndpointGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createInstanceActionPath); + assertEquals(parsedPath, updateEndpointGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createInstanceAction operation with and without retries enabled + // Test the updateEndpointGateway operation with and without retries enabled @Test - public void testCreateInstanceActionWRetries() throws Throwable { + public void testUpdateEndpointGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateInstanceActionWOptions(); + testUpdateEndpointGatewayWOptions(); vpcService.disableRetries(); - testCreateInstanceActionWOptions(); + testUpdateEndpointGatewayWOptions(); } - // Test the createInstanceAction operation with a null options model (negative test) + // Test the updateEndpointGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateInstanceActionNoOptions() throws Throwable { + public void testUpdateEndpointGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createInstanceAction(null).execute(); + vpcService.updateEndpointGateway(null).execute(); } - // Test the listInstanceClusterNetworkAttachments operation with a valid options model parameter + // Test the listFloatingIps operation with a valid options model parameter @Test - public void testListInstanceClusterNetworkAttachmentsWOptions() throws Throwable { + public void testListFloatingIpsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cluster_network_attachments\": [{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listInstanceClusterNetworkAttachmentsPath = "/instances/testString/cluster_network_attachments"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listFloatingIpsPath = "/floating_ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceClusterNetworkAttachmentsOptions model - ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptionsModel = new ListInstanceClusterNetworkAttachmentsOptions.Builder() - .instanceId("testString") + // Construct an instance of the ListFloatingIpsOptions model + ListFloatingIpsOptions listFloatingIpsOptionsModel = new ListFloatingIpsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); - // Invoke listInstanceClusterNetworkAttachments() with a valid options model and verify the result - Response response = vpcService.listInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModel).execute(); + // Invoke listFloatingIps() with a valid options model and verify the result + Response response = vpcService.listFloatingIps(listFloatingIpsOptionsModel).execute(); assertNotNull(response); - InstanceClusterNetworkAttachmentCollection responseObj = response.getResult(); + FloatingIPCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -8162,39 +9151,38 @@ public void testListInstanceClusterNetworkAttachmentsWOptions() throws Throwable assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceClusterNetworkAttachmentsPath); + assertEquals(parsedPath, listFloatingIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("sort"), "name"); + assertEquals(query.get("target.id"), "testString"); + assertEquals(query.get("target.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"); + assertEquals(query.get("target.name"), "my-resource"); + assertEquals(query.get("target.resource_type"), "testString"); } - // Test the listInstanceClusterNetworkAttachments operation with and without retries enabled + // Test the listFloatingIps operation with and without retries enabled @Test - public void testListInstanceClusterNetworkAttachmentsWRetries() throws Throwable { + public void testListFloatingIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceClusterNetworkAttachmentsWOptions(); + testListFloatingIpsWOptions(); vpcService.disableRetries(); - testListInstanceClusterNetworkAttachmentsWOptions(); - } - - // Test the listInstanceClusterNetworkAttachments operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListInstanceClusterNetworkAttachmentsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listInstanceClusterNetworkAttachments(null).execute(); + testListFloatingIpsWOptions(); } - // Test the listInstanceClusterNetworkAttachments operation using the InstanceClusterNetworkAttachmentsPager.getNext() method + // Test the listFloatingIps operation using the FloatingIpsPager.getNext() method @Test - public void testListInstanceClusterNetworkAttachmentsWithPagerGetNext() throws Throwable { + public void testListFloatingIpsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"cluster_network_attachments\":[{\"before\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"cluster_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"}},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"limit\":1}"; - String mockResponsePage2 = "{\"total_count\":2,\"cluster_network_attachments\":[{\"before\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"cluster_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"}},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -8208,27 +9196,32 @@ public void testListInstanceClusterNetworkAttachmentsWithPagerGetNext() throws T .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptions = new ListInstanceClusterNetworkAttachmentsOptions.Builder() - .instanceId("testString") + ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); - List allResults = new ArrayList<>(); - InstanceClusterNetworkAttachmentsPager pager = new InstanceClusterNetworkAttachmentsPager(vpcService, listInstanceClusterNetworkAttachmentsOptions); + List allResults = new ArrayList<>(); + FloatingIpsPager pager = new FloatingIpsPager(vpcService, listFloatingIpsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listInstanceClusterNetworkAttachments operation using the InstanceClusterNetworkAttachmentsPager.getAll() method + // Test the listFloatingIps operation using the FloatingIpsPager.getAll() method @Test - public void testListInstanceClusterNetworkAttachmentsWithPagerGetAll() throws Throwable { + public void testListFloatingIpsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"cluster_network_attachments\":[{\"before\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"cluster_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"}},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"limit\":1}"; - String mockResponsePage2 = "{\"total_count\":2,\"cluster_network_attachments\":[{\"before\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"cluster_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"}},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -8242,65 +9235,59 @@ public void testListInstanceClusterNetworkAttachmentsWithPagerGetAll() throws Th .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptions = new ListInstanceClusterNetworkAttachmentsOptions.Builder() - .instanceId("testString") + ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); - InstanceClusterNetworkAttachmentsPager pager = new InstanceClusterNetworkAttachmentsPager(vpcService, listInstanceClusterNetworkAttachmentsOptions); - List allResults = pager.getAll(); + FloatingIpsPager pager = new FloatingIpsPager(vpcService, listFloatingIpsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createClusterNetworkAttachment operation with a valid options model parameter + // Test the createFloatingIp operation with a valid options model parameter @Test - public void testCreateClusterNetworkAttachmentWOptions() throws Throwable { + public void testCreateFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}"; - String createClusterNetworkAttachmentPath = "/instances/testString/cluster_network_attachments"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createFloatingIpPath = "/floating_ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model - ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") - .build(); - - // Construct an instance of the ClusterNetworkSubnetIdentityById model - ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() - .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model - InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() - .autoDelete(false) - .name("my-cluster-network-interface") - .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) - .subnet(clusterNetworkSubnetIdentityModel) + // Construct an instance of the FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model + FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById floatingIpTargetPrototypeModel = new FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.Builder() + .id("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef") .build(); - // Construct an instance of the InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById model - InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById instanceClusterNetworkAttachmentBeforePrototypeModel = new InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById.Builder() - .id("0717-fb880975-db45-4459-8548-64e3995ac213") + // Construct an instance of the FloatingIPPrototypeFloatingIPByTarget model + FloatingIPPrototypeFloatingIPByTarget floatingIpPrototypeModel = new FloatingIPPrototypeFloatingIPByTarget.Builder() + .name("my-floating-ip") + .resourceGroup(resourceGroupIdentityModel) + .target(floatingIpTargetPrototypeModel) .build(); - // Construct an instance of the CreateClusterNetworkAttachmentOptions model - CreateClusterNetworkAttachmentOptions createClusterNetworkAttachmentOptionsModel = new CreateClusterNetworkAttachmentOptions.Builder() - .instanceId("testString") - .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) - .before(instanceClusterNetworkAttachmentBeforePrototypeModel) - .name("my-instance-network-attachment") + // Construct an instance of the CreateFloatingIpOptions model + CreateFloatingIpOptions createFloatingIpOptionsModel = new CreateFloatingIpOptions.Builder() + .floatingIpPrototype(floatingIpPrototypeModel) .build(); - // Invoke createClusterNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.createClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModel).execute(); + // Invoke createFloatingIp() with a valid options model and verify the result + Response response = vpcService.createFloatingIp(createFloatingIpOptionsModel).execute(); assertNotNull(response); - InstanceClusterNetworkAttachment responseObj = response.getResult(); + FloatingIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -8309,53 +9296,51 @@ public void testCreateClusterNetworkAttachmentWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createClusterNetworkAttachmentPath); + assertEquals(parsedPath, createFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createClusterNetworkAttachment operation with and without retries enabled + // Test the createFloatingIp operation with and without retries enabled @Test - public void testCreateClusterNetworkAttachmentWRetries() throws Throwable { + public void testCreateFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateClusterNetworkAttachmentWOptions(); + testCreateFloatingIpWOptions(); vpcService.disableRetries(); - testCreateClusterNetworkAttachmentWOptions(); + testCreateFloatingIpWOptions(); } - // Test the createClusterNetworkAttachment operation with a null options model (negative test) + // Test the createFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateClusterNetworkAttachmentNoOptions() throws Throwable { + public void testCreateFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createClusterNetworkAttachment(null).execute(); + vpcService.createFloatingIp(null).execute(); } - // Test the deleteInstanceClusterNetworkAttachment operation with a valid options model parameter + // Test the deleteFloatingIp operation with a valid options model parameter @Test - public void testDeleteInstanceClusterNetworkAttachmentWOptions() throws Throwable { + public void testDeleteFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}"; - String deleteInstanceClusterNetworkAttachmentPath = "/instances/testString/cluster_network_attachments/testString"; + String mockResponseBody = ""; + String deleteFloatingIpPath = "/floating_ips/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteInstanceClusterNetworkAttachmentOptions model - DeleteInstanceClusterNetworkAttachmentOptions deleteInstanceClusterNetworkAttachmentOptionsModel = new DeleteInstanceClusterNetworkAttachmentOptions.Builder() - .instanceId("testString") + // Construct an instance of the DeleteFloatingIpOptions model + DeleteFloatingIpOptions deleteFloatingIpOptionsModel = new DeleteFloatingIpOptions.Builder() .id("testString") .build(); - // Invoke deleteInstanceClusterNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.deleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModel).execute(); + // Invoke deleteFloatingIp() with a valid options model and verify the result + Response response = vpcService.deleteFloatingIp(deleteFloatingIpOptionsModel).execute(); assertNotNull(response); - InstanceClusterNetworkAttachment responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -8363,52 +9348,51 @@ public void testDeleteInstanceClusterNetworkAttachmentWOptions() throws Throwabl assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteInstanceClusterNetworkAttachmentPath); + assertEquals(parsedPath, deleteFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteInstanceClusterNetworkAttachment operation with and without retries enabled + // Test the deleteFloatingIp operation with and without retries enabled @Test - public void testDeleteInstanceClusterNetworkAttachmentWRetries() throws Throwable { + public void testDeleteFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteInstanceClusterNetworkAttachmentWOptions(); + testDeleteFloatingIpWOptions(); vpcService.disableRetries(); - testDeleteInstanceClusterNetworkAttachmentWOptions(); + testDeleteFloatingIpWOptions(); } - // Test the deleteInstanceClusterNetworkAttachment operation with a null options model (negative test) + // Test the deleteFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteInstanceClusterNetworkAttachmentNoOptions() throws Throwable { + public void testDeleteFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteInstanceClusterNetworkAttachment(null).execute(); + vpcService.deleteFloatingIp(null).execute(); } - // Test the getInstanceClusterNetworkAttachment operation with a valid options model parameter + // Test the getFloatingIp operation with a valid options model parameter @Test - public void testGetInstanceClusterNetworkAttachmentWOptions() throws Throwable { + public void testGetFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}"; - String getInstanceClusterNetworkAttachmentPath = "/instances/testString/cluster_network_attachments/testString"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getFloatingIpPath = "/floating_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceClusterNetworkAttachmentOptions model - GetInstanceClusterNetworkAttachmentOptions getInstanceClusterNetworkAttachmentOptionsModel = new GetInstanceClusterNetworkAttachmentOptions.Builder() - .instanceId("testString") + // Construct an instance of the GetFloatingIpOptions model + GetFloatingIpOptions getFloatingIpOptionsModel = new GetFloatingIpOptions.Builder() .id("testString") .build(); - // Invoke getInstanceClusterNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.getInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModel).execute(); + // Invoke getFloatingIp() with a valid options model and verify the result + Response response = vpcService.getFloatingIp(getFloatingIpOptionsModel).execute(); assertNotNull(response); - InstanceClusterNetworkAttachment responseObj = response.getResult(); + FloatingIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -8417,59 +9401,64 @@ public void testGetInstanceClusterNetworkAttachmentWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceClusterNetworkAttachmentPath); + assertEquals(parsedPath, getFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceClusterNetworkAttachment operation with and without retries enabled + // Test the getFloatingIp operation with and without retries enabled @Test - public void testGetInstanceClusterNetworkAttachmentWRetries() throws Throwable { + public void testGetFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceClusterNetworkAttachmentWOptions(); + testGetFloatingIpWOptions(); vpcService.disableRetries(); - testGetInstanceClusterNetworkAttachmentWOptions(); + testGetFloatingIpWOptions(); } - // Test the getInstanceClusterNetworkAttachment operation with a null options model (negative test) + // Test the getFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceClusterNetworkAttachmentNoOptions() throws Throwable { + public void testGetFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceClusterNetworkAttachment(null).execute(); + vpcService.getFloatingIp(null).execute(); } - // Test the updateInstanceClusterNetworkAttachment operation with a valid options model parameter + // Test the updateFloatingIp operation with a valid options model parameter @Test - public void testUpdateInstanceClusterNetworkAttachmentWOptions() throws Throwable { + public void testUpdateFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}"; - String updateInstanceClusterNetworkAttachmentPath = "/instances/testString/cluster_network_attachments/testString"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateFloatingIpPath = "/floating_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the InstanceClusterNetworkAttachmentPatch model - InstanceClusterNetworkAttachmentPatch instanceClusterNetworkAttachmentPatchModel = new InstanceClusterNetworkAttachmentPatch.Builder() - .name("my-instance-network-attachment-updated") + // Construct an instance of the FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model + FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById floatingIpTargetPatchModel = new FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.Builder() + .id("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6") .build(); - Map instanceClusterNetworkAttachmentPatchModelAsPatch = instanceClusterNetworkAttachmentPatchModel.asPatch(); - // Construct an instance of the UpdateInstanceClusterNetworkAttachmentOptions model - UpdateInstanceClusterNetworkAttachmentOptions updateInstanceClusterNetworkAttachmentOptionsModel = new UpdateInstanceClusterNetworkAttachmentOptions.Builder() - .instanceId("testString") + // Construct an instance of the FloatingIPPatch model + FloatingIPPatch floatingIpPatchModel = new FloatingIPPatch.Builder() + .name("my-floating-ip") + .target(floatingIpTargetPatchModel) + .build(); + Map floatingIpPatchModelAsPatch = floatingIpPatchModel.asPatch(); + + // Construct an instance of the UpdateFloatingIpOptions model + UpdateFloatingIpOptions updateFloatingIpOptionsModel = new UpdateFloatingIpOptions.Builder() .id("testString") - .instanceClusterNetworkAttachmentPatch(instanceClusterNetworkAttachmentPatchModelAsPatch) + .floatingIpPatch(floatingIpPatchModelAsPatch) .build(); - // Invoke updateInstanceClusterNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.updateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModel).execute(); + // Invoke updateFloatingIp() with a valid options model and verify the result + Response response = vpcService.updateFloatingIp(updateFloatingIpOptionsModel).execute(); assertNotNull(response); - InstanceClusterNetworkAttachment responseObj = response.getResult(); + FloatingIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -8478,479 +9467,525 @@ public void testUpdateInstanceClusterNetworkAttachmentWOptions() throws Throwabl assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateInstanceClusterNetworkAttachmentPath); + assertEquals(parsedPath, updateFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateInstanceClusterNetworkAttachment operation with and without retries enabled + // Test the updateFloatingIp operation with and without retries enabled @Test - public void testUpdateInstanceClusterNetworkAttachmentWRetries() throws Throwable { + public void testUpdateFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateInstanceClusterNetworkAttachmentWOptions(); + testUpdateFloatingIpWOptions(); vpcService.disableRetries(); - testUpdateInstanceClusterNetworkAttachmentWOptions(); + testUpdateFloatingIpWOptions(); } - // Test the updateInstanceClusterNetworkAttachment operation with a null options model (negative test) + // Test the updateFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateInstanceClusterNetworkAttachmentNoOptions() throws Throwable { + public void testUpdateFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateInstanceClusterNetworkAttachment(null).execute(); + vpcService.updateFloatingIp(null).execute(); } - // Test the createInstanceConsoleAccessToken operation with a valid options model parameter + // Test the listFlowLogCollectors operation with a valid options model parameter @Test - public void testCreateInstanceConsoleAccessTokenWOptions() throws Throwable { + public void testListFlowLogCollectorsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI\", \"console_type\": \"serial\", \"created_at\": \"2020-07-27T21:50:14.000Z\", \"expires_at\": \"2020-07-27T21:51:14.000Z\", \"force\": false, \"href\": \"wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI\"}"; - String createInstanceConsoleAccessTokenPath = "/instances/testString/console_access_token"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"flow_log_collectors\": [{\"active\": true, \"auto_delete\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"id\": \"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"lifecycle_state\": \"stable\", \"name\": \"my-flow-log-collector\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"storage_bucket\": {\"name\": \"bucket-27200-lwx4cfvcue\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"resource_type\": \"network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listFlowLogCollectorsPath = "/flow_log_collectors"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the CreateInstanceConsoleAccessTokenOptions model - CreateInstanceConsoleAccessTokenOptions createInstanceConsoleAccessTokenOptionsModel = new CreateInstanceConsoleAccessTokenOptions.Builder() - .instanceId("testString") - .consoleType("serial") - .force(false) + // Construct an instance of the ListFlowLogCollectorsOptions model + ListFlowLogCollectorsOptions listFlowLogCollectorsOptionsModel = new ListFlowLogCollectorsOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .targetId("testString") + .targetResourceType("testString") .build(); - // Invoke createInstanceConsoleAccessToken() with a valid options model and verify the result - Response response = vpcService.createInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModel).execute(); + // Invoke listFlowLogCollectors() with a valid options model and verify the result + Response response = vpcService.listFlowLogCollectors(listFlowLogCollectorsOptionsModel).execute(); assertNotNull(response); - InstanceConsoleAccessToken responseObj = response.getResult(); + FlowLogCollectorCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createInstanceConsoleAccessTokenPath); + assertEquals(parsedPath, listFlowLogCollectorsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("vpc.id"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); + assertEquals(query.get("target.id"), "testString"); + assertEquals(query.get("target.resource_type"), "testString"); } - // Test the createInstanceConsoleAccessToken operation with and without retries enabled + // Test the listFlowLogCollectors operation with and without retries enabled @Test - public void testCreateInstanceConsoleAccessTokenWRetries() throws Throwable { + public void testListFlowLogCollectorsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateInstanceConsoleAccessTokenWOptions(); + testListFlowLogCollectorsWOptions(); vpcService.disableRetries(); - testCreateInstanceConsoleAccessTokenWOptions(); + testListFlowLogCollectorsWOptions(); } - // Test the createInstanceConsoleAccessToken operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateInstanceConsoleAccessTokenNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createInstanceConsoleAccessToken(null).execute(); + // Test the listFlowLogCollectors operation using the FlowLogCollectorsPager.getNext() method + @Test + public void testListFlowLogCollectorsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"id\":\"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"id\":\"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .targetId("testString") + .targetResourceType("testString") + .build(); + + List allResults = new ArrayList<>(); + FlowLogCollectorsPager pager = new FlowLogCollectorsPager(vpcService, listFlowLogCollectorsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } + + // Test the listFlowLogCollectors operation using the FlowLogCollectorsPager.getAll() method + @Test + public void testListFlowLogCollectorsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"id\":\"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"id\":\"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Test the listInstanceDisks operation with a valid options model parameter + ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .targetId("testString") + .targetResourceType("testString") + .build(); + + FlowLogCollectorsPager pager = new FlowLogCollectorsPager(vpcService, listFlowLogCollectorsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createFlowLogCollector operation with a valid options model parameter @Test - public void testListInstanceDisksWOptions() throws Throwable { + public void testCreateFlowLogCollectorWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}]}"; - String listInstanceDisksPath = "/instances/testString/disks"; + String mockResponseBody = "{\"active\": true, \"auto_delete\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"id\": \"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"lifecycle_state\": \"stable\", \"name\": \"my-flow-log-collector\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"storage_bucket\": {\"name\": \"bucket-27200-lwx4cfvcue\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"resource_type\": \"network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String createFlowLogCollectorPath = "/flow_log_collectors"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceDisksOptions model - ListInstanceDisksOptions listInstanceDisksOptionsModel = new ListInstanceDisksOptions.Builder() - .instanceId("testString") + // Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName legacyCloudObjectStorageBucketIdentityModel = new LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() + .name("bucket-27200-lwx4cfvcue") .build(); - // Invoke listInstanceDisks() with a valid options model and verify the result - Response response = vpcService.listInstanceDisks(listInstanceDisksOptionsModel).execute(); + // Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model + FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById flowLogCollectorTargetPrototypeModel = new FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.Builder() + .id("0717-d54eb633-98ea-459d-aa00-6a8e780175a7") + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the CreateFlowLogCollectorOptions model + CreateFlowLogCollectorOptions createFlowLogCollectorOptionsModel = new CreateFlowLogCollectorOptions.Builder() + .storageBucket(legacyCloudObjectStorageBucketIdentityModel) + .target(flowLogCollectorTargetPrototypeModel) + .active(false) + .name("my-flow-log-collector") + .resourceGroup(resourceGroupIdentityModel) + .build(); + + // Invoke createFlowLogCollector() with a valid options model and verify the result + Response response = vpcService.createFlowLogCollector(createFlowLogCollectorOptionsModel).execute(); assertNotNull(response); - InstanceDiskCollection responseObj = response.getResult(); + FlowLogCollector responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceDisksPath); + assertEquals(parsedPath, createFlowLogCollectorPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listInstanceDisks operation with and without retries enabled + // Test the createFlowLogCollector operation with and without retries enabled @Test - public void testListInstanceDisksWRetries() throws Throwable { + public void testCreateFlowLogCollectorWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceDisksWOptions(); + testCreateFlowLogCollectorWOptions(); vpcService.disableRetries(); - testListInstanceDisksWOptions(); + testCreateFlowLogCollectorWOptions(); } - // Test the listInstanceDisks operation with a null options model (negative test) + // Test the createFlowLogCollector operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListInstanceDisksNoOptions() throws Throwable { + public void testCreateFlowLogCollectorNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listInstanceDisks(null).execute(); + vpcService.createFlowLogCollector(null).execute(); } - // Test the getInstanceDisk operation with a valid options model parameter + // Test the deleteFlowLogCollector operation with a valid options model parameter @Test - public void testGetInstanceDiskWOptions() throws Throwable { + public void testDeleteFlowLogCollectorWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}"; - String getInstanceDiskPath = "/instances/testString/disks/testString"; + String mockResponseBody = ""; + String deleteFlowLogCollectorPath = "/flow_log_collectors/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceDiskOptions model - GetInstanceDiskOptions getInstanceDiskOptionsModel = new GetInstanceDiskOptions.Builder() - .instanceId("testString") + // Construct an instance of the DeleteFlowLogCollectorOptions model + DeleteFlowLogCollectorOptions deleteFlowLogCollectorOptionsModel = new DeleteFlowLogCollectorOptions.Builder() .id("testString") .build(); - // Invoke getInstanceDisk() with a valid options model and verify the result - Response response = vpcService.getInstanceDisk(getInstanceDiskOptionsModel).execute(); + // Invoke deleteFlowLogCollector() with a valid options model and verify the result + Response response = vpcService.deleteFlowLogCollector(deleteFlowLogCollectorOptionsModel).execute(); assertNotNull(response); - InstanceDisk responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceDiskPath); + assertEquals(parsedPath, deleteFlowLogCollectorPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceDisk operation with and without retries enabled + // Test the deleteFlowLogCollector operation with and without retries enabled @Test - public void testGetInstanceDiskWRetries() throws Throwable { + public void testDeleteFlowLogCollectorWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceDiskWOptions(); + testDeleteFlowLogCollectorWOptions(); vpcService.disableRetries(); - testGetInstanceDiskWOptions(); + testDeleteFlowLogCollectorWOptions(); } - // Test the getInstanceDisk operation with a null options model (negative test) + // Test the deleteFlowLogCollector operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceDiskNoOptions() throws Throwable { + public void testDeleteFlowLogCollectorNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceDisk(null).execute(); + vpcService.deleteFlowLogCollector(null).execute(); } - // Test the updateInstanceDisk operation with a valid options model parameter + // Test the getFlowLogCollector operation with a valid options model parameter @Test - public void testUpdateInstanceDiskWOptions() throws Throwable { + public void testGetFlowLogCollectorWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}"; - String updateInstanceDiskPath = "/instances/testString/disks/testString"; + String mockResponseBody = "{\"active\": true, \"auto_delete\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"id\": \"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"lifecycle_state\": \"stable\", \"name\": \"my-flow-log-collector\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"storage_bucket\": {\"name\": \"bucket-27200-lwx4cfvcue\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"resource_type\": \"network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getFlowLogCollectorPath = "/flow_log_collectors/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the InstanceDiskPatch model - InstanceDiskPatch instanceDiskPatchModel = new InstanceDiskPatch.Builder() - .name("my-instance-disk-updated") - .build(); - Map instanceDiskPatchModelAsPatch = instanceDiskPatchModel.asPatch(); - - // Construct an instance of the UpdateInstanceDiskOptions model - UpdateInstanceDiskOptions updateInstanceDiskOptionsModel = new UpdateInstanceDiskOptions.Builder() - .instanceId("testString") + // Construct an instance of the GetFlowLogCollectorOptions model + GetFlowLogCollectorOptions getFlowLogCollectorOptionsModel = new GetFlowLogCollectorOptions.Builder() .id("testString") - .instanceDiskPatch(instanceDiskPatchModelAsPatch) .build(); - // Invoke updateInstanceDisk() with a valid options model and verify the result - Response response = vpcService.updateInstanceDisk(updateInstanceDiskOptionsModel).execute(); + // Invoke getFlowLogCollector() with a valid options model and verify the result + Response response = vpcService.getFlowLogCollector(getFlowLogCollectorOptionsModel).execute(); assertNotNull(response); - InstanceDisk responseObj = response.getResult(); + FlowLogCollector responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateInstanceDiskPath); + assertEquals(parsedPath, getFlowLogCollectorPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateInstanceDisk operation with and without retries enabled + // Test the getFlowLogCollector operation with and without retries enabled @Test - public void testUpdateInstanceDiskWRetries() throws Throwable { + public void testGetFlowLogCollectorWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateInstanceDiskWOptions(); + testGetFlowLogCollectorWOptions(); vpcService.disableRetries(); - testUpdateInstanceDiskWOptions(); + testGetFlowLogCollectorWOptions(); } - // Test the updateInstanceDisk operation with a null options model (negative test) + // Test the getFlowLogCollector operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateInstanceDiskNoOptions() throws Throwable { + public void testGetFlowLogCollectorNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateInstanceDisk(null).execute(); + vpcService.getFlowLogCollector(null).execute(); } - // Test the listInstanceNetworkAttachments operation with a valid options model parameter + // Test the updateFlowLogCollector operation with a valid options model parameter @Test - public void testListInstanceNetworkAttachmentsWOptions() throws Throwable { + public void testUpdateFlowLogCollectorWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"network_attachments\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}]}"; - String listInstanceNetworkAttachmentsPath = "/instances/testString/network_attachments"; + String mockResponseBody = "{\"active\": true, \"auto_delete\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"id\": \"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"lifecycle_state\": \"stable\", \"name\": \"my-flow-log-collector\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"storage_bucket\": {\"name\": \"bucket-27200-lwx4cfvcue\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"resource_type\": \"network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String updateFlowLogCollectorPath = "/flow_log_collectors/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceNetworkAttachmentsOptions model - ListInstanceNetworkAttachmentsOptions listInstanceNetworkAttachmentsOptionsModel = new ListInstanceNetworkAttachmentsOptions.Builder() - .instanceId("testString") + // Construct an instance of the FlowLogCollectorPatch model + FlowLogCollectorPatch flowLogCollectorPatchModel = new FlowLogCollectorPatch.Builder() + .active(false) + .name("my-flow-log-collector") .build(); + Map flowLogCollectorPatchModelAsPatch = flowLogCollectorPatchModel.asPatch(); - // Invoke listInstanceNetworkAttachments() with a valid options model and verify the result - Response response = vpcService.listInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModel).execute(); + // Construct an instance of the UpdateFlowLogCollectorOptions model + UpdateFlowLogCollectorOptions updateFlowLogCollectorOptionsModel = new UpdateFlowLogCollectorOptions.Builder() + .id("testString") + .flowLogCollectorPatch(flowLogCollectorPatchModelAsPatch) + .build(); + + // Invoke updateFlowLogCollector() with a valid options model and verify the result + Response response = vpcService.updateFlowLogCollector(updateFlowLogCollectorOptionsModel).execute(); assertNotNull(response); - InstanceNetworkAttachmentCollection responseObj = response.getResult(); + FlowLogCollector responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceNetworkAttachmentsPath); + assertEquals(parsedPath, updateFlowLogCollectorPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listInstanceNetworkAttachments operation with and without retries enabled + // Test the updateFlowLogCollector operation with and without retries enabled @Test - public void testListInstanceNetworkAttachmentsWRetries() throws Throwable { + public void testUpdateFlowLogCollectorWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceNetworkAttachmentsWOptions(); + testUpdateFlowLogCollectorWOptions(); vpcService.disableRetries(); - testListInstanceNetworkAttachmentsWOptions(); + testUpdateFlowLogCollectorWOptions(); } - // Test the listInstanceNetworkAttachments operation with a null options model (negative test) + // Test the updateFlowLogCollector operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListInstanceNetworkAttachmentsNoOptions() throws Throwable { + public void testUpdateFlowLogCollectorNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listInstanceNetworkAttachments(null).execute(); + vpcService.updateFlowLogCollector(null).execute(); } - // Test the createInstanceNetworkAttachment operation with a valid options model parameter + // Test the listRegions operation with a valid options model parameter @Test - public void testCreateInstanceNetworkAttachmentWOptions() throws Throwable { + public void testListRegionsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}"; - String createInstanceNetworkAttachmentPath = "/instances/testString/network_attachments"; + String mockResponseBody = "{\"regions\": [{\"endpoint\": \"https://us-south.iaas.cloud.ibm.com\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\", \"status\": \"available\"}]}"; + String listRegionsPath = "/regions"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.7") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model - InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); - - // Construct an instance of the CreateInstanceNetworkAttachmentOptions model - CreateInstanceNetworkAttachmentOptions createInstanceNetworkAttachmentOptionsModel = new CreateInstanceNetworkAttachmentOptions.Builder() - .instanceId("testString") - .virtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .name("testString") - .build(); + // Construct an instance of the ListRegionsOptions model + ListRegionsOptions listRegionsOptionsModel = new ListRegionsOptions(); - // Invoke createInstanceNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.createInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModel).execute(); + // Invoke listRegions() with a valid options model and verify the result + Response response = vpcService.listRegions(listRegionsOptionsModel).execute(); assertNotNull(response); - InstanceNetworkAttachment responseObj = response.getResult(); + RegionCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createInstanceNetworkAttachmentPath); + assertEquals(parsedPath, listRegionsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createInstanceNetworkAttachment operation with and without retries enabled + // Test the listRegions operation with and without retries enabled @Test - public void testCreateInstanceNetworkAttachmentWRetries() throws Throwable { + public void testListRegionsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateInstanceNetworkAttachmentWOptions(); + testListRegionsWOptions(); vpcService.disableRetries(); - testCreateInstanceNetworkAttachmentWOptions(); - } - - // Test the createInstanceNetworkAttachment operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateInstanceNetworkAttachmentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createInstanceNetworkAttachment(null).execute(); + testListRegionsWOptions(); } - // Test the deleteInstanceNetworkAttachment operation with a valid options model parameter + // Test the getRegion operation with a valid options model parameter @Test - public void testDeleteInstanceNetworkAttachmentWOptions() throws Throwable { + public void testGetRegionWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteInstanceNetworkAttachmentPath = "/instances/testString/network_attachments/testString"; + String mockResponseBody = "{\"endpoint\": \"https://us-south.iaas.cloud.ibm.com\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\", \"status\": \"available\"}"; + String getRegionPath = "/regions/us-south"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteInstanceNetworkAttachmentOptions model - DeleteInstanceNetworkAttachmentOptions deleteInstanceNetworkAttachmentOptionsModel = new DeleteInstanceNetworkAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") + // Construct an instance of the GetRegionOptions model + GetRegionOptions getRegionOptionsModel = new GetRegionOptions.Builder() + .name("us-south") .build(); - // Invoke deleteInstanceNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.deleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptionsModel).execute(); + // Invoke getRegion() with a valid options model and verify the result + Response response = vpcService.getRegion(getRegionOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + Region responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteInstanceNetworkAttachmentPath); + assertEquals(parsedPath, getRegionPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteInstanceNetworkAttachment operation with and without retries enabled + // Test the getRegion operation with and without retries enabled @Test - public void testDeleteInstanceNetworkAttachmentWRetries() throws Throwable { + public void testGetRegionWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteInstanceNetworkAttachmentWOptions(); + testGetRegionWOptions(); vpcService.disableRetries(); - testDeleteInstanceNetworkAttachmentWOptions(); + testGetRegionWOptions(); } - // Test the deleteInstanceNetworkAttachment operation with a null options model (negative test) + // Test the getRegion operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteInstanceNetworkAttachmentNoOptions() throws Throwable { + public void testGetRegionNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteInstanceNetworkAttachment(null).execute(); + vpcService.getRegion(null).execute(); } - // Test the getInstanceNetworkAttachment operation with a valid options model parameter + // Test the listRegionZones operation with a valid options model parameter @Test - public void testGetInstanceNetworkAttachmentWOptions() throws Throwable { + public void testListRegionZonesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}"; - String getInstanceNetworkAttachmentPath = "/instances/testString/network_attachments/testString"; + String mockResponseBody = "{\"zones\": [{\"data_center\": \"DAL12\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\", \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}, \"status\": \"available\", \"universal_name\": \"us-south-dal10-a\"}]}"; + String listRegionZonesPath = "/regions/us-south/zones"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceNetworkAttachmentOptions model - GetInstanceNetworkAttachmentOptions getInstanceNetworkAttachmentOptionsModel = new GetInstanceNetworkAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") + // Construct an instance of the ListRegionZonesOptions model + ListRegionZonesOptions listRegionZonesOptionsModel = new ListRegionZonesOptions.Builder() + .regionName("us-south") .build(); - // Invoke getInstanceNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.getInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModel).execute(); + // Invoke listRegionZones() with a valid options model and verify the result + Response response = vpcService.listRegionZones(listRegionZonesOptionsModel).execute(); assertNotNull(response); - InstanceNetworkAttachment responseObj = response.getResult(); + ZoneCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -8959,112 +9994,112 @@ public void testGetInstanceNetworkAttachmentWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceNetworkAttachmentPath); + assertEquals(parsedPath, listRegionZonesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceNetworkAttachment operation with and without retries enabled + // Test the listRegionZones operation with and without retries enabled @Test - public void testGetInstanceNetworkAttachmentWRetries() throws Throwable { + public void testListRegionZonesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceNetworkAttachmentWOptions(); + testListRegionZonesWOptions(); vpcService.disableRetries(); - testGetInstanceNetworkAttachmentWOptions(); + testListRegionZonesWOptions(); } - // Test the getInstanceNetworkAttachment operation with a null options model (negative test) + // Test the listRegionZones operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceNetworkAttachmentNoOptions() throws Throwable { + public void testListRegionZonesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceNetworkAttachment(null).execute(); + vpcService.listRegionZones(null).execute(); } - // Test the updateInstanceNetworkAttachment operation with a valid options model parameter + // Test the getRegionZone operation with a valid options model parameter @Test - public void testUpdateInstanceNetworkAttachmentWOptions() throws Throwable { + public void testGetRegionZoneWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}"; - String updateInstanceNetworkAttachmentPath = "/instances/testString/network_attachments/testString"; + String mockResponseBody = "{\"data_center\": \"DAL12\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\", \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}, \"status\": \"available\", \"universal_name\": \"us-south-dal10-a\"}"; + String getRegionZonePath = "/regions/us-south/zones/us-south-1"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the InstanceNetworkAttachmentPatch model - InstanceNetworkAttachmentPatch instanceNetworkAttachmentPatchModel = new InstanceNetworkAttachmentPatch.Builder() - .name("my-instance-network-attachment-updated") - .build(); - Map instanceNetworkAttachmentPatchModelAsPatch = instanceNetworkAttachmentPatchModel.asPatch(); - - // Construct an instance of the UpdateInstanceNetworkAttachmentOptions model - UpdateInstanceNetworkAttachmentOptions updateInstanceNetworkAttachmentOptionsModel = new UpdateInstanceNetworkAttachmentOptions.Builder() - .instanceId("testString") - .id("testString") - .instanceNetworkAttachmentPatch(instanceNetworkAttachmentPatchModelAsPatch) + // Construct an instance of the GetRegionZoneOptions model + GetRegionZoneOptions getRegionZoneOptionsModel = new GetRegionZoneOptions.Builder() + .regionName("us-south") + .name("us-south-1") .build(); - // Invoke updateInstanceNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.updateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModel).execute(); + // Invoke getRegionZone() with a valid options model and verify the result + Response response = vpcService.getRegionZone(getRegionZoneOptionsModel).execute(); assertNotNull(response); - InstanceNetworkAttachment responseObj = response.getResult(); + Zone responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateInstanceNetworkAttachmentPath); + assertEquals(parsedPath, getRegionZonePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateInstanceNetworkAttachment operation with and without retries enabled + // Test the getRegionZone operation with and without retries enabled @Test - public void testUpdateInstanceNetworkAttachmentWRetries() throws Throwable { + public void testGetRegionZoneWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateInstanceNetworkAttachmentWOptions(); + testGetRegionZoneWOptions(); vpcService.disableRetries(); - testUpdateInstanceNetworkAttachmentWOptions(); + testGetRegionZoneWOptions(); } - // Test the updateInstanceNetworkAttachment operation with a null options model (negative test) + // Test the getRegionZone operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateInstanceNetworkAttachmentNoOptions() throws Throwable { + public void testGetRegionZoneNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateInstanceNetworkAttachment(null).execute(); + vpcService.getRegionZone(null).execute(); } - // Test the listInstanceNetworkInterfaces operation with a valid options model parameter + // Test the listImages operation with a valid options model parameter @Test - public void testListInstanceNetworkInterfacesWOptions() throws Throwable { + public void testListImagesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"network_interfaces\": [{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\"}]}"; - String listInstanceNetworkInterfacesPath = "/instances/testString/network_interfaces"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"images\": [{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deprecation_at\": \"2019-01-01T12:00:00.000Z\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"image\", \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_data_format\": \"cloud_init\", \"visibility\": \"private\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listImagesPath = "/images"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceNetworkInterfacesOptions model - ListInstanceNetworkInterfacesOptions listInstanceNetworkInterfacesOptionsModel = new ListInstanceNetworkInterfacesOptions.Builder() - .instanceId("testString") + // Construct an instance of the ListImagesOptions model + ListImagesOptions listImagesOptionsModel = new ListImagesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .status(java.util.Arrays.asList("available")) + .visibility("private") + .userDataFormat(java.util.Arrays.asList("cloud_init")) + .remoteAccountId("bb1b52262f7441a586f49068482f1e60") .build(); - // Invoke listInstanceNetworkInterfaces() with a valid options model and verify the result - Response response = vpcService.listInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModel).execute(); + // Invoke listImages() with a valid options model and verify the result + Response response = vpcService.listImages(listImagesOptionsModel).execute(); assertNotNull(response); - NetworkInterfaceUnpaginatedCollection responseObj = response.getResult(); + ImageCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9073,73 +10108,166 @@ public void testListInstanceNetworkInterfacesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceNetworkInterfacesPath); + assertEquals(parsedPath, listImagesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("status"), RequestUtils.join(java.util.Arrays.asList("available"), ",")); + assertEquals(query.get("visibility"), "private"); + assertEquals(query.get("user_data_format"), RequestUtils.join(java.util.Arrays.asList("cloud_init"), ",")); + assertEquals(query.get("remote.account.id"), "bb1b52262f7441a586f49068482f1e60"); } - // Test the listInstanceNetworkInterfaces operation with and without retries enabled + // Test the listImages operation with and without retries enabled @Test - public void testListInstanceNetworkInterfacesWRetries() throws Throwable { + public void testListImagesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceNetworkInterfacesWOptions(); + testListImagesWOptions(); vpcService.disableRetries(); - testListInstanceNetworkInterfacesWOptions(); + testListImagesWOptions(); } - // Test the listInstanceNetworkInterfaces operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListInstanceNetworkInterfacesNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listInstanceNetworkInterfaces(null).execute(); + // Test the listImages operation using the ImagesPager.getNext() method + @Test + public void testListImagesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"images\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deprecation_at\":\"2019-01-01T12:00:00.000Z\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"}},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"image\",\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_data_format\":\"cloud_init\",\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"images\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deprecation_at\":\"2019-01-01T12:00:00.000Z\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"}},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"image\",\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_data_format\":\"cloud_init\",\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .status(java.util.Arrays.asList("available")) + .visibility("private") + .userDataFormat(java.util.Arrays.asList("cloud_init")) + .remoteAccountId("bb1b52262f7441a586f49068482f1e60") + .build(); + + List allResults = new ArrayList<>(); + ImagesPager pager = new ImagesPager(vpcService, listImagesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } + + // Test the listImages operation using the ImagesPager.getAll() method + @Test + public void testListImagesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"images\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deprecation_at\":\"2019-01-01T12:00:00.000Z\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"}},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"image\",\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_data_format\":\"cloud_init\",\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"images\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"catalog_offering\":{\"managed\":false,\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deprecation_at\":\"2019-01-01T12:00:00.000Z\",\"encryption\":\"user_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"file\":{\"checksums\":{\"sha256\":\"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"},\"size\":1},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"minimum_provisioned_size\":22,\"name\":\"my-image\",\"obsolescence_at\":\"2019-01-01T12:00:00.000Z\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"}},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"image\",\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_data_format\":\"cloud_init\",\"visibility\":\"private\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Test the createInstanceNetworkInterface operation with a valid options model parameter + ListImagesOptions listImagesOptions = new ListImagesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .status(java.util.Arrays.asList("available")) + .visibility("private") + .userDataFormat(java.util.Arrays.asList("cloud_init")) + .remoteAccountId("bb1b52262f7441a586f49068482f1e60") + .build(); + + ImagesPager pager = new ImagesPager(vpcService, listImagesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createImage operation with a valid options model parameter @Test - public void testCreateInstanceNetworkInterfaceWOptions() throws Throwable { + public void testCreateImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\"}"; - String createInstanceNetworkInterfacePath = "/instances/testString/network_interfaces"; + String mockResponseBody = "{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deprecation_at\": \"2019-01-01T12:00:00.000Z\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"image\", \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_data_format\": \"cloud_init\", \"visibility\": \"private\"}"; + String createImagePath = "/images"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + // Construct an instance of the ImageAllowedUsePrototype model + ImageAllowedUsePrototype imageAllowedUsePrototypeModel = new ImageAllowedUsePrototype.Builder() + .apiVersion(version) + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - // Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + // Construct an instance of the EncryptionKeyIdentityByCRN model + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); - // Construct an instance of the CreateInstanceNetworkInterfaceOptions model - CreateInstanceNetworkInterfaceOptions createInstanceNetworkInterfaceOptionsModel = new CreateInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") - .subnet(subnetIdentityModel) - .allowIpSpoofing(true) - .name("my-instance-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + // Construct an instance of the ImageFilePrototype model + ImageFilePrototype imageFilePrototypeModel = new ImageFilePrototype.Builder() + .href("cos://us-south/my-bucket/my-image.qcow2") .build(); - // Invoke createInstanceNetworkInterface() with a valid options model and verify the result - Response response = vpcService.createInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModel).execute(); + // Construct an instance of the OperatingSystemIdentityByName model + OperatingSystemIdentityByName operatingSystemIdentityModel = new OperatingSystemIdentityByName.Builder() + .name("debian-9-amd64") + .build(); + + // Construct an instance of the ImagePrototypeImageByFile model + ImagePrototypeImageByFile imagePrototypeModel = new ImagePrototypeImageByFile.Builder() + .allowedUse(imageAllowedUsePrototypeModel) + .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .name("my-image") + .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .resourceGroup(resourceGroupIdentityModel) + .encryptedDataKey("testString") + .encryptionKey(encryptionKeyIdentityModel) + .file(imageFilePrototypeModel) + .operatingSystem(operatingSystemIdentityModel) + .build(); + + // Construct an instance of the CreateImageOptions model + CreateImageOptions createImageOptionsModel = new CreateImageOptions.Builder() + .imagePrototype(imagePrototypeModel) + .build(); + + // Invoke createImage() with a valid options model and verify the result + Response response = vpcService.createImage(createImageOptionsModel).execute(); assertNotNull(response); - NetworkInterface responseObj = response.getResult(); + Image responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9148,49 +10276,48 @@ public void testCreateInstanceNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createInstanceNetworkInterfacePath); + assertEquals(parsedPath, createImagePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createInstanceNetworkInterface operation with and without retries enabled + // Test the createImage operation with and without retries enabled @Test - public void testCreateInstanceNetworkInterfaceWRetries() throws Throwable { + public void testCreateImageWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateInstanceNetworkInterfaceWOptions(); + testCreateImageWOptions(); vpcService.disableRetries(); - testCreateInstanceNetworkInterfaceWOptions(); + testCreateImageWOptions(); } - // Test the createInstanceNetworkInterface operation with a null options model (negative test) + // Test the createImage operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateInstanceNetworkInterfaceNoOptions() throws Throwable { + public void testCreateImageNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createInstanceNetworkInterface(null).execute(); + vpcService.createImage(null).execute(); } - // Test the deleteInstanceNetworkInterface operation with a valid options model parameter + // Test the deleteImage operation with a valid options model parameter @Test - public void testDeleteInstanceNetworkInterfaceWOptions() throws Throwable { + public void testDeleteImageWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteInstanceNetworkInterfacePath = "/instances/testString/network_interfaces/testString"; + String deleteImagePath = "/images/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteInstanceNetworkInterfaceOptions model - DeleteInstanceNetworkInterfaceOptions deleteInstanceNetworkInterfaceOptionsModel = new DeleteInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") + // Construct an instance of the DeleteImageOptions model + DeleteImageOptions deleteImageOptionsModel = new DeleteImageOptions.Builder() .id("testString") .build(); - // Invoke deleteInstanceNetworkInterface() with a valid options model and verify the result - Response response = vpcService.deleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptionsModel).execute(); + // Invoke deleteImage() with a valid options model and verify the result + Response response = vpcService.deleteImage(deleteImageOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -9201,52 +10328,51 @@ public void testDeleteInstanceNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteInstanceNetworkInterfacePath); + assertEquals(parsedPath, deleteImagePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteInstanceNetworkInterface operation with and without retries enabled + // Test the deleteImage operation with and without retries enabled @Test - public void testDeleteInstanceNetworkInterfaceWRetries() throws Throwable { + public void testDeleteImageWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteInstanceNetworkInterfaceWOptions(); + testDeleteImageWOptions(); vpcService.disableRetries(); - testDeleteInstanceNetworkInterfaceWOptions(); + testDeleteImageWOptions(); } - // Test the deleteInstanceNetworkInterface operation with a null options model (negative test) + // Test the deleteImage operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteInstanceNetworkInterfaceNoOptions() throws Throwable { + public void testDeleteImageNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteInstanceNetworkInterface(null).execute(); + vpcService.deleteImage(null).execute(); } - // Test the getInstanceNetworkInterface operation with a valid options model parameter + // Test the getImage operation with a valid options model parameter @Test - public void testGetInstanceNetworkInterfaceWOptions() throws Throwable { + public void testGetImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\"}"; - String getInstanceNetworkInterfacePath = "/instances/testString/network_interfaces/testString"; + String mockResponseBody = "{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deprecation_at\": \"2019-01-01T12:00:00.000Z\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"image\", \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_data_format\": \"cloud_init\", \"visibility\": \"private\"}"; + String getImagePath = "/images/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceNetworkInterfaceOptions model - GetInstanceNetworkInterfaceOptions getInstanceNetworkInterfaceOptionsModel = new GetInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") + // Construct an instance of the GetImageOptions model + GetImageOptions getImageOptionsModel = new GetImageOptions.Builder() .id("testString") .build(); - // Invoke getInstanceNetworkInterface() with a valid options model and verify the result - Response response = vpcService.getInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModel).execute(); + // Invoke getImage() with a valid options model and verify the result + Response response = vpcService.getImage(getImageOptionsModel).execute(); assertNotNull(response); - NetworkInterface responseObj = response.getResult(); + Image responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9255,60 +10381,68 @@ public void testGetInstanceNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceNetworkInterfacePath); + assertEquals(parsedPath, getImagePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceNetworkInterface operation with and without retries enabled + // Test the getImage operation with and without retries enabled @Test - public void testGetInstanceNetworkInterfaceWRetries() throws Throwable { + public void testGetImageWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceNetworkInterfaceWOptions(); + testGetImageWOptions(); vpcService.disableRetries(); - testGetInstanceNetworkInterfaceWOptions(); + testGetImageWOptions(); } - // Test the getInstanceNetworkInterface operation with a null options model (negative test) + // Test the getImage operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceNetworkInterfaceNoOptions() throws Throwable { + public void testGetImageNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceNetworkInterface(null).execute(); + vpcService.getImage(null).execute(); } - // Test the updateInstanceNetworkInterface operation with a valid options model parameter + // Test the updateImage operation with a valid options model parameter @Test - public void testUpdateInstanceNetworkInterfaceWOptions() throws Throwable { + public void testUpdateImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\"}"; - String updateInstanceNetworkInterfacePath = "/instances/testString/network_interfaces/testString"; + String mockResponseBody = "{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"catalog_offering\": {\"managed\": false, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deprecation_at\": \"2019-01-01T12:00:00.000Z\", \"encryption\": \"user_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"file\": {\"checksums\": {\"sha256\": \"e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15\"}, \"size\": 1}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"minimum_provisioned_size\": 22, \"name\": \"my-image\", \"obsolescence_at\": \"2019-01-01T12:00:00.000Z\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"image\", \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_data_format\": \"cloud_init\", \"visibility\": \"private\"}"; + String updateImagePath = "/images/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the NetworkInterfacePatch model - NetworkInterfacePatch networkInterfacePatchModel = new NetworkInterfacePatch.Builder() - .allowIpSpoofing(true) - .name("my-network-interface-updated") + // Construct an instance of the ImageAllowedUsePatch model + ImageAllowedUsePatch imageAllowedUsePatchModel = new ImageAllowedUsePatch.Builder() + .apiVersion(version) + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - Map networkInterfacePatchModelAsPatch = networkInterfacePatchModel.asPatch(); - // Construct an instance of the UpdateInstanceNetworkInterfaceOptions model - UpdateInstanceNetworkInterfaceOptions updateInstanceNetworkInterfaceOptionsModel = new UpdateInstanceNetworkInterfaceOptions.Builder() - .instanceId("testString") + // Construct an instance of the ImagePatch model + ImagePatch imagePatchModel = new ImagePatch.Builder() + .allowedUse(imageAllowedUsePatchModel) + .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .name("my-image") + .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .build(); + Map imagePatchModelAsPatch = imagePatchModel.asPatch(); + + // Construct an instance of the UpdateImageOptions model + UpdateImageOptions updateImageOptionsModel = new UpdateImageOptions.Builder() .id("testString") - .networkInterfacePatch(networkInterfacePatchModelAsPatch) + .imagePatch(imagePatchModelAsPatch) .build(); - // Invoke updateInstanceNetworkInterface() with a valid options model and verify the result - Response response = vpcService.updateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModel).execute(); + // Invoke updateImage() with a valid options model and verify the result + Response response = vpcService.updateImage(updateImageOptionsModel).execute(); assertNotNull(response); - NetworkInterface responseObj = response.getResult(); + Image responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9317,52 +10451,53 @@ public void testUpdateInstanceNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateInstanceNetworkInterfacePath); + assertEquals(parsedPath, updateImagePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateInstanceNetworkInterface operation with and without retries enabled + // Test the updateImage operation with and without retries enabled @Test - public void testUpdateInstanceNetworkInterfaceWRetries() throws Throwable { + public void testUpdateImageWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateInstanceNetworkInterfaceWOptions(); + testUpdateImageWOptions(); vpcService.disableRetries(); - testUpdateInstanceNetworkInterfaceWOptions(); + testUpdateImageWOptions(); } - // Test the updateInstanceNetworkInterface operation with a null options model (negative test) + // Test the updateImage operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateInstanceNetworkInterfaceNoOptions() throws Throwable { + public void testUpdateImageNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateInstanceNetworkInterface(null).execute(); + vpcService.updateImage(null).execute(); } - // Test the listInstanceNetworkInterfaceFloatingIps operation with a valid options model parameter + // Test the listImageBareMetalServerProfiles operation with a valid options model parameter @Test - public void testListInstanceNetworkInterfaceFloatingIpsWOptions() throws Throwable { + public void testListImageBareMetalServerProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"floating_ips\": [{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; - String listInstanceNetworkInterfaceFloatingIpsPath = "/instances/testString/network_interfaces/testString/floating_ips"; + String mockResponseBody = "{\"bare_metal_server_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listImageBareMetalServerProfilesPath = "/images/testString/bare_metal_server_profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model - ListInstanceNetworkInterfaceFloatingIpsOptions listInstanceNetworkInterfaceFloatingIpsOptionsModel = new ListInstanceNetworkInterfaceFloatingIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + // Construct an instance of the ListImageBareMetalServerProfilesOptions model + ListImageBareMetalServerProfilesOptions listImageBareMetalServerProfilesOptionsModel = new ListImageBareMetalServerProfilesOptions.Builder() + .id("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke listInstanceNetworkInterfaceFloatingIps() with a valid options model and verify the result - Response response = vpcService.listInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModel).execute(); + // Invoke listImageBareMetalServerProfiles() with a valid options model and verify the result + Response response = vpcService.listImageBareMetalServerProfiles(listImageBareMetalServerProfilesOptionsModel).execute(); assertNotNull(response); - FloatingIPUnpaginatedCollection responseObj = response.getResult(); + ImageBareMetalServerProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9371,218 +10506,171 @@ public void testListInstanceNetworkInterfaceFloatingIpsWOptions() throws Throwab assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceNetworkInterfaceFloatingIpsPath); + assertEquals(parsedPath, listImageBareMetalServerProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listInstanceNetworkInterfaceFloatingIps operation with and without retries enabled + // Test the listImageBareMetalServerProfiles operation with and without retries enabled @Test - public void testListInstanceNetworkInterfaceFloatingIpsWRetries() throws Throwable { + public void testListImageBareMetalServerProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceNetworkInterfaceFloatingIpsWOptions(); + testListImageBareMetalServerProfilesWOptions(); vpcService.disableRetries(); - testListInstanceNetworkInterfaceFloatingIpsWOptions(); + testListImageBareMetalServerProfilesWOptions(); } - // Test the listInstanceNetworkInterfaceFloatingIps operation with a null options model (negative test) + // Test the listImageBareMetalServerProfiles operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListInstanceNetworkInterfaceFloatingIpsNoOptions() throws Throwable { + public void testListImageBareMetalServerProfilesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listInstanceNetworkInterfaceFloatingIps(null).execute(); + vpcService.listImageBareMetalServerProfiles(null).execute(); } - // Test the removeInstanceNetworkInterfaceFloatingIp operation with a valid options model parameter + // Test the listImageBareMetalServerProfiles operation using the ImageBareMetalServerProfilesPager.getNext() method @Test - public void testRemoveInstanceNetworkInterfaceFloatingIpWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String removeInstanceNetworkInterfaceFloatingIpPath = "/instances/testString/network_interfaces/testString/floating_ips/testString"; + public void testListImageBareMetalServerProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"bare_metal_server_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"bare_metal_server_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); - - // Construct an instance of the RemoveInstanceNetworkInterfaceFloatingIpOptions model - RemoveInstanceNetworkInterfaceFloatingIpOptions removeInstanceNetworkInterfaceFloatingIpOptionsModel = new RemoveInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") - .id("testString") - .build(); - - // Invoke removeInstanceNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.removeInstanceNetworkInterfaceFloatingIp(removeInstanceNetworkInterfaceFloatingIpOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, removeInstanceNetworkInterfaceFloatingIpPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the removeInstanceNetworkInterfaceFloatingIp operation with and without retries enabled - @Test - public void testRemoveInstanceNetworkInterfaceFloatingIpWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testRemoveInstanceNetworkInterfaceFloatingIpWOptions(); - - vpcService.disableRetries(); - testRemoveInstanceNetworkInterfaceFloatingIpWOptions(); - } - - // Test the removeInstanceNetworkInterfaceFloatingIp operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRemoveInstanceNetworkInterfaceFloatingIpNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.removeInstanceNetworkInterfaceFloatingIp(null).execute(); - } - - // Test the getInstanceNetworkInterfaceFloatingIp operation with a valid options model parameter - @Test - public void testGetInstanceNetworkInterfaceFloatingIpWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getInstanceNetworkInterfaceFloatingIpPath = "/instances/testString/network_interfaces/testString/floating_ips/testString"; + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the GetInstanceNetworkInterfaceFloatingIpOptions model - GetInstanceNetworkInterfaceFloatingIpOptions getInstanceNetworkInterfaceFloatingIpOptionsModel = new GetInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + ListImageBareMetalServerProfilesOptions listImageBareMetalServerProfilesOptions = new ListImageBareMetalServerProfilesOptions.Builder() .id("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke getInstanceNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.getInstanceNetworkInterfaceFloatingIp(getInstanceNetworkInterfaceFloatingIpOptionsModel).execute(); - assertNotNull(response); - FloatingIP responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceNetworkInterfaceFloatingIpPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + List allResults = new ArrayList<>(); + ImageBareMetalServerProfilesPager pager = new ImageBareMetalServerProfilesPager(vpcService, listImageBareMetalServerProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } - - // Test the getInstanceNetworkInterfaceFloatingIp operation with and without retries enabled + + // Test the listImageBareMetalServerProfiles operation using the ImageBareMetalServerProfilesPager.getAll() method @Test - public void testGetInstanceNetworkInterfaceFloatingIpWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetInstanceNetworkInterfaceFloatingIpWOptions(); + public void testListImageBareMetalServerProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"bare_metal_server_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"bare_metal_server_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testGetInstanceNetworkInterfaceFloatingIpWOptions(); - } + ListImageBareMetalServerProfilesOptions listImageBareMetalServerProfilesOptions = new ListImageBareMetalServerProfilesOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); - // Test the getInstanceNetworkInterfaceFloatingIp operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceNetworkInterfaceFloatingIpNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getInstanceNetworkInterfaceFloatingIp(null).execute(); + ImageBareMetalServerProfilesPager pager = new ImageBareMetalServerProfilesPager(vpcService, listImageBareMetalServerProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the addInstanceNetworkInterfaceFloatingIp operation with a valid options model parameter + + // Test the deprecateImage operation with a valid options model parameter @Test - public void testAddInstanceNetworkInterfaceFloatingIpWOptions() throws Throwable { + public void testDeprecateImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String addInstanceNetworkInterfaceFloatingIpPath = "/instances/testString/network_interfaces/testString/floating_ips/testString"; + String mockResponseBody = ""; + String deprecateImagePath = "/images/testString/deprecate"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the AddInstanceNetworkInterfaceFloatingIpOptions model - AddInstanceNetworkInterfaceFloatingIpOptions addInstanceNetworkInterfaceFloatingIpOptionsModel = new AddInstanceNetworkInterfaceFloatingIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + // Construct an instance of the DeprecateImageOptions model + DeprecateImageOptions deprecateImageOptionsModel = new DeprecateImageOptions.Builder() .id("testString") .build(); - // Invoke addInstanceNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.addInstanceNetworkInterfaceFloatingIp(addInstanceNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke deprecateImage() with a valid options model and verify the result + Response response = vpcService.deprecateImage(deprecateImageOptionsModel).execute(); assertNotNull(response); - FloatingIP responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addInstanceNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, deprecateImagePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the addInstanceNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the deprecateImage operation with and without retries enabled @Test - public void testAddInstanceNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testDeprecateImageWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testAddInstanceNetworkInterfaceFloatingIpWOptions(); + testDeprecateImageWOptions(); vpcService.disableRetries(); - testAddInstanceNetworkInterfaceFloatingIpWOptions(); + testDeprecateImageWOptions(); } - // Test the addInstanceNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the deprecateImage operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddInstanceNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testDeprecateImageNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.addInstanceNetworkInterfaceFloatingIp(null).execute(); + vpcService.deprecateImage(null).execute(); } - // Test the listInstanceNetworkInterfaceIps operation with a valid options model parameter + // Test the listImageInstanceProfiles operation with a valid options model parameter @Test - public void testListInstanceNetworkInterfaceIpsWOptions() throws Throwable { + public void testListImageInstanceProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listInstanceNetworkInterfaceIpsPath = "/instances/testString/network_interfaces/testString/ips"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listImageInstanceProfilesPath = "/images/testString/instance_profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceNetworkInterfaceIpsOptions model - ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptionsModel = new ListInstanceNetworkInterfaceIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + // Construct an instance of the ListImageInstanceProfilesOptions model + ListImageInstanceProfilesOptions listImageInstanceProfilesOptionsModel = new ListImageInstanceProfilesOptions.Builder() + .id("testString") .start("testString") .limit(Long.valueOf("10")) .build(); - // Invoke listInstanceNetworkInterfaceIps() with a valid options model and verify the result - Response response = vpcService.listInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModel).execute(); + // Invoke listImageInstanceProfiles() with a valid options model and verify the result + Response response = vpcService.listImageInstanceProfiles(listImageInstanceProfilesOptionsModel).execute(); assertNotNull(response); - ReservedIPCollectionInstanceNetworkInterfaceContext responseObj = response.getResult(); + ImageInstanceProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9591,39 +10679,39 @@ public void testListInstanceNetworkInterfaceIpsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceNetworkInterfaceIpsPath); + assertEquals(parsedPath, listImageInstanceProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listInstanceNetworkInterfaceIps operation with and without retries enabled + // Test the listImageInstanceProfiles operation with and without retries enabled @Test - public void testListInstanceNetworkInterfaceIpsWRetries() throws Throwable { + public void testListImageInstanceProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceNetworkInterfaceIpsWOptions(); + testListImageInstanceProfilesWOptions(); vpcService.disableRetries(); - testListInstanceNetworkInterfaceIpsWOptions(); + testListImageInstanceProfilesWOptions(); } - // Test the listInstanceNetworkInterfaceIps operation with a null options model (negative test) + // Test the listImageInstanceProfiles operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListInstanceNetworkInterfaceIpsNoOptions() throws Throwable { + public void testListImageInstanceProfilesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listInstanceNetworkInterfaceIps(null).execute(); + vpcService.listImageInstanceProfiles(null).execute(); } - // Test the listInstanceNetworkInterfaceIps operation using the InstanceNetworkInterfaceIpsPager.getNext() method + // Test the listImageInstanceProfiles operation using the ImageInstanceProfilesPager.getNext() method @Test - public void testListInstanceNetworkInterfaceIpsWithPagerGetNext() throws Throwable { + public void testListImageInstanceProfilesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -9637,28 +10725,27 @@ public void testListInstanceNetworkInterfaceIpsWithPagerGetNext() throws Throwab .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + ListImageInstanceProfilesOptions listImageInstanceProfilesOptions = new ListImageInstanceProfilesOptions.Builder() + .id("testString") .limit(Long.valueOf("10")) .build(); - List allResults = new ArrayList<>(); - InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(vpcService, listInstanceNetworkInterfaceIpsOptions); + List allResults = new ArrayList<>(); + ImageInstanceProfilesPager pager = new ImageInstanceProfilesPager(vpcService, listImageInstanceProfilesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listInstanceNetworkInterfaceIps operation using the InstanceNetworkInterfaceIpsPager.getAll() method + // Test the listImageInstanceProfiles operation using the ImageInstanceProfilesPager.getAll() method @Test - public void testListInstanceNetworkInterfaceIpsWithPagerGetAll() throws Throwable { + public void testListImageInstanceProfilesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -9672,93 +10759,90 @@ public void testListInstanceNetworkInterfaceIpsWithPagerGetAll() throws Throwabl .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + ListImageInstanceProfilesOptions listImageInstanceProfilesOptions = new ListImageInstanceProfilesOptions.Builder() + .id("testString") .limit(Long.valueOf("10")) .build(); - InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(vpcService, listInstanceNetworkInterfaceIpsOptions); - List allResults = pager.getAll(); + ImageInstanceProfilesPager pager = new ImageInstanceProfilesPager(vpcService, listImageInstanceProfilesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the getInstanceNetworkInterfaceIp operation with a valid options model parameter + // Test the obsoleteImage operation with a valid options model parameter @Test - public void testGetInstanceNetworkInterfaceIpWOptions() throws Throwable { + public void testObsoleteImageWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; - String getInstanceNetworkInterfaceIpPath = "/instances/testString/network_interfaces/testString/ips/testString"; + String mockResponseBody = ""; + String obsoleteImagePath = "/images/testString/obsolete"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceNetworkInterfaceIpOptions model - GetInstanceNetworkInterfaceIpOptions getInstanceNetworkInterfaceIpOptionsModel = new GetInstanceNetworkInterfaceIpOptions.Builder() - .instanceId("testString") - .networkInterfaceId("testString") + // Construct an instance of the ObsoleteImageOptions model + ObsoleteImageOptions obsoleteImageOptionsModel = new ObsoleteImageOptions.Builder() .id("testString") .build(); - // Invoke getInstanceNetworkInterfaceIp() with a valid options model and verify the result - Response response = vpcService.getInstanceNetworkInterfaceIp(getInstanceNetworkInterfaceIpOptionsModel).execute(); + // Invoke obsoleteImage() with a valid options model and verify the result + Response response = vpcService.obsoleteImage(obsoleteImageOptionsModel).execute(); assertNotNull(response); - ReservedIP responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceNetworkInterfaceIpPath); + assertEquals(parsedPath, obsoleteImagePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceNetworkInterfaceIp operation with and without retries enabled + // Test the obsoleteImage operation with and without retries enabled @Test - public void testGetInstanceNetworkInterfaceIpWRetries() throws Throwable { + public void testObsoleteImageWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceNetworkInterfaceIpWOptions(); + testObsoleteImageWOptions(); vpcService.disableRetries(); - testGetInstanceNetworkInterfaceIpWOptions(); + testObsoleteImageWOptions(); } - // Test the getInstanceNetworkInterfaceIp operation with a null options model (negative test) + // Test the obsoleteImage operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceNetworkInterfaceIpNoOptions() throws Throwable { + public void testObsoleteImageNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceNetworkInterfaceIp(null).execute(); + vpcService.obsoleteImage(null).execute(); } - // Test the listInstanceVolumeAttachments operation with a valid options model parameter + // Test the listImageExportJobs operation with a valid options model parameter @Test - public void testListInstanceVolumeAttachmentsWOptions() throws Throwable { + public void testListImageExportJobsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"volume_attachments\": [{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}]}"; - String listInstanceVolumeAttachmentsPath = "/instances/testString/volume_attachments"; + String mockResponseBody = "{\"export_jobs\": [{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encrypted_data_key\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"format\": \"qcow2\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"id\": \"r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"name\": \"my-image-export-job\", \"resource_type\": \"image_export_job\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_access_storage_bucket\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq\"}], \"storage_bucket\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\", \"name\": \"bucket-27200-lwx4cfvcue\"}, \"storage_href\": \"cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2\", \"storage_object\": {\"name\": \"my-object\"}}]}"; + String listImageExportJobsPath = "/images/testString/export_jobs"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListInstanceVolumeAttachmentsOptions model - ListInstanceVolumeAttachmentsOptions listInstanceVolumeAttachmentsOptionsModel = new ListInstanceVolumeAttachmentsOptions.Builder() - .instanceId("testString") + // Construct an instance of the ListImageExportJobsOptions model + ListImageExportJobsOptions listImageExportJobsOptionsModel = new ListImageExportJobsOptions.Builder() + .imageId("testString") + .name("my-name") .build(); - // Invoke listInstanceVolumeAttachments() with a valid options model and verify the result - Response response = vpcService.listInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModel).execute(); + // Invoke listImageExportJobs() with a valid options model and verify the result + Response response = vpcService.listImageExportJobs(listImageExportJobsOptionsModel).execute(); assertNotNull(response); - VolumeAttachmentCollection responseObj = response.getResult(); + ImageExportJobUnpaginatedCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9767,59 +10851,60 @@ public void testListInstanceVolumeAttachmentsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listInstanceVolumeAttachmentsPath); + assertEquals(parsedPath, listImageExportJobsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("name"), "my-name"); } - // Test the listInstanceVolumeAttachments operation with and without retries enabled + // Test the listImageExportJobs operation with and without retries enabled @Test - public void testListInstanceVolumeAttachmentsWRetries() throws Throwable { + public void testListImageExportJobsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListInstanceVolumeAttachmentsWOptions(); + testListImageExportJobsWOptions(); vpcService.disableRetries(); - testListInstanceVolumeAttachmentsWOptions(); + testListImageExportJobsWOptions(); } - // Test the listInstanceVolumeAttachments operation with a null options model (negative test) + // Test the listImageExportJobs operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListInstanceVolumeAttachmentsNoOptions() throws Throwable { + public void testListImageExportJobsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listInstanceVolumeAttachments(null).execute(); + vpcService.listImageExportJobs(null).execute(); } - // Test the createInstanceVolumeAttachment operation with a valid options model parameter + // Test the createImageExportJob operation with a valid options model parameter @Test - public void testCreateInstanceVolumeAttachmentWOptions() throws Throwable { + public void testCreateImageExportJobWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}"; - String createInstanceVolumeAttachmentPath = "/instances/testString/volume_attachments"; + String mockResponseBody = "{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encrypted_data_key\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"format\": \"qcow2\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"id\": \"r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"name\": \"my-image-export-job\", \"resource_type\": \"image_export_job\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_access_storage_bucket\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq\"}], \"storage_bucket\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\", \"name\": \"bucket-27200-lwx4cfvcue\"}, \"storage_href\": \"cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2\", \"storage_object\": {\"name\": \"my-object\"}}"; + String createImageExportJobPath = "/images/testString/export_jobs"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById model - VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() - .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + // Construct an instance of the CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model + CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName cloudObjectStorageBucketIdentityModel = new CloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() + .name("bucket-27200-lwx4cfvcue") .build(); - // Construct an instance of the CreateInstanceVolumeAttachmentOptions model - CreateInstanceVolumeAttachmentOptions createInstanceVolumeAttachmentOptionsModel = new CreateInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") - .volume(volumeAttachmentPrototypeVolumeModel) - .deleteVolumeOnInstanceDelete(false) - .name("my-volume-attachment") + // Construct an instance of the CreateImageExportJobOptions model + CreateImageExportJobOptions createImageExportJobOptionsModel = new CreateImageExportJobOptions.Builder() + .imageId("testString") + .storageBucket(cloudObjectStorageBucketIdentityModel) + .format("qcow2") + .name("my-image-export") .build(); - // Invoke createInstanceVolumeAttachment() with a valid options model and verify the result - Response response = vpcService.createInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModel).execute(); + // Invoke createImageExportJob() with a valid options model and verify the result + Response response = vpcService.createImageExportJob(createImageExportJobOptionsModel).execute(); assertNotNull(response); - VolumeAttachment responseObj = response.getResult(); + ImageExportJob responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9828,49 +10913,49 @@ public void testCreateInstanceVolumeAttachmentWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createInstanceVolumeAttachmentPath); + assertEquals(parsedPath, createImageExportJobPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createInstanceVolumeAttachment operation with and without retries enabled + // Test the createImageExportJob operation with and without retries enabled @Test - public void testCreateInstanceVolumeAttachmentWRetries() throws Throwable { + public void testCreateImageExportJobWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateInstanceVolumeAttachmentWOptions(); + testCreateImageExportJobWOptions(); vpcService.disableRetries(); - testCreateInstanceVolumeAttachmentWOptions(); + testCreateImageExportJobWOptions(); } - // Test the createInstanceVolumeAttachment operation with a null options model (negative test) + // Test the createImageExportJob operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateInstanceVolumeAttachmentNoOptions() throws Throwable { + public void testCreateImageExportJobNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createInstanceVolumeAttachment(null).execute(); + vpcService.createImageExportJob(null).execute(); } - // Test the deleteInstanceVolumeAttachment operation with a valid options model parameter + // Test the deleteImageExportJob operation with a valid options model parameter @Test - public void testDeleteInstanceVolumeAttachmentWOptions() throws Throwable { + public void testDeleteImageExportJobWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteInstanceVolumeAttachmentPath = "/instances/testString/volume_attachments/testString"; + String deleteImageExportJobPath = "/images/testString/export_jobs/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteInstanceVolumeAttachmentOptions model - DeleteInstanceVolumeAttachmentOptions deleteInstanceVolumeAttachmentOptionsModel = new DeleteInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") + // Construct an instance of the DeleteImageExportJobOptions model + DeleteImageExportJobOptions deleteImageExportJobOptionsModel = new DeleteImageExportJobOptions.Builder() + .imageId("testString") .id("testString") .build(); - // Invoke deleteInstanceVolumeAttachment() with a valid options model and verify the result - Response response = vpcService.deleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptionsModel).execute(); + // Invoke deleteImageExportJob() with a valid options model and verify the result + Response response = vpcService.deleteImageExportJob(deleteImageExportJobOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -9881,52 +10966,52 @@ public void testDeleteInstanceVolumeAttachmentWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteInstanceVolumeAttachmentPath); + assertEquals(parsedPath, deleteImageExportJobPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteInstanceVolumeAttachment operation with and without retries enabled + // Test the deleteImageExportJob operation with and without retries enabled @Test - public void testDeleteInstanceVolumeAttachmentWRetries() throws Throwable { + public void testDeleteImageExportJobWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteInstanceVolumeAttachmentWOptions(); + testDeleteImageExportJobWOptions(); vpcService.disableRetries(); - testDeleteInstanceVolumeAttachmentWOptions(); + testDeleteImageExportJobWOptions(); } - // Test the deleteInstanceVolumeAttachment operation with a null options model (negative test) + // Test the deleteImageExportJob operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteInstanceVolumeAttachmentNoOptions() throws Throwable { + public void testDeleteImageExportJobNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteInstanceVolumeAttachment(null).execute(); + vpcService.deleteImageExportJob(null).execute(); } - // Test the getInstanceVolumeAttachment operation with a valid options model parameter + // Test the getImageExportJob operation with a valid options model parameter @Test - public void testGetInstanceVolumeAttachmentWOptions() throws Throwable { + public void testGetImageExportJobWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}"; - String getInstanceVolumeAttachmentPath = "/instances/testString/volume_attachments/testString"; + String mockResponseBody = "{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encrypted_data_key\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"format\": \"qcow2\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"id\": \"r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"name\": \"my-image-export-job\", \"resource_type\": \"image_export_job\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_access_storage_bucket\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq\"}], \"storage_bucket\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\", \"name\": \"bucket-27200-lwx4cfvcue\"}, \"storage_href\": \"cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2\", \"storage_object\": {\"name\": \"my-object\"}}"; + String getImageExportJobPath = "/images/testString/export_jobs/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetInstanceVolumeAttachmentOptions model - GetInstanceVolumeAttachmentOptions getInstanceVolumeAttachmentOptionsModel = new GetInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") + // Construct an instance of the GetImageExportJobOptions model + GetImageExportJobOptions getImageExportJobOptionsModel = new GetImageExportJobOptions.Builder() + .imageId("testString") .id("testString") .build(); - // Invoke getInstanceVolumeAttachment() with a valid options model and verify the result - Response response = vpcService.getInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModel).execute(); + // Invoke getImageExportJob() with a valid options model and verify the result + Response response = vpcService.getImageExportJob(getImageExportJobOptionsModel).execute(); assertNotNull(response); - VolumeAttachment responseObj = response.getResult(); + ImageExportJob responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9935,60 +11020,59 @@ public void testGetInstanceVolumeAttachmentWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceVolumeAttachmentPath); + assertEquals(parsedPath, getImageExportJobPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getInstanceVolumeAttachment operation with and without retries enabled + // Test the getImageExportJob operation with and without retries enabled @Test - public void testGetInstanceVolumeAttachmentWRetries() throws Throwable { + public void testGetImageExportJobWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetInstanceVolumeAttachmentWOptions(); + testGetImageExportJobWOptions(); vpcService.disableRetries(); - testGetInstanceVolumeAttachmentWOptions(); + testGetImageExportJobWOptions(); } - // Test the getInstanceVolumeAttachment operation with a null options model (negative test) + // Test the getImageExportJob operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceVolumeAttachmentNoOptions() throws Throwable { + public void testGetImageExportJobNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getInstanceVolumeAttachment(null).execute(); + vpcService.getImageExportJob(null).execute(); } - // Test the updateInstanceVolumeAttachment operation with a valid options model parameter + // Test the updateImageExportJob operation with a valid options model parameter @Test - public void testUpdateInstanceVolumeAttachmentWOptions() throws Throwable { + public void testUpdateImageExportJobWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}"; - String updateInstanceVolumeAttachmentPath = "/instances/testString/volume_attachments/testString"; + String mockResponseBody = "{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encrypted_data_key\": \"VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=\", \"format\": \"qcow2\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8/export_jobs/r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"id\": \"r006-095e9baf-01d4-4e29-986e-20d26606b82a\", \"name\": \"my-image-export-job\", \"resource_type\": \"image_export_job\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_access_storage_bucket\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-object-storage-prereq\"}], \"storage_bucket\": {\"crn\": \"crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue\", \"name\": \"bucket-27200-lwx4cfvcue\"}, \"storage_href\": \"cos://us-south/bucket-27200-lwx4cfvcue/my-image-export.qcow2\", \"storage_object\": {\"name\": \"my-object\"}}"; + String updateImageExportJobPath = "/images/testString/export_jobs/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VolumeAttachmentPatch model - VolumeAttachmentPatch volumeAttachmentPatchModel = new VolumeAttachmentPatch.Builder() - .deleteVolumeOnInstanceDelete(true) - .name("my-volume-attachment") + // Construct an instance of the ImageExportJobPatch model + ImageExportJobPatch imageExportJobPatchModel = new ImageExportJobPatch.Builder() + .name("my-image-export-job-updated") .build(); - Map volumeAttachmentPatchModelAsPatch = volumeAttachmentPatchModel.asPatch(); + Map imageExportJobPatchModelAsPatch = imageExportJobPatchModel.asPatch(); - // Construct an instance of the UpdateInstanceVolumeAttachmentOptions model - UpdateInstanceVolumeAttachmentOptions updateInstanceVolumeAttachmentOptionsModel = new UpdateInstanceVolumeAttachmentOptions.Builder() - .instanceId("testString") + // Construct an instance of the UpdateImageExportJobOptions model + UpdateImageExportJobOptions updateImageExportJobOptionsModel = new UpdateImageExportJobOptions.Builder() + .imageId("testString") .id("testString") - .volumeAttachmentPatch(volumeAttachmentPatchModelAsPatch) + .imageExportJobPatch(imageExportJobPatchModelAsPatch) .build(); - // Invoke updateInstanceVolumeAttachment() with a valid options model and verify the result - Response response = vpcService.updateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModel).execute(); + // Invoke updateImageExportJob() with a valid options model and verify the result + Response response = vpcService.updateImageExportJob(updateImageExportJobOptionsModel).execute(); assertNotNull(response); - VolumeAttachment responseObj = response.getResult(); + ImageExportJob responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -9997,29 +11081,193 @@ public void testUpdateInstanceVolumeAttachmentWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateInstanceVolumeAttachmentPath); + assertEquals(parsedPath, updateImageExportJobPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateInstanceVolumeAttachment operation with and without retries enabled + // Test the updateImageExportJob operation with and without retries enabled @Test - public void testUpdateInstanceVolumeAttachmentWRetries() throws Throwable { + public void testUpdateImageExportJobWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateInstanceVolumeAttachmentWOptions(); + testUpdateImageExportJobWOptions(); vpcService.disableRetries(); - testUpdateInstanceVolumeAttachmentWOptions(); + testUpdateImageExportJobWOptions(); } - // Test the updateInstanceVolumeAttachment operation with a null options model (negative test) + // Test the updateImageExportJob operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateInstanceVolumeAttachmentNoOptions() throws Throwable { + public void testUpdateImageExportJobNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateInstanceVolumeAttachment(null).execute(); + vpcService.updateImageExportJob(null).execute(); + } + + // Test the listOperatingSystems operation with a valid options model parameter + @Test + public void testListOperatingSystemsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"operating_systems\": [{\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}], \"total_count\": 132}"; + String listOperatingSystemsPath = "/operating_systems"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListOperatingSystemsOptions model + ListOperatingSystemsOptions listOperatingSystemsOptionsModel = new ListOperatingSystemsOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .build(); + + // Invoke listOperatingSystems() with a valid options model and verify the result + Response response = vpcService.listOperatingSystems(listOperatingSystemsOptionsModel).execute(); + assertNotNull(response); + OperatingSystemCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listOperatingSystemsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + } + + // Test the listOperatingSystems operation with and without retries enabled + @Test + public void testListOperatingSystemsWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListOperatingSystemsWOptions(); + + vpcService.disableRetries(); + testListOperatingSystemsWOptions(); + } + + // Test the listOperatingSystems operation using the OperatingSystemsPager.getNext() method + @Test + public void testListOperatingSystemsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"operating_systems\":[{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"operating_systems\":[{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + OperatingSystemsPager pager = new OperatingSystemsPager(vpcService, listOperatingSystemsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listOperatingSystems operation using the OperatingSystemsPager.getAll() method + @Test + public void testListOperatingSystemsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"operating_systems\":[{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"operating_systems\":[{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListOperatingSystemsOptions listOperatingSystemsOptions = new ListOperatingSystemsOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + OperatingSystemsPager pager = new OperatingSystemsPager(vpcService, listOperatingSystemsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the getOperatingSystem operation with a valid options model parameter + @Test + public void testGetOperatingSystemWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}"; + String getOperatingSystemPath = "/operating_systems/red-7-amd64"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetOperatingSystemOptions model + GetOperatingSystemOptions getOperatingSystemOptionsModel = new GetOperatingSystemOptions.Builder() + .name("red-7-amd64") + .build(); + + // Invoke getOperatingSystem() with a valid options model and verify the result + Response response = vpcService.getOperatingSystem(getOperatingSystemOptionsModel).execute(); + assertNotNull(response); + OperatingSystem responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getOperatingSystemPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the getOperatingSystem operation with and without retries enabled + @Test + public void testGetOperatingSystemWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetOperatingSystemWOptions(); + + vpcService.disableRetries(); + testGetOperatingSystemWOptions(); + } + + // Test the getOperatingSystem operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetOperatingSystemNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getOperatingSystem(null).execute(); } // Test the listInstanceGroups operation with a valid options model parameter @@ -10055,7 +11303,7 @@ public void testListInstanceGroupsWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); @@ -10197,7 +11445,7 @@ public void testCreateInstanceGroupWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10249,7 +11497,7 @@ public void testDeleteInstanceGroupWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10302,7 +11550,7 @@ public void testGetInstanceGroupWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10388,7 +11636,7 @@ public void testUpdateInstanceGroupWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10440,7 +11688,7 @@ public void testDeleteInstanceGroupLoadBalancerWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10495,7 +11743,7 @@ public void testListInstanceGroupManagersWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); @@ -10626,7 +11874,7 @@ public void testCreateInstanceGroupManagerWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10679,7 +11927,7 @@ public void testDeleteInstanceGroupManagerWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10733,7 +11981,7 @@ public void testGetInstanceGroupManagerWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10799,7 +12047,7 @@ public void testUpdateInstanceGroupManagerWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -10855,7 +12103,7 @@ public void testListInstanceGroupManagerActionsWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); @@ -10960,10 +12208,10 @@ public void testCreateInstanceGroupManagerActionWOptions() throws Throwable { .membershipCount(Long.valueOf("10")) .build(); - // Construct an instance of the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup model - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.Builder() + // Construct an instance of the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup model + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.Builder() .name("my-instance-group-manager-action") - .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .cronSpec("30 */2 * * 1-5") .group(instanceGroupManagerScheduledActionGroupPrototypeModel) .build(); @@ -10990,7 +12238,7 @@ public void testCreateInstanceGroupManagerActionWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11044,7 +12292,7 @@ public void testDeleteInstanceGroupManagerActionWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11099,7 +12347,7 @@ public void testGetInstanceGroupManagerActionWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11178,7 +12426,7 @@ public void testUpdateInstanceGroupManagerActionWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11234,7 +12482,7 @@ public void testListInstanceGroupManagerPoliciesWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); @@ -11365,7 +12613,7 @@ public void testCreateInstanceGroupManagerPolicyWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11419,7 +12667,7 @@ public void testDeleteInstanceGroupManagerPolicyWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11474,7 +12722,7 @@ public void testGetInstanceGroupManagerPolicyWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11538,7 +12786,7 @@ public void testUpdateInstanceGroupManagerPolicyWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11590,7 +12838,7 @@ public void testDeleteInstanceGroupMembershipsWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } @@ -11645,7 +12893,7 @@ public void testListInstanceGroupMembershipsWOptions() throws Throwable { // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); @@ -11747,398 +12995,12 @@ public void testDeleteInstanceGroupMembershipWOptions() throws Throwable { .instanceGroupId("testString") .id("testString") .build(); - - // Invoke deleteInstanceGroupMembership() with a valid options model and verify the result - Response response = vpcService.deleteInstanceGroupMembership(deleteInstanceGroupMembershipOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteInstanceGroupMembershipPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the deleteInstanceGroupMembership operation with and without retries enabled - @Test - public void testDeleteInstanceGroupMembershipWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testDeleteInstanceGroupMembershipWOptions(); - - vpcService.disableRetries(); - testDeleteInstanceGroupMembershipWOptions(); - } - - // Test the deleteInstanceGroupMembership operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteInstanceGroupMembershipNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.deleteInstanceGroupMembership(null).execute(); - } - - // Test the getInstanceGroupMembership operation with a valid options model parameter - @Test - public void testGetInstanceGroupMembershipWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_instance_on_membership_delete\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"id\": \"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"instance_template\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"name\": \"my-instance-template\"}, \"name\": \"my-instance-group-membership\", \"pool_member\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}, \"status\": \"deleting\", \"updated_at\": \"2019-01-01T12:00:00.000Z\"}"; - String getInstanceGroupMembershipPath = "/instance_groups/testString/memberships/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetInstanceGroupMembershipOptions model - GetInstanceGroupMembershipOptions getInstanceGroupMembershipOptionsModel = new GetInstanceGroupMembershipOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .build(); - - // Invoke getInstanceGroupMembership() with a valid options model and verify the result - Response response = vpcService.getInstanceGroupMembership(getInstanceGroupMembershipOptionsModel).execute(); - assertNotNull(response); - InstanceGroupMembership responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getInstanceGroupMembershipPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the getInstanceGroupMembership operation with and without retries enabled - @Test - public void testGetInstanceGroupMembershipWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetInstanceGroupMembershipWOptions(); - - vpcService.disableRetries(); - testGetInstanceGroupMembershipWOptions(); - } - - // Test the getInstanceGroupMembership operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetInstanceGroupMembershipNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getInstanceGroupMembership(null).execute(); - } - - // Test the updateInstanceGroupMembership operation with a valid options model parameter - @Test - public void testUpdateInstanceGroupMembershipWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_instance_on_membership_delete\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"id\": \"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"instance_template\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"name\": \"my-instance-template\"}, \"name\": \"my-instance-group-membership\", \"pool_member\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}, \"status\": \"deleting\", \"updated_at\": \"2019-01-01T12:00:00.000Z\"}"; - String updateInstanceGroupMembershipPath = "/instance_groups/testString/memberships/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the InstanceGroupMembershipPatch model - InstanceGroupMembershipPatch instanceGroupMembershipPatchModel = new InstanceGroupMembershipPatch.Builder() - .deleteInstanceOnMembershipDelete(false) - .name("my-instance-group-membership") - .build(); - Map instanceGroupMembershipPatchModelAsPatch = instanceGroupMembershipPatchModel.asPatch(); - - // Construct an instance of the UpdateInstanceGroupMembershipOptions model - UpdateInstanceGroupMembershipOptions updateInstanceGroupMembershipOptionsModel = new UpdateInstanceGroupMembershipOptions.Builder() - .instanceGroupId("testString") - .id("testString") - .instanceGroupMembershipPatch(instanceGroupMembershipPatchModelAsPatch) - .build(); - - // Invoke updateInstanceGroupMembership() with a valid options model and verify the result - Response response = vpcService.updateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModel).execute(); - assertNotNull(response); - InstanceGroupMembership responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateInstanceGroupMembershipPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the updateInstanceGroupMembership operation with and without retries enabled - @Test - public void testUpdateInstanceGroupMembershipWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testUpdateInstanceGroupMembershipWOptions(); - - vpcService.disableRetries(); - testUpdateInstanceGroupMembershipWOptions(); - } - - // Test the updateInstanceGroupMembership operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateInstanceGroupMembershipNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.updateInstanceGroupMembership(null).execute(); - } - - // Test the listReservations operation with a valid options model parameter - @Test - public void testListReservationsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"reservations\": [{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; - String listReservationsPath = "/reservations"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListReservationsOptions model - ListReservationsOptions listReservationsOptionsModel = new ListReservationsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .name("my-name") - .profileResourceType("testString") - .affinityPolicy("automatic") - .resourceGroupId("testString") - .zoneName("us-south-1") - .build(); - - // Invoke listReservations() with a valid options model and verify the result - Response response = vpcService.listReservations(listReservationsOptionsModel).execute(); - assertNotNull(response); - ReservationCollection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listReservationsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("profile.resource_type"), "testString"); - assertEquals(query.get("affinity_policy"), "automatic"); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("zone.name"), "us-south-1"); - } - - // Test the listReservations operation with and without retries enabled - @Test - public void testListReservationsWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListReservationsWOptions(); - - vpcService.disableRetries(); - testListReservationsWOptions(); - } - - // Test the listReservations operation using the ReservationsPager.getNext() method - @Test - public void testListReservationsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reservations\":[{\"affinity_policy\":\"automatic\",\"capacity\":{\"allocated\":10,\"available\":8,\"status\":\"allocated\",\"total\":10,\"used\":2},\"committed_use\":{\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_policy\":\"release\",\"term\":\"term\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"lifecycle_state\":\"stable\",\"name\":\"my-reservation\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"reservation\",\"status\":\"activating\",\"status_reasons\":[{\"code\":\"cannot_activate_no_capacity_available\",\"message\":\"The reservation cannot be activated because capacity is unavailable\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"reservations\":[{\"affinity_policy\":\"automatic\",\"capacity\":{\"allocated\":10,\"available\":8,\"status\":\"allocated\",\"total\":10,\"used\":2},\"committed_use\":{\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_policy\":\"release\",\"term\":\"term\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"lifecycle_state\":\"stable\",\"name\":\"my-reservation\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"reservation\",\"status\":\"activating\",\"status_reasons\":[{\"code\":\"cannot_activate_no_capacity_available\",\"message\":\"The reservation cannot be activated because capacity is unavailable\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListReservationsOptions listReservationsOptions = new ListReservationsOptions.Builder() - .limit(Long.valueOf("10")) - .name("my-name") - .profileResourceType("testString") - .affinityPolicy("automatic") - .resourceGroupId("testString") - .zoneName("us-south-1") - .build(); - - List allResults = new ArrayList<>(); - ReservationsPager pager = new ReservationsPager(vpcService, listReservationsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); - } - - // Test the listReservations operation using the ReservationsPager.getAll() method - @Test - public void testListReservationsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reservations\":[{\"affinity_policy\":\"automatic\",\"capacity\":{\"allocated\":10,\"available\":8,\"status\":\"allocated\",\"total\":10,\"used\":2},\"committed_use\":{\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_policy\":\"release\",\"term\":\"term\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"lifecycle_state\":\"stable\",\"name\":\"my-reservation\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"reservation\",\"status\":\"activating\",\"status_reasons\":[{\"code\":\"cannot_activate_no_capacity_available\",\"message\":\"The reservation cannot be activated because capacity is unavailable\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"reservations\":[{\"affinity_policy\":\"automatic\",\"capacity\":{\"allocated\":10,\"available\":8,\"status\":\"allocated\",\"total\":10,\"used\":2},\"committed_use\":{\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_policy\":\"release\",\"term\":\"term\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"lifecycle_state\":\"stable\",\"name\":\"my-reservation\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"reservation\",\"status\":\"activating\",\"status_reasons\":[{\"code\":\"cannot_activate_no_capacity_available\",\"message\":\"The reservation cannot be activated because capacity is unavailable\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListReservationsOptions listReservationsOptions = new ListReservationsOptions.Builder() - .limit(Long.valueOf("10")) - .name("my-name") - .profileResourceType("testString") - .affinityPolicy("automatic") - .resourceGroupId("testString") - .zoneName("us-south-1") - .build(); - - ReservationsPager pager = new ReservationsPager(vpcService, listReservationsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createReservation operation with a valid options model parameter - @Test - public void testCreateReservationWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createReservationPath = "/reservations"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the ReservationCapacityPrototype model - ReservationCapacityPrototype reservationCapacityPrototypeModel = new ReservationCapacityPrototype.Builder() - .total(Long.valueOf("10")) - .build(); - - // Construct an instance of the ReservationCommittedUsePrototype model - ReservationCommittedUsePrototype reservationCommittedUsePrototypeModel = new ReservationCommittedUsePrototype.Builder() - .expirationPolicy("release") - .term("testString") - .build(); - - // Construct an instance of the ReservationProfilePrototype model - ReservationProfilePrototype reservationProfilePrototypeModel = new ReservationProfilePrototype.Builder() - .name("bx2-4x16") - .resourceType("bare_metal_server_profile") - .build(); - - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the CreateReservationOptions model - CreateReservationOptions createReservationOptionsModel = new CreateReservationOptions.Builder() - .capacity(reservationCapacityPrototypeModel) - .committedUse(reservationCommittedUsePrototypeModel) - .profile(reservationProfilePrototypeModel) - .zone(zoneIdentityModel) - .affinityPolicy("automatic") - .name("my-reservation") - .resourceGroup(resourceGroupIdentityModel) - .build(); - - // Invoke createReservation() with a valid options model and verify the result - Response response = vpcService.createReservation(createReservationOptionsModel).execute(); - assertNotNull(response); - Reservation responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createReservationPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the createReservation operation with and without retries enabled - @Test - public void testCreateReservationWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testCreateReservationWOptions(); - - vpcService.disableRetries(); - testCreateReservationWOptions(); - } - - // Test the createReservation operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateReservationNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createReservation(null).execute(); - } - - // Test the deleteReservation operation with a valid options model parameter - @Test - public void testDeleteReservationWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String deleteReservationPath = "/reservations/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteReservationOptions model - DeleteReservationOptions deleteReservationOptionsModel = new DeleteReservationOptions.Builder() - .id("testString") - .build(); - - // Invoke deleteReservation() with a valid options model and verify the result - Response response = vpcService.deleteReservation(deleteReservationOptionsModel).execute(); + + // Invoke deleteInstanceGroupMembership() with a valid options model and verify the result + Response response = vpcService.deleteInstanceGroupMembership(deleteInstanceGroupMembershipOptionsModel).execute(); assertNotNull(response); - Reservation responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -12146,51 +13008,52 @@ public void testDeleteReservationWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteReservationPath); + assertEquals(parsedPath, deleteInstanceGroupMembershipPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteReservation operation with and without retries enabled + // Test the deleteInstanceGroupMembership operation with and without retries enabled @Test - public void testDeleteReservationWRetries() throws Throwable { + public void testDeleteInstanceGroupMembershipWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteReservationWOptions(); + testDeleteInstanceGroupMembershipWOptions(); vpcService.disableRetries(); - testDeleteReservationWOptions(); + testDeleteInstanceGroupMembershipWOptions(); } - // Test the deleteReservation operation with a null options model (negative test) + // Test the deleteInstanceGroupMembership operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteReservationNoOptions() throws Throwable { + public void testDeleteInstanceGroupMembershipNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteReservation(null).execute(); + vpcService.deleteInstanceGroupMembership(null).execute(); } - // Test the getReservation operation with a valid options model parameter + // Test the getInstanceGroupMembership operation with a valid options model parameter @Test - public void testGetReservationWOptions() throws Throwable { + public void testGetInstanceGroupMembershipWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getReservationPath = "/reservations/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_instance_on_membership_delete\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"id\": \"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"instance_template\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"name\": \"my-instance-template\"}, \"name\": \"my-instance-group-membership\", \"pool_member\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}, \"status\": \"deleting\", \"updated_at\": \"2019-01-01T12:00:00.000Z\"}"; + String getInstanceGroupMembershipPath = "/instance_groups/testString/memberships/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetReservationOptions model - GetReservationOptions getReservationOptionsModel = new GetReservationOptions.Builder() + // Construct an instance of the GetInstanceGroupMembershipOptions model + GetInstanceGroupMembershipOptions getInstanceGroupMembershipOptionsModel = new GetInstanceGroupMembershipOptions.Builder() + .instanceGroupId("testString") .id("testString") .build(); - // Invoke getReservation() with a valid options model and verify the result - Response response = vpcService.getReservation(getReservationOptionsModel).execute(); + // Invoke getInstanceGroupMembership() with a valid options model and verify the result + Response response = vpcService.getInstanceGroupMembership(getInstanceGroupMembershipOptionsModel).execute(); assertNotNull(response); - Reservation responseObj = response.getResult(); + InstanceGroupMembership responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -12199,79 +13062,60 @@ public void testGetReservationWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getReservationPath); + assertEquals(parsedPath, getInstanceGroupMembershipPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getReservation operation with and without retries enabled + // Test the getInstanceGroupMembership operation with and without retries enabled @Test - public void testGetReservationWRetries() throws Throwable { + public void testGetInstanceGroupMembershipWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetReservationWOptions(); + testGetInstanceGroupMembershipWOptions(); vpcService.disableRetries(); - testGetReservationWOptions(); + testGetInstanceGroupMembershipWOptions(); } - // Test the getReservation operation with a null options model (negative test) + // Test the getInstanceGroupMembership operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetReservationNoOptions() throws Throwable { + public void testGetInstanceGroupMembershipNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getReservation(null).execute(); + vpcService.getInstanceGroupMembership(null).execute(); } - // Test the updateReservation operation with a valid options model parameter + // Test the updateInstanceGroupMembership operation with a valid options model parameter @Test - public void testUpdateReservationWOptions() throws Throwable { + public void testUpdateInstanceGroupMembershipWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateReservationPath = "/reservations/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_instance_on_membership_delete\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"id\": \"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"instance_template\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"name\": \"my-instance-template\"}, \"name\": \"my-instance-group-membership\", \"pool_member\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}, \"status\": \"deleting\", \"updated_at\": \"2019-01-01T12:00:00.000Z\"}"; + String updateInstanceGroupMembershipPath = "/instance_groups/testString/memberships/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ReservationCapacityPatch model - ReservationCapacityPatch reservationCapacityPatchModel = new ReservationCapacityPatch.Builder() - .total(Long.valueOf("10")) - .build(); - - // Construct an instance of the ReservationCommittedUsePatch model - ReservationCommittedUsePatch reservationCommittedUsePatchModel = new ReservationCommittedUsePatch.Builder() - .expirationPolicy("release") - .term("testString") - .build(); - - // Construct an instance of the ReservationProfilePatch model - ReservationProfilePatch reservationProfilePatchModel = new ReservationProfilePatch.Builder() - .name("bx2-4x16") - .resourceType("bare_metal_server_profile") - .build(); - - // Construct an instance of the ReservationPatch model - ReservationPatch reservationPatchModel = new ReservationPatch.Builder() - .affinityPolicy("automatic") - .capacity(reservationCapacityPatchModel) - .committedUse(reservationCommittedUsePatchModel) - .name("my-reservation") - .profile(reservationProfilePatchModel) + // Construct an instance of the InstanceGroupMembershipPatch model + InstanceGroupMembershipPatch instanceGroupMembershipPatchModel = new InstanceGroupMembershipPatch.Builder() + .deleteInstanceOnMembershipDelete(false) + .name("my-instance-group-membership") .build(); - Map reservationPatchModelAsPatch = reservationPatchModel.asPatch(); + Map instanceGroupMembershipPatchModelAsPatch = instanceGroupMembershipPatchModel.asPatch(); - // Construct an instance of the UpdateReservationOptions model - UpdateReservationOptions updateReservationOptionsModel = new UpdateReservationOptions.Builder() + // Construct an instance of the UpdateInstanceGroupMembershipOptions model + UpdateInstanceGroupMembershipOptions updateInstanceGroupMembershipOptionsModel = new UpdateInstanceGroupMembershipOptions.Builder() + .instanceGroupId("testString") .id("testString") - .reservationPatch(reservationPatchModelAsPatch) + .instanceGroupMembershipPatch(instanceGroupMembershipPatchModelAsPatch) .build(); - // Invoke updateReservation() with a valid options model and verify the result - Response response = vpcService.updateReservation(updateReservationOptionsModel).execute(); + // Invoke updateInstanceGroupMembership() with a valid options model and verify the result + Response response = vpcService.updateInstanceGroupMembership(updateInstanceGroupMembershipOptionsModel).execute(); assertNotNull(response); - Reservation responseObj = response.getResult(); + InstanceGroupMembership responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -12280,220 +13124,159 @@ public void testUpdateReservationWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateReservationPath); + assertEquals(parsedPath, updateInstanceGroupMembershipPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateReservation operation with and without retries enabled + // Test the updateInstanceGroupMembership operation with and without retries enabled @Test - public void testUpdateReservationWRetries() throws Throwable { + public void testUpdateInstanceGroupMembershipWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateReservationWOptions(); + testUpdateInstanceGroupMembershipWOptions(); vpcService.disableRetries(); - testUpdateReservationWOptions(); + testUpdateInstanceGroupMembershipWOptions(); } - // Test the updateReservation operation with a null options model (negative test) + // Test the updateInstanceGroupMembership operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateReservationNoOptions() throws Throwable { + public void testUpdateInstanceGroupMembershipNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateReservation(null).execute(); + vpcService.updateInstanceGroupMembership(null).execute(); } - // Test the activateReservation operation with a valid options model parameter + // Test the listInstanceTemplates operation with a valid options model parameter @Test - public void testActivateReservationWOptions() throws Throwable { + public void testListInstanceTemplatesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String activateReservationPath = "/reservations/testString/activate"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"templates\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"cluster_network_attachments\": [{\"cluster_network_interface\": {\"auto_delete\": false, \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\"}, \"subnet\": {\"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\"}}, \"name\": \"my-instance-network-attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"enable_secure_boot\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"keys\": [{\"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"vcpu\": {\"percentage\": 100}, \"volume_attachments\": [{\"delete_volume_on_instance_delete\": false, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"volume_bandwidth_qos_mode\": \"pooled\", \"vpc\": {\"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"bandwidth\": 1000, \"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"zone\": {\"name\": \"us-south-1\"}, \"network_attachments\": [{\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}], \"primary_network_attachment\": {\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}}], \"total_count\": 132}"; + String listInstanceTemplatesPath = "/instance/templates"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ActivateReservationOptions model - ActivateReservationOptions activateReservationOptionsModel = new ActivateReservationOptions.Builder() - .id("testString") - .build(); + // Construct an instance of the ListInstanceTemplatesOptions model + ListInstanceTemplatesOptions listInstanceTemplatesOptionsModel = new ListInstanceTemplatesOptions(); - // Invoke activateReservation() with a valid options model and verify the result - Response response = vpcService.activateReservation(activateReservationOptionsModel).execute(); + // Invoke listInstanceTemplates() with a valid options model and verify the result + Response response = vpcService.listInstanceTemplates(listInstanceTemplatesOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + InstanceTemplateCollection responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, activateReservationPath); + assertEquals(parsedPath, listInstanceTemplatesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the activateReservation operation with and without retries enabled + // Test the listInstanceTemplates operation with and without retries enabled @Test - public void testActivateReservationWRetries() throws Throwable { + public void testListInstanceTemplatesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testActivateReservationWOptions(); + testListInstanceTemplatesWOptions(); vpcService.disableRetries(); - testActivateReservationWOptions(); - } - - // Test the activateReservation operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testActivateReservationNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.activateReservation(null).execute(); + testListInstanceTemplatesWOptions(); } - // Test the listDedicatedHostGroups operation with a valid options model parameter + // Test the createInstanceTemplate operation with a valid options model parameter @Test - public void testListDedicatedHostGroupsWOptions() throws Throwable { + public void testCreateInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"groups\": [{\"class\": \"bx2\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"dedicated_hosts\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host_group\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listDedicatedHostGroupsPath = "/dedicated_host/groups"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"cluster_network_attachments\": [{\"cluster_network_interface\": {\"auto_delete\": false, \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\"}, \"subnet\": {\"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\"}}, \"name\": \"my-instance-network-attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"enable_secure_boot\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"keys\": [{\"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"vcpu\": {\"percentage\": 100}, \"volume_attachments\": [{\"delete_volume_on_instance_delete\": false, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"volume_bandwidth_qos_mode\": \"pooled\", \"vpc\": {\"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"bandwidth\": 1000, \"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"zone\": {\"name\": \"us-south-1\"}, \"network_attachments\": [{\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}], \"primary_network_attachment\": {\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}}"; + String createInstanceTemplatePath = "/instance/templates"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ListDedicatedHostGroupsOptions model - ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptionsModel = new ListDedicatedHostGroupsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") + // Construct an instance of the InstanceAvailabilityPolicyPrototype model + InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() + .hostFailure("restart") .build(); - // Invoke listDedicatedHostGroups() with a valid options model and verify the result - Response response = vpcService.listDedicatedHostGroups(listDedicatedHostGroupsOptionsModel).execute(); - assertNotNull(response); - DedicatedHostGroupCollection responseObj = response.getResult(); - assertNotNull(responseObj); + // Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") + .build(); - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listDedicatedHostGroupsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("zone.name"), "us-south-1"); - assertEquals(query.get("name"), "my-name"); - } + // Construct an instance of the ClusterNetworkSubnetIdentityById model + ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() + .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") + .build(); - // Test the listDedicatedHostGroups operation with and without retries enabled - @Test - public void testListDedicatedHostGroupsWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListDedicatedHostGroupsWOptions(); + // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() + .autoDelete(false) + .name("my-cluster-network-interface") + .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) + .subnet(clusterNetworkSubnetIdentityModel) + .build(); - vpcService.disableRetries(); - testListDedicatedHostGroupsWOptions(); - } + // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model + InstanceClusterNetworkAttachmentPrototypeInstanceContext instanceClusterNetworkAttachmentPrototypeInstanceContextModel = new InstanceClusterNetworkAttachmentPrototypeInstanceContext.Builder() + .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) + .name("my-instance-network-attachment") + .build(); - // Test the listDedicatedHostGroups operation using the DedicatedHostGroupsPager.getNext() method - @Test - public void testListDedicatedHostGroupsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"bx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"bx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + // Construct an instance of the TrustedProfileIdentityById model + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); - ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") + // Construct an instance of the InstanceDefaultTrustedProfilePrototype model + InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) .build(); - List allResults = new ArrayList<>(); - DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(vpcService, listDedicatedHostGroupsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); - } - - // Test the listDedicatedHostGroups operation using the DedicatedHostGroupsPager.getAll() method - @Test - public void testListDedicatedHostGroupsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"bx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"groups\":[{\"class\":\"bx2\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"dedicated_hosts\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host_group\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + // Construct an instance of the KeyIdentityById model + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") + .build(); - ListDedicatedHostGroupsOptions listDedicatedHostGroupsOptions = new ListDedicatedHostGroupsOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") + // Construct an instance of the InstanceMetadataServicePrototype model + InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() + .enabled(false) + .protocol("https") + .responseHopLimit(Long.valueOf("2")) .build(); - DedicatedHostGroupsPager pager = new DedicatedHostGroupsPager(vpcService, listDedicatedHostGroupsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createDedicatedHostGroup operation with a valid options model parameter - @Test - public void testCreateDedicatedHostGroupWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"class\": \"bx2\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"dedicated_hosts\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host_group\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createDedicatedHostGroupPath = "/dedicated_host/groups"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); + // Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the InstanceProfileIdentityByName model + InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() + .name("bx2-4x16") + .build(); + + // Construct an instance of the ReservationIdentityById model + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .build(); + + // Construct an instance of the InstanceReservationAffinityPrototype model + InstanceReservationAffinityPrototype instanceReservationAffinityPrototypeModel = new InstanceReservationAffinityPrototype.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) .build(); // Construct an instance of the ResourceGroupIdentityById model @@ -12501,19 +13284,155 @@ public void testCreateDedicatedHostGroupWOptions() throws Throwable { .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the CreateDedicatedHostGroupOptions model - CreateDedicatedHostGroupOptions createDedicatedHostGroupOptionsModel = new CreateDedicatedHostGroupOptions.Builder() - .xClass("mx2") - .family("balanced") - .zone(zoneIdentityModel) - .name("testString") + // Construct an instance of the InstanceVCPUPrototype model + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + + // Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById model + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() + .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); + + // Construct an instance of the VolumeAttachmentPrototype model + VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype.Builder() + .deleteVolumeOnInstanceDelete(false) + .name("my-volume-attachment") + .volume(volumeAttachmentPrototypeVolumeModel) + .build(); + + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + // Construct an instance of the VolumeAllowedUsePrototype model + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion(version) + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + + // Construct an instance of the EncryptionKeyIdentityByCRN model + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + + // Construct an instance of the VolumeProfileIdentityByName model + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("general-purpose") + .build(); + + // Construct an instance of the VolumePrototypeInstanceByImageContext model + VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) + .bandwidth(Long.valueOf("1000")) + .capacity(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-boot-volume") + .profile(volumeProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) .build(); - // Invoke createDedicatedHostGroup() with a valid options model and verify the result - Response response = vpcService.createDedicatedHostGroup(createDedicatedHostGroupOptionsModel).execute(); + // Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model + VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceByImageContextModel) + .build(); + + // Construct an instance of the ImageIdentityById model + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() + .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .build(); + + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + // Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model + InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + // Construct an instance of the InstanceNetworkAttachmentPrototype model + InstanceNetworkAttachmentPrototype instanceNetworkAttachmentPrototypeModel = new InstanceNetworkAttachmentPrototype.Builder() + .name("my-instance-network-attachment") + .virtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .build(); + + // Construct an instance of the InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment model + InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment instanceTemplatePrototypeModel = new InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment.Builder() + .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) + .clusterNetworkAttachments(java.util.Arrays.asList(instanceClusterNetworkAttachmentPrototypeInstanceContextModel)) + .confidentialComputeMode("disabled") + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .enableSecureBoot(true) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance") + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .reservationAffinity(instanceReservationAffinityPrototypeModel) + .resourceGroup(resourceGroupIdentityModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .vcpu(instanceVcpuPrototypeModel) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") + .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .image(imageIdentityModel) + .zone(zoneIdentityModel) + .networkAttachments(java.util.Arrays.asList(instanceNetworkAttachmentPrototypeModel)) + .primaryNetworkAttachment(instanceNetworkAttachmentPrototypeModel) + .build(); + + // Construct an instance of the CreateInstanceTemplateOptions model + CreateInstanceTemplateOptions createInstanceTemplateOptionsModel = new CreateInstanceTemplateOptions.Builder() + .instanceTemplatePrototype(instanceTemplatePrototypeModel) + .build(); + + // Invoke createInstanceTemplate() with a valid options model and verify the result + Response response = vpcService.createInstanceTemplate(createInstanceTemplateOptionsModel).execute(); assertNotNull(response); - DedicatedHostGroup responseObj = response.getResult(); + InstanceTemplate responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -12522,48 +13441,48 @@ public void testCreateDedicatedHostGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createDedicatedHostGroupPath); + assertEquals(parsedPath, createInstanceTemplatePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createDedicatedHostGroup operation with and without retries enabled + // Test the createInstanceTemplate operation with and without retries enabled @Test - public void testCreateDedicatedHostGroupWRetries() throws Throwable { + public void testCreateInstanceTemplateWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateDedicatedHostGroupWOptions(); + testCreateInstanceTemplateWOptions(); vpcService.disableRetries(); - testCreateDedicatedHostGroupWOptions(); + testCreateInstanceTemplateWOptions(); } - // Test the createDedicatedHostGroup operation with a null options model (negative test) + // Test the createInstanceTemplate operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateDedicatedHostGroupNoOptions() throws Throwable { + public void testCreateInstanceTemplateNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createDedicatedHostGroup(null).execute(); + vpcService.createInstanceTemplate(null).execute(); } - // Test the deleteDedicatedHostGroup operation with a valid options model parameter + // Test the deleteInstanceTemplate operation with a valid options model parameter @Test - public void testDeleteDedicatedHostGroupWOptions() throws Throwable { + public void testDeleteInstanceTemplateWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteDedicatedHostGroupPath = "/dedicated_host/groups/testString"; + String deleteInstanceTemplatePath = "/instance/templates/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteDedicatedHostGroupOptions model - DeleteDedicatedHostGroupOptions deleteDedicatedHostGroupOptionsModel = new DeleteDedicatedHostGroupOptions.Builder() + // Construct an instance of the DeleteInstanceTemplateOptions model + DeleteInstanceTemplateOptions deleteInstanceTemplateOptionsModel = new DeleteInstanceTemplateOptions.Builder() .id("testString") .build(); - // Invoke deleteDedicatedHostGroup() with a valid options model and verify the result - Response response = vpcService.deleteDedicatedHostGroup(deleteDedicatedHostGroupOptionsModel).execute(); + // Invoke deleteInstanceTemplate() with a valid options model and verify the result + Response response = vpcService.deleteInstanceTemplate(deleteInstanceTemplateOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -12574,51 +13493,51 @@ public void testDeleteDedicatedHostGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteDedicatedHostGroupPath); + assertEquals(parsedPath, deleteInstanceTemplatePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteDedicatedHostGroup operation with and without retries enabled + // Test the deleteInstanceTemplate operation with and without retries enabled @Test - public void testDeleteDedicatedHostGroupWRetries() throws Throwable { + public void testDeleteInstanceTemplateWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteDedicatedHostGroupWOptions(); + testDeleteInstanceTemplateWOptions(); vpcService.disableRetries(); - testDeleteDedicatedHostGroupWOptions(); + testDeleteInstanceTemplateWOptions(); } - // Test the deleteDedicatedHostGroup operation with a null options model (negative test) + // Test the deleteInstanceTemplate operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteDedicatedHostGroupNoOptions() throws Throwable { + public void testDeleteInstanceTemplateNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteDedicatedHostGroup(null).execute(); + vpcService.deleteInstanceTemplate(null).execute(); } - // Test the getDedicatedHostGroup operation with a valid options model parameter + // Test the getInstanceTemplate operation with a valid options model parameter @Test - public void testGetDedicatedHostGroupWOptions() throws Throwable { + public void testGetInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"class\": \"bx2\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"dedicated_hosts\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host_group\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getDedicatedHostGroupPath = "/dedicated_host/groups/testString"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"cluster_network_attachments\": [{\"cluster_network_interface\": {\"auto_delete\": false, \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\"}, \"subnet\": {\"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\"}}, \"name\": \"my-instance-network-attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"enable_secure_boot\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"keys\": [{\"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"vcpu\": {\"percentage\": 100}, \"volume_attachments\": [{\"delete_volume_on_instance_delete\": false, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"volume_bandwidth_qos_mode\": \"pooled\", \"vpc\": {\"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"bandwidth\": 1000, \"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"zone\": {\"name\": \"us-south-1\"}, \"network_attachments\": [{\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}], \"primary_network_attachment\": {\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}}"; + String getInstanceTemplatePath = "/instance/templates/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetDedicatedHostGroupOptions model - GetDedicatedHostGroupOptions getDedicatedHostGroupOptionsModel = new GetDedicatedHostGroupOptions.Builder() + // Construct an instance of the GetInstanceTemplateOptions model + GetInstanceTemplateOptions getInstanceTemplateOptionsModel = new GetInstanceTemplateOptions.Builder() .id("testString") .build(); - // Invoke getDedicatedHostGroup() with a valid options model and verify the result - Response response = vpcService.getDedicatedHostGroup(getDedicatedHostGroupOptionsModel).execute(); + // Invoke getInstanceTemplate() with a valid options model and verify the result + Response response = vpcService.getInstanceTemplate(getInstanceTemplateOptionsModel).execute(); assertNotNull(response); - DedicatedHostGroup responseObj = response.getResult(); + InstanceTemplate responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -12627,58 +13546,58 @@ public void testGetDedicatedHostGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getDedicatedHostGroupPath); + assertEquals(parsedPath, getInstanceTemplatePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getDedicatedHostGroup operation with and without retries enabled + // Test the getInstanceTemplate operation with and without retries enabled @Test - public void testGetDedicatedHostGroupWRetries() throws Throwable { + public void testGetInstanceTemplateWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetDedicatedHostGroupWOptions(); + testGetInstanceTemplateWOptions(); vpcService.disableRetries(); - testGetDedicatedHostGroupWOptions(); + testGetInstanceTemplateWOptions(); } - // Test the getDedicatedHostGroup operation with a null options model (negative test) + // Test the getInstanceTemplate operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetDedicatedHostGroupNoOptions() throws Throwable { + public void testGetInstanceTemplateNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getDedicatedHostGroup(null).execute(); + vpcService.getInstanceTemplate(null).execute(); } - // Test the updateDedicatedHostGroup operation with a valid options model parameter + // Test the updateInstanceTemplate operation with a valid options model parameter @Test - public void testUpdateDedicatedHostGroupWOptions() throws Throwable { + public void testUpdateInstanceTemplateWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"class\": \"bx2\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"dedicated_hosts\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host_group\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateDedicatedHostGroupPath = "/dedicated_host/groups/testString"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"cluster_network_attachments\": [{\"cluster_network_interface\": {\"auto_delete\": false, \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\"}, \"subnet\": {\"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\"}}, \"name\": \"my-instance-network-attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-template:0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"default_trusted_profile\": {\"auto_link\": false, \"target\": {\"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\"}}, \"enable_secure_boot\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/templates/0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"id\": \"0717-e6c2c7d8-ad57-4f38-a21c-a86265b6aeb2\", \"keys\": [{\"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\"}], \"metadata_service\": {\"enabled\": false, \"protocol\": \"https\", \"response_hop_limit\": 2}, \"name\": \"my-instance-template\", \"placement_target\": {\"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\"}, \"profile\": {\"name\": \"bx2-4x16\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"total_volume_bandwidth\": 500, \"user_data\": \"userData\", \"vcpu\": {\"percentage\": 100}, \"volume_attachments\": [{\"delete_volume_on_instance_delete\": false, \"name\": \"my-volume-attachment\", \"volume\": {\"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\"}}], \"volume_bandwidth_qos_mode\": \"pooled\", \"vpc\": {\"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\"}, \"boot_volume_attachment\": {\"delete_volume_on_instance_delete\": true, \"name\": \"my-volume-attachment\", \"volume\": {\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"bandwidth\": 1000, \"capacity\": 100, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"iops\": 10000, \"name\": \"my-volume\", \"profile\": {\"name\": \"general-purpose\"}, \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"user_tags\": [\"userTags\"]}}, \"image\": {\"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\"}, \"zone\": {\"name\": \"us-south-1\"}, \"network_attachments\": [{\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}], \"primary_network_attachment\": {\"name\": \"my-instance-network-attachment\", \"virtual_network_interface\": {\"allow_ip_spoofing\": true, \"auto_delete\": false, \"enable_infrastructure_nat\": true, \"ips\": [{\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}], \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"id\": \"fee82deba12e4c0fb69c3b09d1f12345\"}, \"security_groups\": [{\"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\"}], \"subnet\": {\"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\"}}}}"; + String updateInstanceTemplatePath = "/instance/templates/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DedicatedHostGroupPatch model - DedicatedHostGroupPatch dedicatedHostGroupPatchModel = new DedicatedHostGroupPatch.Builder() - .name("my-dedicated-host-group-updated") + // Construct an instance of the InstanceTemplatePatch model + InstanceTemplatePatch instanceTemplatePatchModel = new InstanceTemplatePatch.Builder() + .name("my-instance-template-updated") .build(); - Map dedicatedHostGroupPatchModelAsPatch = dedicatedHostGroupPatchModel.asPatch(); + Map instanceTemplatePatchModelAsPatch = instanceTemplatePatchModel.asPatch(); - // Construct an instance of the UpdateDedicatedHostGroupOptions model - UpdateDedicatedHostGroupOptions updateDedicatedHostGroupOptionsModel = new UpdateDedicatedHostGroupOptions.Builder() + // Construct an instance of the UpdateInstanceTemplateOptions model + UpdateInstanceTemplateOptions updateInstanceTemplateOptionsModel = new UpdateInstanceTemplateOptions.Builder() .id("testString") - .dedicatedHostGroupPatch(dedicatedHostGroupPatchModelAsPatch) + .instanceTemplatePatch(instanceTemplatePatchModelAsPatch) .build(); - // Invoke updateDedicatedHostGroup() with a valid options model and verify the result - Response response = vpcService.updateDedicatedHostGroup(updateDedicatedHostGroupOptionsModel).execute(); + // Invoke updateInstanceTemplate() with a valid options model and verify the result + Response response = vpcService.updateInstanceTemplate(updateInstanceTemplateOptionsModel).execute(); assertNotNull(response); - DedicatedHostGroup responseObj = response.getResult(); + InstanceTemplate responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -12687,52 +13606,49 @@ public void testUpdateDedicatedHostGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateDedicatedHostGroupPath); + assertEquals(parsedPath, updateInstanceTemplatePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateDedicatedHostGroup operation with and without retries enabled + // Test the updateInstanceTemplate operation with and without retries enabled @Test - public void testUpdateDedicatedHostGroupWRetries() throws Throwable { + public void testUpdateInstanceTemplateWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateDedicatedHostGroupWOptions(); + testUpdateInstanceTemplateWOptions(); vpcService.disableRetries(); - testUpdateDedicatedHostGroupWOptions(); + testUpdateInstanceTemplateWOptions(); } - // Test the updateDedicatedHostGroup operation with a null options model (negative test) + // Test the updateInstanceTemplate operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateDedicatedHostGroupNoOptions() throws Throwable { + public void testUpdateInstanceTemplateNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateDedicatedHostGroup(null).execute(); + vpcService.updateInstanceTemplate(null).execute(); } - // Test the listDedicatedHostProfiles operation with a valid options model parameter + // Test the listInstanceProfiles operation with a valid options model parameter @Test - public void testListDedicatedHostProfilesWOptions() throws Throwable { + public void testListInstanceProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"class\": \"bx2\", \"disks\": [{\"interface_type\": {\"type\": \"fixed\", \"value\": \"nvme\"}, \"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 3200}, \"supported_instance_interface_types\": {\"type\": \"fixed\", \"value\": [\"nvme\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"mx2-host-152x1216\", \"socket_count\": {\"type\": \"fixed\", \"value\": 2}, \"status\": \"current\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"vcpu_count\": {\"type\": \"fixed\", \"value\": 16}, \"vcpu_manufacturer\": {\"type\": \"fixed\", \"value\": \"intel\"}}], \"total_count\": 132}"; - String listDedicatedHostProfilesPath = "/dedicated_host/profiles"; + String mockResponseBody = "{\"profiles\": [{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"cluster_network_attachment_count\": {\"type\": \"dependent\"}, \"confidential_compute_modes\": {\"default\": \"disabled\", \"type\": \"enum\", \"values\": [\"disabled\"]}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"nvme\", \"type\": \"enum\", \"values\": [\"nvme\"]}}], \"family\": \"balanced\", \"gpu_count\": {\"type\": \"fixed\", \"value\": 2}, \"gpu_manufacturer\": {\"type\": \"enum\", \"values\": [\"amd\"]}, \"gpu_memory\": {\"type\": \"fixed\", \"value\": 16}, \"gpu_model\": {\"type\": \"enum\", \"values\": [\"Tesla V100\"]}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-4x16\", \"network_attachment_count\": {\"max\": 5, \"min\": 1, \"type\": \"range\"}, \"network_interface_count\": {\"max\": 5, \"min\": 1, \"type\": \"range\"}, \"numa_count\": {\"type\": \"fixed\", \"value\": 2}, \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"port_speed\": {\"type\": \"fixed\", \"value\": 1000}, \"reservation_terms\": {\"type\": \"enum\", \"values\": [\"one_year\"]}, \"resource_type\": \"instance_profile\", \"secure_boot_modes\": {\"default\": true, \"type\": \"enum\", \"values\": [true]}, \"status\": \"current\", \"supported_cluster_network_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}], \"total_volume_bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"vcpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"vcpu_burst_limit\": {\"type\": \"fixed\", \"value\": 200}, \"vcpu_count\": {\"type\": \"fixed\", \"value\": 16}, \"vcpu_manufacturer\": {\"type\": \"fixed\", \"value\": \"intel\"}, \"vcpu_percentage\": {\"default\": 8, \"type\": \"enum\", \"values\": [6]}, \"volume_bandwidth_qos_modes\": {\"default\": \"pooled\", \"type\": \"enum\", \"values\": [\"pooled\"]}}]}"; + String listInstanceProfilesPath = "/instance/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListDedicatedHostProfilesOptions model - ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptionsModel = new ListDedicatedHostProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .build(); + // Construct an instance of the ListInstanceProfilesOptions model + ListInstanceProfilesOptions listInstanceProfilesOptionsModel = new ListInstanceProfilesOptions(); - // Invoke listDedicatedHostProfiles() with a valid options model and verify the result - Response response = vpcService.listDedicatedHostProfiles(listDedicatedHostProfilesOptionsModel).execute(); + // Invoke listInstanceProfiles() with a valid options model and verify the result + Response response = vpcService.listInstanceProfiles(listInstanceProfilesOptionsModel).execute(); assertNotNull(response); - DedicatedHostProfileCollection responseObj = response.getResult(); + InstanceProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -12741,108 +13657,44 @@ public void testListDedicatedHostProfilesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listDedicatedHostProfilesPath); + assertEquals(parsedPath, listInstanceProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listDedicatedHostProfiles operation with and without retries enabled + // Test the listInstanceProfiles operation with and without retries enabled @Test - public void testListDedicatedHostProfilesWRetries() throws Throwable { + public void testListInstanceProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListDedicatedHostProfilesWOptions(); + testListInstanceProfilesWOptions(); vpcService.disableRetries(); - testListDedicatedHostProfilesWOptions(); - } - - // Test the listDedicatedHostProfiles operation using the DedicatedHostProfilesPager.getNext() method - @Test - public void testListDedicatedHostProfilesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"bx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"status\":\"current\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16},\"vcpu_manufacturer\":{\"type\":\"fixed\",\"value\":\"intel\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"bx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"status\":\"current\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16},\"vcpu_manufacturer\":{\"type\":\"fixed\",\"value\":\"intel\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .build(); - - List allResults = new ArrayList<>(); - DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(vpcService, listDedicatedHostProfilesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + testListInstanceProfilesWOptions(); } - - // Test the listDedicatedHostProfiles operation using the DedicatedHostProfilesPager.getAll() method - @Test - public void testListDedicatedHostProfilesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"bx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"status\":\"current\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16},\"vcpu_manufacturer\":{\"type\":\"fixed\",\"value\":\"intel\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"class\":\"bx2\",\"disks\":[{\"interface_type\":{\"type\":\"fixed\",\"value\":\"nvme\"},\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":3200},\"supported_instance_interface_types\":{\"type\":\"fixed\",\"value\":[\"nvme\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"mx2-host-152x1216\",\"socket_count\":{\"type\":\"fixed\",\"value\":2},\"status\":\"current\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"vcpu_count\":{\"type\":\"fixed\",\"value\":16},\"vcpu_manufacturer\":{\"type\":\"fixed\",\"value\":\"intel\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListDedicatedHostProfilesOptions listDedicatedHostProfilesOptions = new ListDedicatedHostProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .build(); - DedicatedHostProfilesPager pager = new DedicatedHostProfilesPager(vpcService, listDedicatedHostProfilesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the getDedicatedHostProfile operation with a valid options model parameter + // Test the getInstanceProfile operation with a valid options model parameter @Test - public void testGetDedicatedHostProfileWOptions() throws Throwable { + public void testGetInstanceProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"class\": \"bx2\", \"disks\": [{\"interface_type\": {\"type\": \"fixed\", \"value\": \"nvme\"}, \"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 3200}, \"supported_instance_interface_types\": {\"type\": \"fixed\", \"value\": [\"nvme\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"mx2-host-152x1216\", \"socket_count\": {\"type\": \"fixed\", \"value\": 2}, \"status\": \"current\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"vcpu_count\": {\"type\": \"fixed\", \"value\": 16}, \"vcpu_manufacturer\": {\"type\": \"fixed\", \"value\": \"intel\"}}"; - String getDedicatedHostProfilePath = "/dedicated_host/profiles/mx2-host-152x1216"; + String mockResponseBody = "{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"cluster_network_attachment_count\": {\"type\": \"dependent\"}, \"confidential_compute_modes\": {\"default\": \"disabled\", \"type\": \"enum\", \"values\": [\"disabled\"]}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"nvme\", \"type\": \"enum\", \"values\": [\"nvme\"]}}], \"family\": \"balanced\", \"gpu_count\": {\"type\": \"fixed\", \"value\": 2}, \"gpu_manufacturer\": {\"type\": \"enum\", \"values\": [\"amd\"]}, \"gpu_memory\": {\"type\": \"fixed\", \"value\": 16}, \"gpu_model\": {\"type\": \"enum\", \"values\": [\"Tesla V100\"]}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-4x16\", \"network_attachment_count\": {\"max\": 5, \"min\": 1, \"type\": \"range\"}, \"network_interface_count\": {\"max\": 5, \"min\": 1, \"type\": \"range\"}, \"numa_count\": {\"type\": \"fixed\", \"value\": 2}, \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"port_speed\": {\"type\": \"fixed\", \"value\": 1000}, \"reservation_terms\": {\"type\": \"enum\", \"values\": [\"one_year\"]}, \"resource_type\": \"instance_profile\", \"secure_boot_modes\": {\"default\": true, \"type\": \"enum\", \"values\": [true]}, \"status\": \"current\", \"supported_cluster_network_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}], \"total_volume_bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"vcpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"vcpu_burst_limit\": {\"type\": \"fixed\", \"value\": 200}, \"vcpu_count\": {\"type\": \"fixed\", \"value\": 16}, \"vcpu_manufacturer\": {\"type\": \"fixed\", \"value\": \"intel\"}, \"vcpu_percentage\": {\"default\": 8, \"type\": \"enum\", \"values\": [6]}, \"volume_bandwidth_qos_modes\": {\"default\": \"pooled\", \"type\": \"enum\", \"values\": [\"pooled\"]}}"; + String getInstanceProfilePath = "/instance/profiles/mx2-host-152x1216"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetDedicatedHostProfileOptions model - GetDedicatedHostProfileOptions getDedicatedHostProfileOptionsModel = new GetDedicatedHostProfileOptions.Builder() + // Construct an instance of the GetInstanceProfileOptions model + GetInstanceProfileOptions getInstanceProfileOptionsModel = new GetInstanceProfileOptions.Builder() .name("mx2-host-152x1216") .build(); - // Invoke getDedicatedHostProfile() with a valid options model and verify the result - Response response = vpcService.getDedicatedHostProfile(getDedicatedHostProfileOptionsModel).execute(); + // Invoke getInstanceProfile() with a valid options model and verify the result + Response response = vpcService.getInstanceProfile(getInstanceProfileOptionsModel).execute(); assertNotNull(response); - DedicatedHostProfile responseObj = response.getResult(); + InstanceProfile responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -12851,56 +13703,72 @@ public void testGetDedicatedHostProfileWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getDedicatedHostProfilePath); + assertEquals(parsedPath, getInstanceProfilePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getDedicatedHostProfile operation with and without retries enabled + // Test the getInstanceProfile operation with and without retries enabled @Test - public void testGetDedicatedHostProfileWRetries() throws Throwable { + public void testGetInstanceProfileWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetDedicatedHostProfileWOptions(); + testGetInstanceProfileWOptions(); vpcService.disableRetries(); - testGetDedicatedHostProfileWOptions(); + testGetInstanceProfileWOptions(); } - // Test the getDedicatedHostProfile operation with a null options model (negative test) + // Test the getInstanceProfile operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetDedicatedHostProfileNoOptions() throws Throwable { + public void testGetInstanceProfileNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getDedicatedHostProfile(null).execute(); + vpcService.getInstanceProfile(null).execute(); } - // Test the listDedicatedHosts operation with a valid options model parameter + // Test the listInstances operation with a valid options model parameter @Test - public void testListDedicatedHostsWOptions() throws Throwable { + public void testListInstancesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"dedicated_hosts\": [{\"available_memory\": 128, \"available_vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}], \"group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"instance_placement_enabled\": true, \"instances\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}], \"lifecycle_state\": \"stable\", \"memory\": 128, \"name\": \"my-host\", \"numa\": {\"count\": 2, \"nodes\": [{\"available_vcpu\": 24, \"vcpu\": 56}]}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"mx2-host-152x1216\"}, \"provisionable\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host\", \"socket_count\": 4, \"state\": \"available\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listDedicatedHostsPath = "/dedicated_hosts"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"instances\": [{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"cluster_network\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"name\": \"my-cluster-network\", \"resource_type\": \"cluster_network\"}, \"cluster_network_attachments\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"enable_secure_boot\": true, \"gpu\": {\"count\": 1, \"manufacturer\": \"amd\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"instance_group_membership\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"id\": \"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"name\": \"my-instance-group-membership\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 64, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"numa_count\": 2, \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"burst\": {\"limit\": 100}, \"count\": 4, \"manufacturer\": \"intel\", \"percentage\": 100}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"volume_bandwidth_qos_mode\": \"pooled\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listInstancesPath = "/instances"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListDedicatedHostsOptions model - ListDedicatedHostsOptions listDedicatedHostsOptionsModel = new ListDedicatedHostsOptions.Builder() - .dedicatedHostGroupId("testString") + // Construct an instance of the ListInstancesOptions model + ListInstancesOptions listInstancesOptionsModel = new ListInstancesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .zoneName("us-south-1") .name("my-name") + .clusterNetworkId("testString") + .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") + .clusterNetworkName("my-cluster-network") + .dedicatedHostId("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") + .instanceGroupMembershipInstanceGroupId("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .instanceGroupMembershipInstanceGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .placementGroupId("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") + .reservationAffinityPolicy("automatic") + .reservationId("testString") + .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .reservationName("my-reservation") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); - // Invoke listDedicatedHosts() with a valid options model and verify the result - Response response = vpcService.listDedicatedHosts(listDedicatedHostsOptionsModel).execute(); + // Invoke listInstances() with a valid options model and verify the result + Response response = vpcService.listInstances(listInstancesOptionsModel).execute(); assertNotNull(response); - DedicatedHostCollection responseObj = response.getResult(); + InstanceCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -12909,36 +13777,105 @@ public void testListDedicatedHostsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listDedicatedHostsPath); + assertEquals(parsedPath, listInstancesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("dedicated_host_group.id"), "testString"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("zone.name"), "us-south-1"); assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("cluster_network.id"), "testString"); + assertEquals(query.get("cluster_network.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573"); + assertEquals(query.get("cluster_network.name"), "my-cluster-network"); + assertEquals(query.get("dedicated_host.id"), "testString"); + assertEquals(query.get("dedicated_host.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"); + assertEquals(query.get("dedicated_host.name"), "my-dedicated-host"); + assertEquals(query.get("instance_group_membership.instance_group.id"), "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"); + assertEquals(query.get("instance_group_membership.instance_group.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"); + assertEquals(query.get("placement_group.id"), "testString"); + assertEquals(query.get("placement_group.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"); + assertEquals(query.get("placement_group.name"), "my-placement-group"); + assertEquals(query.get("reservation_affinity.policy"), "automatic"); + assertEquals(query.get("reservation.id"), "testString"); + assertEquals(query.get("reservation.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"); + assertEquals(query.get("reservation.name"), "my-reservation"); + assertEquals(query.get("vpc.id"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); } - // Test the listDedicatedHosts operation with and without retries enabled + // Test the listInstances operation with and without retries enabled @Test - public void testListDedicatedHostsWRetries() throws Throwable { + public void testListInstancesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListDedicatedHostsWOptions(); + testListInstancesWOptions(); vpcService.disableRetries(); - testListDedicatedHostsWOptions(); + testListInstancesWOptions(); } - // Test the listDedicatedHosts operation using the DedicatedHostsPager.getNext() method + // Test the listInstances operation using the InstancesPager.getNext() method @Test - public void testListDedicatedHostsWithPagerGetNext() throws Throwable { + public void testListInstancesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"id\":\"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"numa\":{\"count\":2,\"nodes\":[{\"available_vcpu\":24,\"vcpu\":56}]},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"id\":\"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"numa\":{\"count\":2,\"nodes\":[{\"available_vcpu\":24,\"vcpu\":56}]},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"cluster_network\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"name\":\"my-cluster-network\",\"resource_type\":\"cluster_network\"},\"cluster_network_attachments\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"confidential_compute_mode\":\"disabled\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"enable_secure_boot\":true,\"gpu\":{\"count\":1,\"manufacturer\":\"amd\",\"memory\":1,\"model\":\"Tesla V100\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"instance_group_membership\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\",\"id\":\"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\",\"instance_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"id\":\"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"name\":\"my-instance-group\"},\"name\":\"my-instance-group-membership\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":64,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"numa_count\":2,\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"burst\":{\"limit\":100},\"count\":4,\"manufacturer\":\"intel\",\"percentage\":100},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"volume_bandwidth_qos_mode\":\"pooled\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"cluster_network\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"name\":\"my-cluster-network\",\"resource_type\":\"cluster_network\"},\"cluster_network_attachments\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"confidential_compute_mode\":\"disabled\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"enable_secure_boot\":true,\"gpu\":{\"count\":1,\"manufacturer\":\"amd\",\"memory\":1,\"model\":\"Tesla V100\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"instance_group_membership\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\",\"id\":\"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\",\"instance_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"id\":\"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"name\":\"my-instance-group\"},\"name\":\"my-instance-group-membership\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":64,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"numa_count\":2,\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"burst\":{\"limit\":100},\"count\":4,\"manufacturer\":\"intel\",\"percentage\":100},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"volume_bandwidth_qos_mode\":\"pooled\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .clusterNetworkId("testString") + .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") + .clusterNetworkName("my-cluster-network") + .dedicatedHostId("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") + .instanceGroupMembershipInstanceGroupId("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .instanceGroupMembershipInstanceGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .placementGroupId("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") + .reservationAffinityPolicy("automatic") + .reservationId("testString") + .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .reservationName("my-reservation") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .build(); + + List allResults = new ArrayList<>(); + InstancesPager pager = new InstancesPager(vpcService, listInstancesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listInstances operation using the InstancesPager.getAll() method + @Test + public void testListInstancesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"cluster_network\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"name\":\"my-cluster-network\",\"resource_type\":\"cluster_network\"},\"cluster_network_attachments\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"confidential_compute_mode\":\"disabled\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"enable_secure_boot\":true,\"gpu\":{\"count\":1,\"manufacturer\":\"amd\",\"memory\":1,\"model\":\"Tesla V100\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"instance_group_membership\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\",\"id\":\"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\",\"instance_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"id\":\"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"name\":\"my-instance-group\"},\"name\":\"my-instance-group-membership\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":64,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"numa_count\":2,\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"burst\":{\"limit\":100},\"count\":4,\"manufacturer\":\"intel\",\"percentage\":100},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"volume_bandwidth_qos_mode\":\"pooled\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instances\":[{\"availability_policy\":{\"host_failure\":\"restart\"},\"bandwidth\":1000,\"boot_volume_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}},\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"cluster_network\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"name\":\"my-cluster-network\",\"resource_type\":\"cluster_network\"},\"cluster_network_attachments\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"confidential_compute_mode\":\"disabled\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"dedicated_host\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"my-host\",\"resource_type\":\"dedicated_host\"},\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"interface_type\":\"nvme\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\",\"size\":100}],\"enable_secure_boot\":true,\"gpu\":{\"count\":1,\"manufacturer\":\"amd\",\"memory\":1,\"model\":\"Tesla V100\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"instance_group_membership\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\",\"id\":\"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\",\"instance_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"id\":\"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\",\"name\":\"my-instance-group\"},\"name\":\"my-instance-group-membership\"},\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":64,\"metadata_service\":{\"enabled\":false,\"protocol\":\"http\",\"response_hop_limit\":1},\"name\":\"my-instance\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"numa_count\":2,\"placement_target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"instance_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"instance\",\"startable\":false,\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_storage\",\"message\":\"The virtual server instance is unusable because the encryption key for the boot volume\\nhas been deleted\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"total_network_bandwidth\":500,\"total_volume_bandwidth\":500,\"vcpu\":{\"architecture\":\"amd64\",\"burst\":{\"limit\":100},\"count\":4,\"manufacturer\":\"intel\",\"percentage\":100},\"volume_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"name\":\"my-volume-attachment\",\"volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"resource_type\":\"volume\"}}],\"volume_bandwidth_qos_mode\":\"pooled\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -12952,101 +13889,265 @@ public void testListDedicatedHostsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() - .dedicatedHostGroupId("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") + ListInstancesOptions listInstancesOptions = new ListInstancesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .clusterNetworkId("testString") + .clusterNetworkCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573") + .clusterNetworkName("my-cluster-network") + .dedicatedHostId("testString") + .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .dedicatedHostName("my-dedicated-host") + .instanceGroupMembershipInstanceGroupId("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .instanceGroupMembershipInstanceGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .placementGroupId("testString") + .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") + .placementGroupName("my-placement-group") + .reservationAffinityPolicy("automatic") + .reservationId("testString") + .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .reservationName("my-reservation") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .build(); + + InstancesPager pager = new InstancesPager(vpcService, listInstancesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createInstance operation with a valid options model parameter + @Test + public void testCreateInstanceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"cluster_network\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"name\": \"my-cluster-network\", \"resource_type\": \"cluster_network\"}, \"cluster_network_attachments\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"enable_secure_boot\": true, \"gpu\": {\"count\": 1, \"manufacturer\": \"amd\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"instance_group_membership\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"id\": \"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"name\": \"my-instance-group-membership\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 64, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"numa_count\": 2, \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"burst\": {\"limit\": 100}, \"count\": 4, \"manufacturer\": \"intel\", \"percentage\": 100}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"volume_bandwidth_qos_mode\": \"pooled\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createInstancePath = "/instances"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the InstanceAvailabilityPolicyPrototype model + InstanceAvailabilityPolicyPrototype instanceAvailabilityPolicyPrototypeModel = new InstanceAvailabilityPolicyPrototype.Builder() + .hostFailure("restart") + .build(); + + // Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") + .build(); + + // Construct an instance of the ClusterNetworkSubnetIdentityById model + ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() + .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") + .build(); + + // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() + .autoDelete(false) + .name("my-cluster-network-interface") + .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) + .subnet(clusterNetworkSubnetIdentityModel) + .build(); + + // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeInstanceContext model + InstanceClusterNetworkAttachmentPrototypeInstanceContext instanceClusterNetworkAttachmentPrototypeInstanceContextModel = new InstanceClusterNetworkAttachmentPrototypeInstanceContext.Builder() + .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) + .name("my-instance-network-attachment") + .build(); + + // Construct an instance of the TrustedProfileIdentityById model + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + + // Construct an instance of the InstanceDefaultTrustedProfilePrototype model + InstanceDefaultTrustedProfilePrototype instanceDefaultTrustedProfilePrototypeModel = new InstanceDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + + // Construct an instance of the KeyIdentityById model + KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() + .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") + .build(); + + // Construct an instance of the InstanceMetadataServicePrototype model + InstanceMetadataServicePrototype instanceMetadataServicePrototypeModel = new InstanceMetadataServicePrototype.Builder() + .enabled(false) + .protocol("https") + .responseHopLimit(Long.valueOf("2")) + .build(); + + // Construct an instance of the InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById model + InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPrototypeModel = new InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("r006-418fe842-a3e9-47b9-a938-1aa5bd632871") + .build(); + + // Construct an instance of the InstanceProfileIdentityByName model + InstanceProfileIdentityByName instanceProfileIdentityModel = new InstanceProfileIdentityByName.Builder() + .name("bx2-2x8") + .build(); + + // Construct an instance of the ReservationIdentityById model + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .build(); + + // Construct an instance of the InstanceReservationAffinityPrototype model + InstanceReservationAffinityPrototype instanceReservationAffinityPrototypeModel = new InstanceReservationAffinityPrototype.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the InstanceVCPUPrototype model + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + + // Construct an instance of the VolumeProfileIdentityByName model + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("5iops-tier") + .build(); + + // Construct an instance of the EncryptionKeyIdentityByCRN model + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + .build(); + + // Construct an instance of the VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity model + VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity.Builder() + .bandwidth(Long.valueOf("1000")) + .iops(Long.valueOf("10000")) + .name("my-data-volume") + .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .capacity(Long.valueOf("1000")) + .encryptionKey(encryptionKeyIdentityModel) + .build(); + + // Construct an instance of the VolumeAttachmentPrototype model + VolumeAttachmentPrototype volumeAttachmentPrototypeModel = new VolumeAttachmentPrototype.Builder() + .deleteVolumeOnInstanceDelete(false) + .name("my-volume-attachment") + .volume(volumeAttachmentPrototypeVolumeModel) + .build(); + + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + // Construct an instance of the VolumeAllowedUsePrototype model + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion(version) + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + + // Construct an instance of the VolumePrototypeInstanceByImageContext model + VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) + .bandwidth(Long.valueOf("1000")) + .capacity(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .iops(Long.valueOf("10000")) + .name("my-boot-volume") + .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .build(); + + // Construct an instance of the VolumeAttachmentPrototypeInstanceByImageContext model + VolumeAttachmentPrototypeInstanceByImageContext volumeAttachmentPrototypeInstanceByImageContextModel = new VolumeAttachmentPrototypeInstanceByImageContext.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") + .volume(volumePrototypeInstanceByImageContextModel) .build(); - List allResults = new ArrayList<>(); - DedicatedHostsPager pager = new DedicatedHostsPager(vpcService, listDedicatedHostsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); - } - - // Test the listDedicatedHosts operation using the DedicatedHostsPager.getAll() method - @Test - public void testListDedicatedHostsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"id\":\"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"numa\":{\"count\":2,\"nodes\":[{\"available_vcpu\":24,\"vcpu\":56}]},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"dedicated_hosts\":[{\"available_memory\":128,\"available_vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"disks\":[{\"available\":9,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"id\":\"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\",\"instance_disks\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\",\"id\":\"10c02d81-0ecb-4dc5-897d-28392913b81e\",\"name\":\"my-instance-disk\",\"resource_type\":\"instance_disk\"}],\"interface_type\":\"nvme\",\"lifecycle_state\":\"stable\",\"name\":\"my-dedicated-host-disk\",\"provisionable\":false,\"resource_type\":\"dedicated_host_disk\",\"size\":4,\"supported_instance_interface_types\":[\"nvme\"]}],\"group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"id\":\"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\",\"name\":\"my-dedicated-host-group\",\"resource_type\":\"dedicated_host_group\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"id\":\"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"instance_placement_enabled\":true,\"instances\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"}],\"lifecycle_state\":\"stable\",\"memory\":128,\"name\":\"my-host\",\"numa\":{\"count\":2,\"nodes\":[{\"available_vcpu\":24,\"vcpu\":56}]},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\",\"name\":\"mx2-host-152x1216\"},\"provisionable\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"dedicated_host\",\"socket_count\":4,\"state\":\"available\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"vcpu\":{\"architecture\":\"amd64\",\"count\":4,\"manufacturer\":\"intel\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + // Construct an instance of the ImageIdentityById model + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() + .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .build(); - ListDedicatedHostsOptions listDedicatedHostsOptions = new ListDedicatedHostsOptions.Builder() - .dedicatedHostGroupId("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .zoneName("us-south-1") - .name("my-name") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - DedicatedHostsPager pager = new DedicatedHostsPager(vpcService, listDedicatedHostsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createDedicatedHost operation with a valid options model parameter - @Test - public void testCreateDedicatedHostWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"available_memory\": 128, \"available_vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}], \"group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"instance_placement_enabled\": true, \"instances\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}], \"lifecycle_state\": \"stable\", \"memory\": 128, \"name\": \"my-host\", \"numa\": {\"count\": 2, \"nodes\": [{\"available_vcpu\": 24, \"vcpu\": 56}]}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"mx2-host-152x1216\"}, \"provisionable\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host\", \"socket_count\": 4, \"state\": \"available\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createDedicatedHostPath = "/dedicated_hosts"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); + // Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); - // Construct an instance of the DedicatedHostProfileIdentityByName model - DedicatedHostProfileIdentityByName dedicatedHostProfileIdentityModel = new DedicatedHostProfileIdentityByName.Builder() - .name("mx2-host-152x1216") + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") .build(); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - // Construct an instance of the DedicatedHostGroupIdentityById model - DedicatedHostGroupIdentityById dedicatedHostGroupIdentityModel = new DedicatedHostGroupIdentityById.Builder() - .id("0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0") + // Construct an instance of the NetworkInterfacePrototype model + NetworkInterfacePrototype networkInterfacePrototypeModel = new NetworkInterfacePrototype.Builder() + .allowIpSpoofing(true) + .name("my-instance-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) .build(); - // Construct an instance of the DedicatedHostPrototypeDedicatedHostByGroup model - DedicatedHostPrototypeDedicatedHostByGroup dedicatedHostPrototypeModel = new DedicatedHostPrototypeDedicatedHostByGroup.Builder() - .instancePlacementEnabled(true) - .name("my-host") - .profile(dedicatedHostProfileIdentityModel) + // Construct an instance of the InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface model + InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface instancePrototypeModel = new InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface.Builder() + .availabilityPolicy(instanceAvailabilityPolicyPrototypeModel) + .clusterNetworkAttachments(java.util.Arrays.asList(instanceClusterNetworkAttachmentPrototypeInstanceContextModel)) + .confidentialComputeMode("disabled") + .defaultTrustedProfile(instanceDefaultTrustedProfilePrototypeModel) + .enableSecureBoot(true) + .keys(java.util.Arrays.asList(keyIdentityModel)) + .metadataService(instanceMetadataServicePrototypeModel) + .name("my-instance") + .placementTarget(instancePlacementTargetPrototypeModel) + .profile(instanceProfileIdentityModel) + .reservationAffinity(instanceReservationAffinityPrototypeModel) .resourceGroup(resourceGroupIdentityModel) - .group(dedicatedHostGroupIdentityModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .userData("testString") + .vcpu(instanceVcpuPrototypeModel) + .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") + .vpc(vpcIdentityModel) + .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) + .image(imageIdentityModel) + .zone(zoneIdentityModel) + .networkInterfaces(java.util.Arrays.asList(networkInterfacePrototypeModel)) + .primaryNetworkInterface(networkInterfacePrototypeModel) .build(); - // Construct an instance of the CreateDedicatedHostOptions model - CreateDedicatedHostOptions createDedicatedHostOptionsModel = new CreateDedicatedHostOptions.Builder() - .dedicatedHostPrototype(dedicatedHostPrototypeModel) + // Construct an instance of the CreateInstanceOptions model + CreateInstanceOptions createInstanceOptionsModel = new CreateInstanceOptions.Builder() + .instancePrototype(instancePrototypeModel) .build(); - // Invoke createDedicatedHost() with a valid options model and verify the result - Response response = vpcService.createDedicatedHost(createDedicatedHostOptionsModel).execute(); + // Invoke createInstance() with a valid options model and verify the result + Response response = vpcService.createInstance(createInstanceOptionsModel).execute(); assertNotNull(response); - DedicatedHost responseObj = response.getResult(); + Instance responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -13055,105 +14156,104 @@ public void testCreateDedicatedHostWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createDedicatedHostPath); + assertEquals(parsedPath, createInstancePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createDedicatedHost operation with and without retries enabled + // Test the createInstance operation with and without retries enabled @Test - public void testCreateDedicatedHostWRetries() throws Throwable { + public void testCreateInstanceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateDedicatedHostWOptions(); + testCreateInstanceWOptions(); vpcService.disableRetries(); - testCreateDedicatedHostWOptions(); + testCreateInstanceWOptions(); } - // Test the createDedicatedHost operation with a null options model (negative test) + // Test the createInstance operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateDedicatedHostNoOptions() throws Throwable { + public void testCreateInstanceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createDedicatedHost(null).execute(); + vpcService.createInstance(null).execute(); } - // Test the listDedicatedHostDisks operation with a valid options model parameter + // Test the deleteInstance operation with a valid options model parameter @Test - public void testListDedicatedHostDisksWOptions() throws Throwable { + public void testDeleteInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}]}"; - String listDedicatedHostDisksPath = "/dedicated_hosts/testString/disks"; + String mockResponseBody = ""; + String deleteInstancePath = "/instances/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ListDedicatedHostDisksOptions model - ListDedicatedHostDisksOptions listDedicatedHostDisksOptionsModel = new ListDedicatedHostDisksOptions.Builder() - .dedicatedHostId("testString") + // Construct an instance of the DeleteInstanceOptions model + DeleteInstanceOptions deleteInstanceOptionsModel = new DeleteInstanceOptions.Builder() + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke listDedicatedHostDisks() with a valid options model and verify the result - Response response = vpcService.listDedicatedHostDisks(listDedicatedHostDisksOptionsModel).execute(); + // Invoke deleteInstance() with a valid options model and verify the result + Response response = vpcService.deleteInstance(deleteInstanceOptionsModel).execute(); assertNotNull(response); - DedicatedHostDiskCollection responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listDedicatedHostDisksPath); + assertEquals(parsedPath, deleteInstancePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listDedicatedHostDisks operation with and without retries enabled + // Test the deleteInstance operation with and without retries enabled @Test - public void testListDedicatedHostDisksWRetries() throws Throwable { + public void testDeleteInstanceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListDedicatedHostDisksWOptions(); + testDeleteInstanceWOptions(); vpcService.disableRetries(); - testListDedicatedHostDisksWOptions(); + testDeleteInstanceWOptions(); } - // Test the listDedicatedHostDisks operation with a null options model (negative test) + // Test the deleteInstance operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListDedicatedHostDisksNoOptions() throws Throwable { + public void testDeleteInstanceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listDedicatedHostDisks(null).execute(); + vpcService.deleteInstance(null).execute(); } - // Test the getDedicatedHostDisk operation with a valid options model parameter + // Test the getInstance operation with a valid options model parameter @Test - public void testGetDedicatedHostDiskWOptions() throws Throwable { + public void testGetInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}"; - String getDedicatedHostDiskPath = "/dedicated_hosts/testString/disks/testString"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"cluster_network\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"name\": \"my-cluster-network\", \"resource_type\": \"cluster_network\"}, \"cluster_network_attachments\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"enable_secure_boot\": true, \"gpu\": {\"count\": 1, \"manufacturer\": \"amd\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"instance_group_membership\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"id\": \"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"name\": \"my-instance-group-membership\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 64, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"numa_count\": 2, \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"burst\": {\"limit\": 100}, \"count\": 4, \"manufacturer\": \"intel\", \"percentage\": 100}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"volume_bandwidth_qos_mode\": \"pooled\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getInstancePath = "/instances/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetDedicatedHostDiskOptions model - GetDedicatedHostDiskOptions getDedicatedHostDiskOptionsModel = new GetDedicatedHostDiskOptions.Builder() - .dedicatedHostId("testString") + // Construct an instance of the GetInstanceOptions model + GetInstanceOptions getInstanceOptionsModel = new GetInstanceOptions.Builder() .id("testString") .build(); - // Invoke getDedicatedHostDisk() with a valid options model and verify the result - Response response = vpcService.getDedicatedHostDisk(getDedicatedHostDiskOptionsModel).execute(); + // Invoke getInstance() with a valid options model and verify the result + Response response = vpcService.getInstance(getInstanceOptionsModel).execute(); assertNotNull(response); - DedicatedHostDisk responseObj = response.getResult(); + Instance responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -13162,164 +14262,160 @@ public void testGetDedicatedHostDiskWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getDedicatedHostDiskPath); + assertEquals(parsedPath, getInstancePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getDedicatedHostDisk operation with and without retries enabled + // Test the getInstance operation with and without retries enabled @Test - public void testGetDedicatedHostDiskWRetries() throws Throwable { + public void testGetInstanceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetDedicatedHostDiskWOptions(); + testGetInstanceWOptions(); vpcService.disableRetries(); - testGetDedicatedHostDiskWOptions(); + testGetInstanceWOptions(); } - // Test the getDedicatedHostDisk operation with a null options model (negative test) + // Test the getInstance operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetDedicatedHostDiskNoOptions() throws Throwable { + public void testGetInstanceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getDedicatedHostDisk(null).execute(); + vpcService.getInstance(null).execute(); } - // Test the updateDedicatedHostDisk operation with a valid options model parameter + // Test the updateInstance operation with a valid options model parameter @Test - public void testUpdateDedicatedHostDiskWOptions() throws Throwable { + public void testUpdateInstanceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}"; - String updateDedicatedHostDiskPath = "/dedicated_hosts/testString/disks/testString"; + String mockResponseBody = "{\"availability_policy\": {\"host_failure\": \"restart\"}, \"bandwidth\": 1000, \"boot_volume_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"cluster_network\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"name\": \"my-cluster-network\", \"resource_type\": \"cluster_network\"}, \"cluster_network_attachments\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"confidential_compute_mode\": \"disabled\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"dedicated_host\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"my-host\", \"resource_type\": \"dedicated_host\"}, \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}], \"enable_secure_boot\": true, \"gpu\": {\"count\": 1, \"manufacturer\": \"amd\", \"memory\": 1, \"model\": \"Tesla V100\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"instance_group_membership\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60/memberships/r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"id\": \"r006-32c8210b-fd1a-409f-8966-de85bbfd3741\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"name\": \"my-instance-group-membership\"}, \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 64, \"metadata_service\": {\"enabled\": false, \"protocol\": \"http\", \"response_hop_limit\": 1}, \"name\": \"my-instance\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"numa_count\": 2, \"placement_target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"instance\", \"startable\": false, \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_storage\", \"message\": \"The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"total_network_bandwidth\": 500, \"total_volume_bandwidth\": 500, \"vcpu\": {\"architecture\": \"amd64\", \"burst\": {\"limit\": 100}, \"count\": 4, \"manufacturer\": \"intel\", \"percentage\": 100}, \"volume_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}], \"volume_bandwidth_qos_mode\": \"pooled\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateInstancePath = "/instances/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DedicatedHostDiskPatch model - DedicatedHostDiskPatch dedicatedHostDiskPatchModel = new DedicatedHostDiskPatch.Builder() - .name("my-dedicated-host-disk-updated") + // Construct an instance of the InstanceAvailabilityPolicyPatch model + InstanceAvailabilityPolicyPatch instanceAvailabilityPolicyPatchModel = new InstanceAvailabilityPolicyPatch.Builder() + .hostFailure("restart") .build(); - Map dedicatedHostDiskPatchModelAsPatch = dedicatedHostDiskPatchModel.asPatch(); - // Construct an instance of the UpdateDedicatedHostDiskOptions model - UpdateDedicatedHostDiskOptions updateDedicatedHostDiskOptionsModel = new UpdateDedicatedHostDiskOptions.Builder() - .dedicatedHostId("testString") - .id("testString") - .dedicatedHostDiskPatch(dedicatedHostDiskPatchModelAsPatch) + // Construct an instance of the InstanceMetadataServicePatch model + InstanceMetadataServicePatch instanceMetadataServicePatchModel = new InstanceMetadataServicePatch.Builder() + .enabled(true) + .protocol("http") + .responseHopLimit(Long.valueOf("1")) .build(); - // Invoke updateDedicatedHostDisk() with a valid options model and verify the result - Response response = vpcService.updateDedicatedHostDisk(updateDedicatedHostDiskOptionsModel).execute(); - assertNotNull(response); - DedicatedHostDisk responseObj = response.getResult(); - assertNotNull(responseObj); + // Construct an instance of the InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById model + InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById instancePlacementTargetPatchModel = new InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.Builder() + .id("0717-1e09281b-f177-46fb-baf1-bc152b2e391a") + .build(); - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateDedicatedHostDiskPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } + // Construct an instance of the InstancePatchProfileInstanceProfileIdentityByName model + InstancePatchProfileInstanceProfileIdentityByName instancePatchProfileModel = new InstancePatchProfileInstanceProfileIdentityByName.Builder() + .name("bx2-4x16") + .build(); - // Test the updateDedicatedHostDisk operation with and without retries enabled - @Test - public void testUpdateDedicatedHostDiskWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testUpdateDedicatedHostDiskWOptions(); + // Construct an instance of the ReservationIdentityById model + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() + .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + .build(); - vpcService.disableRetries(); - testUpdateDedicatedHostDiskWOptions(); - } + // Construct an instance of the InstanceReservationAffinityPatch model + InstanceReservationAffinityPatch instanceReservationAffinityPatchModel = new InstanceReservationAffinityPatch.Builder() + .policy("automatic") + .pool(java.util.Arrays.asList(reservationIdentityModel)) + .build(); - // Test the updateDedicatedHostDisk operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateDedicatedHostDiskNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.updateDedicatedHostDisk(null).execute(); - } + // Construct an instance of the InstanceVCPUPatch model + InstanceVCPUPatch instanceVcpuPatchModel = new InstanceVCPUPatch.Builder() + .percentage(Long.valueOf("100")) + .build(); - // Test the deleteDedicatedHost operation with a valid options model parameter - @Test - public void testDeleteDedicatedHostWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteDedicatedHostPath = "/dedicated_hosts/testString"; - server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); + // Construct an instance of the InstancePatch model + InstancePatch instancePatchModel = new InstancePatch.Builder() + .availabilityPolicy(instanceAvailabilityPolicyPatchModel) + .confidentialComputeMode("disabled") + .enableSecureBoot(true) + .metadataService(instanceMetadataServicePatchModel) + .name("my-instance") + .placementTarget(instancePlacementTargetPatchModel) + .profile(instancePatchProfileModel) + .reservationAffinity(instanceReservationAffinityPatchModel) + .totalVolumeBandwidth(Long.valueOf("500")) + .vcpu(instanceVcpuPatchModel) + .volumeBandwidthQosMode("pooled") + .build(); + Map instancePatchModelAsPatch = instancePatchModel.asPatch(); - // Construct an instance of the DeleteDedicatedHostOptions model - DeleteDedicatedHostOptions deleteDedicatedHostOptionsModel = new DeleteDedicatedHostOptions.Builder() + // Construct an instance of the UpdateInstanceOptions model + UpdateInstanceOptions updateInstanceOptionsModel = new UpdateInstanceOptions.Builder() .id("testString") + .instancePatch(instancePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteDedicatedHost() with a valid options model and verify the result - Response response = vpcService.deleteDedicatedHost(deleteDedicatedHostOptionsModel).execute(); + // Invoke updateInstance() with a valid options model and verify the result + Response response = vpcService.updateInstance(updateInstanceOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + Instance responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteDedicatedHostPath); + assertEquals(parsedPath, updateInstancePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteDedicatedHost operation with and without retries enabled + // Test the updateInstance operation with and without retries enabled @Test - public void testDeleteDedicatedHostWRetries() throws Throwable { + public void testUpdateInstanceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteDedicatedHostWOptions(); + testUpdateInstanceWOptions(); vpcService.disableRetries(); - testDeleteDedicatedHostWOptions(); + testUpdateInstanceWOptions(); } - // Test the deleteDedicatedHost operation with a null options model (negative test) + // Test the updateInstance operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteDedicatedHostNoOptions() throws Throwable { + public void testUpdateInstanceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteDedicatedHost(null).execute(); + vpcService.updateInstance(null).execute(); } - // Test the getDedicatedHost operation with a valid options model parameter + // Test the getInstanceInitialization operation with a valid options model parameter @Test - public void testGetDedicatedHostWOptions() throws Throwable { + public void testGetInstanceInitializationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available_memory\": 128, \"available_vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}], \"group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"instance_placement_enabled\": true, \"instances\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}], \"lifecycle_state\": \"stable\", \"memory\": 128, \"name\": \"my-host\", \"numa\": {\"count\": 2, \"nodes\": [{\"available_vcpu\": 24, \"vcpu\": 56}]}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"mx2-host-152x1216\"}, \"provisionable\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host\", \"socket_count\": 4, \"state\": \"available\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getDedicatedHostPath = "/dedicated_hosts/testString"; + String mockResponseBody = "{\"default_trusted_profile\": {\"auto_link\": true, \"target\": {\"crn\": \"crn:v1:bluemix:public:iam-identity::a/aa2432b1fa4d4ace891e9b80fc104e34::profile:Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\", \"id\": \"Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5\", \"resource_type\": \"trusted_profile\"}}, \"keys\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}], \"password\": {\"encrypted_password\": \"qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==\", \"encryption_key\": {\"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\"}}}"; + String getInstanceInitializationPath = "/instances/testString/initialization"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetDedicatedHostOptions model - GetDedicatedHostOptions getDedicatedHostOptionsModel = new GetDedicatedHostOptions.Builder() + // Construct an instance of the GetInstanceInitializationOptions model + GetInstanceInitializationOptions getInstanceInitializationOptionsModel = new GetInstanceInitializationOptions.Builder() .id("testString") .build(); - // Invoke getDedicatedHost() with a valid options model and verify the result - Response response = vpcService.getDedicatedHost(getDedicatedHostOptionsModel).execute(); + // Invoke getInstanceInitialization() with a valid options model and verify the result + Response response = vpcService.getInstanceInitialization(getInstanceInitializationOptionsModel).execute(); assertNotNull(response); - DedicatedHost responseObj = response.getResult(); + InstanceInitialization responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -13328,113 +14424,108 @@ public void testGetDedicatedHostWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getDedicatedHostPath); + assertEquals(parsedPath, getInstanceInitializationPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getDedicatedHost operation with and without retries enabled + // Test the getInstanceInitialization operation with and without retries enabled @Test - public void testGetDedicatedHostWRetries() throws Throwable { + public void testGetInstanceInitializationWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetDedicatedHostWOptions(); + testGetInstanceInitializationWOptions(); vpcService.disableRetries(); - testGetDedicatedHostWOptions(); + testGetInstanceInitializationWOptions(); } - // Test the getDedicatedHost operation with a null options model (negative test) + // Test the getInstanceInitialization operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetDedicatedHostNoOptions() throws Throwable { + public void testGetInstanceInitializationNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getDedicatedHost(null).execute(); + vpcService.getInstanceInitialization(null).execute(); } - // Test the updateDedicatedHost operation with a valid options model parameter + // Test the createInstanceAction operation with a valid options model parameter @Test - public void testUpdateDedicatedHostWOptions() throws Throwable { + public void testCreateInstanceActionWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available_memory\": 128, \"available_vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"disks\": [{\"available\": 9, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a/disks/0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"id\": \"0717-bd091a9e-b036-4c65-a79b-56d164911f6e\", \"instance_disks\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\"}], \"interface_type\": \"nvme\", \"lifecycle_state\": \"stable\", \"name\": \"my-dedicated-host-disk\", \"provisionable\": false, \"resource_type\": \"dedicated_host_disk\", \"size\": 4, \"supported_instance_interface_types\": [\"nvme\"]}], \"group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host-group:0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"id\": \"0717-bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0\", \"name\": \"my-dedicated-host-group\", \"resource_type\": \"dedicated_host_group\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"id\": \"0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"instance_placement_enabled\": true, \"instances\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}], \"lifecycle_state\": \"stable\", \"memory\": 128, \"name\": \"my-host\", \"numa\": {\"count\": 2, \"nodes\": [{\"available_vcpu\": 24, \"vcpu\": 56}]}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0717-1e09281b-f177-46fb-baf1-bc152b2e391a\", \"name\": \"mx2-host-152x1216\"}, \"provisionable\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"dedicated_host\", \"socket_count\": 4, \"state\": \"available\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"vcpu\": {\"architecture\": \"amd64\", \"count\": 4, \"manufacturer\": \"intel\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateDedicatedHostPath = "/dedicated_hosts/testString"; + String mockResponseBody = "{\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"force\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/actions/109a1b6e-1242-4de1-be44-38705e9474ed\", \"id\": \"109a1b6e-1242-4de1-be44-38705e9474ed\", \"started_at\": \"2019-01-01T12:00:00.000Z\", \"status\": \"completed\", \"type\": \"reboot\"}"; + String createInstanceActionPath = "/instances/testString/actions"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the DedicatedHostPatch model - DedicatedHostPatch dedicatedHostPatchModel = new DedicatedHostPatch.Builder() - .instancePlacementEnabled(false) - .name("my-host") - .build(); - Map dedicatedHostPatchModelAsPatch = dedicatedHostPatchModel.asPatch(); - - // Construct an instance of the UpdateDedicatedHostOptions model - UpdateDedicatedHostOptions updateDedicatedHostOptionsModel = new UpdateDedicatedHostOptions.Builder() - .id("testString") - .dedicatedHostPatch(dedicatedHostPatchModelAsPatch) + // Construct an instance of the CreateInstanceActionOptions model + CreateInstanceActionOptions createInstanceActionOptionsModel = new CreateInstanceActionOptions.Builder() + .instanceId("testString") + .type("reboot") + .force(true) .build(); - // Invoke updateDedicatedHost() with a valid options model and verify the result - Response response = vpcService.updateDedicatedHost(updateDedicatedHostOptionsModel).execute(); + // Invoke createInstanceAction() with a valid options model and verify the result + Response response = vpcService.createInstanceAction(createInstanceActionOptionsModel).execute(); assertNotNull(response); - DedicatedHost responseObj = response.getResult(); + InstanceAction responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateDedicatedHostPath); + assertEquals(parsedPath, createInstanceActionPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateDedicatedHost operation with and without retries enabled + // Test the createInstanceAction operation with and without retries enabled @Test - public void testUpdateDedicatedHostWRetries() throws Throwable { + public void testCreateInstanceActionWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateDedicatedHostWOptions(); + testCreateInstanceActionWOptions(); vpcService.disableRetries(); - testUpdateDedicatedHostWOptions(); + testCreateInstanceActionWOptions(); } - // Test the updateDedicatedHost operation with a null options model (negative test) + // Test the createInstanceAction operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateDedicatedHostNoOptions() throws Throwable { + public void testCreateInstanceActionNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateDedicatedHost(null).execute(); + vpcService.createInstanceAction(null).execute(); } - // Test the listPlacementGroups operation with a valid options model parameter + // Test the listInstanceClusterNetworkAttachments operation with a valid options model parameter @Test - public void testListPlacementGroupsWOptions() throws Throwable { + public void testListInstanceClusterNetworkAttachmentsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"placement_groups\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"id\": \"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"lifecycle_state\": \"stable\", \"name\": \"my-placement-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"placement_group\", \"strategy\": \"host_spread\"}], \"total_count\": 132}"; - String listPlacementGroupsPath = "/placement_groups"; + String mockResponseBody = "{\"cluster_network_attachments\": [{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listInstanceClusterNetworkAttachmentsPath = "/instances/testString/cluster_network_attachments"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListPlacementGroupsOptions model - ListPlacementGroupsOptions listPlacementGroupsOptionsModel = new ListPlacementGroupsOptions.Builder() + // Construct an instance of the ListInstanceClusterNetworkAttachmentsOptions model + ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptionsModel = new ListInstanceClusterNetworkAttachmentsOptions.Builder() + .instanceId("testString") .start("testString") .limit(Long.valueOf("10")) .build(); - // Invoke listPlacementGroups() with a valid options model and verify the result - Response response = vpcService.listPlacementGroups(listPlacementGroupsOptionsModel).execute(); + // Invoke listInstanceClusterNetworkAttachments() with a valid options model and verify the result + Response response = vpcService.listInstanceClusterNetworkAttachments(listInstanceClusterNetworkAttachmentsOptionsModel).execute(); assertNotNull(response); - PlacementGroupCollection responseObj = response.getResult(); + InstanceClusterNetworkAttachmentCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -13443,32 +14534,39 @@ public void testListPlacementGroupsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listPlacementGroupsPath); + assertEquals(parsedPath, listInstanceClusterNetworkAttachmentsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listPlacementGroups operation with and without retries enabled + // Test the listInstanceClusterNetworkAttachments operation with and without retries enabled @Test - public void testListPlacementGroupsWRetries() throws Throwable { + public void testListInstanceClusterNetworkAttachmentsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListPlacementGroupsWOptions(); + testListInstanceClusterNetworkAttachmentsWOptions(); vpcService.disableRetries(); - testListPlacementGroupsWOptions(); + testListInstanceClusterNetworkAttachmentsWOptions(); } - // Test the listPlacementGroups operation using the PlacementGroupsPager.getNext() method + // Test the listInstanceClusterNetworkAttachments operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListInstanceClusterNetworkAttachmentsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listInstanceClusterNetworkAttachments(null).execute(); + } + + // Test the listInstanceClusterNetworkAttachments operation using the InstanceClusterNetworkAttachmentsPager.getNext() method @Test - public void testListPlacementGroupsWithPagerGetNext() throws Throwable { + public void testListInstanceClusterNetworkAttachmentsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"cluster_network_attachments\":[{\"before\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"cluster_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"}},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"cluster_network_attachments\":[{\"before\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"cluster_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"}},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -13482,26 +14580,27 @@ public void testListPlacementGroupsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() + ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptions = new ListInstanceClusterNetworkAttachmentsOptions.Builder() + .instanceId("testString") .limit(Long.valueOf("10")) .build(); - List allResults = new ArrayList<>(); - PlacementGroupsPager pager = new PlacementGroupsPager(vpcService, listPlacementGroupsOptions); + List allResults = new ArrayList<>(); + InstanceClusterNetworkAttachmentsPager pager = new InstanceClusterNetworkAttachmentsPager(vpcService, listInstanceClusterNetworkAttachmentsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listPlacementGroups operation using the PlacementGroupsPager.getAll() method + // Test the listInstanceClusterNetworkAttachments operation using the InstanceClusterNetworkAttachmentsPager.getAll() method @Test - public void testListPlacementGroupsWithPagerGetAll() throws Throwable { + public void testListInstanceClusterNetworkAttachmentsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"cluster_network_attachments\":[{\"before\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"cluster_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"}},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"cluster_network_attachments\":[{\"before\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"cluster_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"}},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"}],\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -13515,43 +14614,65 @@ public void testListPlacementGroupsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() + ListInstanceClusterNetworkAttachmentsOptions listInstanceClusterNetworkAttachmentsOptions = new ListInstanceClusterNetworkAttachmentsOptions.Builder() + .instanceId("testString") .limit(Long.valueOf("10")) .build(); - PlacementGroupsPager pager = new PlacementGroupsPager(vpcService, listPlacementGroupsOptions); - List allResults = pager.getAll(); + InstanceClusterNetworkAttachmentsPager pager = new InstanceClusterNetworkAttachmentsPager(vpcService, listInstanceClusterNetworkAttachmentsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createPlacementGroup operation with a valid options model parameter + // Test the createClusterNetworkAttachment operation with a valid options model parameter @Test - public void testCreatePlacementGroupWOptions() throws Throwable { + public void testCreateClusterNetworkAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"id\": \"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"lifecycle_state\": \"stable\", \"name\": \"my-placement-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"placement_group\", \"strategy\": \"host_spread\"}"; - String createPlacementGroupPath = "/placement_groups"; + String mockResponseBody = "{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}"; + String createClusterNetworkAttachmentPath = "/instances/testString/cluster_network_attachments"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + // Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model + ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-cluster-network-subnet-reserved-ip") .build(); - // Construct an instance of the CreatePlacementGroupOptions model - CreatePlacementGroupOptions createPlacementGroupOptionsModel = new CreatePlacementGroupOptions.Builder() - .strategy("host_spread") - .name("my-placement-group") - .resourceGroup(resourceGroupIdentityModel) + // Construct an instance of the ClusterNetworkSubnetIdentityById model + ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() + .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") .build(); - // Invoke createPlacementGroup() with a valid options model and verify the result - Response response = vpcService.createPlacementGroup(createPlacementGroupOptionsModel).execute(); + // Construct an instance of the InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment model + InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel = new InstanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceInstanceClusterNetworkInterfacePrototypeInstanceClusterNetworkAttachment.Builder() + .autoDelete(false) + .name("my-cluster-network-interface") + .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) + .subnet(clusterNetworkSubnetIdentityModel) + .build(); + + // Construct an instance of the InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById model + InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById instanceClusterNetworkAttachmentBeforePrototypeModel = new InstanceClusterNetworkAttachmentBeforePrototypeInstanceClusterNetworkAttachmentIdentityById.Builder() + .id("0717-fb880975-db45-4459-8548-64e3995ac213") + .build(); + + // Construct an instance of the CreateClusterNetworkAttachmentOptions model + CreateClusterNetworkAttachmentOptions createClusterNetworkAttachmentOptionsModel = new CreateClusterNetworkAttachmentOptions.Builder() + .instanceId("testString") + .clusterNetworkInterface(instanceClusterNetworkAttachmentPrototypeClusterNetworkInterfaceModel) + .before(instanceClusterNetworkAttachmentBeforePrototypeModel) + .name("my-instance-network-attachment") + .build(); + + // Invoke createClusterNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.createClusterNetworkAttachment(createClusterNetworkAttachmentOptionsModel).execute(); assertNotNull(response); - PlacementGroup responseObj = response.getResult(); + InstanceClusterNetworkAttachment responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -13560,51 +14681,53 @@ public void testCreatePlacementGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createPlacementGroupPath); + assertEquals(parsedPath, createClusterNetworkAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createPlacementGroup operation with and without retries enabled + // Test the createClusterNetworkAttachment operation with and without retries enabled @Test - public void testCreatePlacementGroupWRetries() throws Throwable { + public void testCreateClusterNetworkAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreatePlacementGroupWOptions(); + testCreateClusterNetworkAttachmentWOptions(); vpcService.disableRetries(); - testCreatePlacementGroupWOptions(); + testCreateClusterNetworkAttachmentWOptions(); } - // Test the createPlacementGroup operation with a null options model (negative test) + // Test the createClusterNetworkAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreatePlacementGroupNoOptions() throws Throwable { + public void testCreateClusterNetworkAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createPlacementGroup(null).execute(); + vpcService.createClusterNetworkAttachment(null).execute(); } - // Test the deletePlacementGroup operation with a valid options model parameter + // Test the deleteInstanceClusterNetworkAttachment operation with a valid options model parameter @Test - public void testDeletePlacementGroupWOptions() throws Throwable { + public void testDeleteInstanceClusterNetworkAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deletePlacementGroupPath = "/placement_groups/testString"; + String mockResponseBody = "{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}"; + String deleteInstanceClusterNetworkAttachmentPath = "/instances/testString/cluster_network_attachments/testString"; server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeletePlacementGroupOptions model - DeletePlacementGroupOptions deletePlacementGroupOptionsModel = new DeletePlacementGroupOptions.Builder() + // Construct an instance of the DeleteInstanceClusterNetworkAttachmentOptions model + DeleteInstanceClusterNetworkAttachmentOptions deleteInstanceClusterNetworkAttachmentOptionsModel = new DeleteInstanceClusterNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); - // Invoke deletePlacementGroup() with a valid options model and verify the result - Response response = vpcService.deletePlacementGroup(deletePlacementGroupOptionsModel).execute(); + // Invoke deleteInstanceClusterNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.deleteInstanceClusterNetworkAttachment(deleteInstanceClusterNetworkAttachmentOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + InstanceClusterNetworkAttachment responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -13612,51 +14735,52 @@ public void testDeletePlacementGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deletePlacementGroupPath); + assertEquals(parsedPath, deleteInstanceClusterNetworkAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deletePlacementGroup operation with and without retries enabled + // Test the deleteInstanceClusterNetworkAttachment operation with and without retries enabled @Test - public void testDeletePlacementGroupWRetries() throws Throwable { + public void testDeleteInstanceClusterNetworkAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeletePlacementGroupWOptions(); + testDeleteInstanceClusterNetworkAttachmentWOptions(); vpcService.disableRetries(); - testDeletePlacementGroupWOptions(); + testDeleteInstanceClusterNetworkAttachmentWOptions(); } - // Test the deletePlacementGroup operation with a null options model (negative test) + // Test the deleteInstanceClusterNetworkAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeletePlacementGroupNoOptions() throws Throwable { + public void testDeleteInstanceClusterNetworkAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deletePlacementGroup(null).execute(); + vpcService.deleteInstanceClusterNetworkAttachment(null).execute(); } - // Test the getPlacementGroup operation with a valid options model parameter + // Test the getInstanceClusterNetworkAttachment operation with a valid options model parameter @Test - public void testGetPlacementGroupWOptions() throws Throwable { + public void testGetInstanceClusterNetworkAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"id\": \"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"lifecycle_state\": \"stable\", \"name\": \"my-placement-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"placement_group\", \"strategy\": \"host_spread\"}"; - String getPlacementGroupPath = "/placement_groups/testString"; + String mockResponseBody = "{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}"; + String getInstanceClusterNetworkAttachmentPath = "/instances/testString/cluster_network_attachments/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetPlacementGroupOptions model - GetPlacementGroupOptions getPlacementGroupOptionsModel = new GetPlacementGroupOptions.Builder() + // Construct an instance of the GetInstanceClusterNetworkAttachmentOptions model + GetInstanceClusterNetworkAttachmentOptions getInstanceClusterNetworkAttachmentOptionsModel = new GetInstanceClusterNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); - // Invoke getPlacementGroup() with a valid options model and verify the result - Response response = vpcService.getPlacementGroup(getPlacementGroupOptionsModel).execute(); + // Invoke getInstanceClusterNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.getInstanceClusterNetworkAttachment(getInstanceClusterNetworkAttachmentOptionsModel).execute(); assertNotNull(response); - PlacementGroup responseObj = response.getResult(); + InstanceClusterNetworkAttachment responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -13665,58 +14789,59 @@ public void testGetPlacementGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getPlacementGroupPath); + assertEquals(parsedPath, getInstanceClusterNetworkAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getPlacementGroup operation with and without retries enabled + // Test the getInstanceClusterNetworkAttachment operation with and without retries enabled @Test - public void testGetPlacementGroupWRetries() throws Throwable { + public void testGetInstanceClusterNetworkAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetPlacementGroupWOptions(); + testGetInstanceClusterNetworkAttachmentWOptions(); vpcService.disableRetries(); - testGetPlacementGroupWOptions(); + testGetInstanceClusterNetworkAttachmentWOptions(); } - // Test the getPlacementGroup operation with a null options model (negative test) + // Test the getInstanceClusterNetworkAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetPlacementGroupNoOptions() throws Throwable { + public void testGetInstanceClusterNetworkAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getPlacementGroup(null).execute(); + vpcService.getInstanceClusterNetworkAttachment(null).execute(); } - // Test the updatePlacementGroup operation with a valid options model parameter + // Test the updateInstanceClusterNetworkAttachment operation with a valid options model parameter @Test - public void testUpdatePlacementGroupWOptions() throws Throwable { + public void testUpdateInstanceClusterNetworkAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"id\": \"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"lifecycle_state\": \"stable\", \"name\": \"my-placement-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"placement_group\", \"strategy\": \"host_spread\"}"; - String updatePlacementGroupPath = "/placement_groups/testString"; + String mockResponseBody = "{\"before\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"cluster_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}"; + String updateInstanceClusterNetworkAttachmentPath = "/instances/testString/cluster_network_attachments/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the PlacementGroupPatch model - PlacementGroupPatch placementGroupPatchModel = new PlacementGroupPatch.Builder() - .name("my-placement-group-updated") + // Construct an instance of the InstanceClusterNetworkAttachmentPatch model + InstanceClusterNetworkAttachmentPatch instanceClusterNetworkAttachmentPatchModel = new InstanceClusterNetworkAttachmentPatch.Builder() + .name("my-instance-network-attachment-updated") .build(); - Map placementGroupPatchModelAsPatch = placementGroupPatchModel.asPatch(); + Map instanceClusterNetworkAttachmentPatchModelAsPatch = instanceClusterNetworkAttachmentPatchModel.asPatch(); - // Construct an instance of the UpdatePlacementGroupOptions model - UpdatePlacementGroupOptions updatePlacementGroupOptionsModel = new UpdatePlacementGroupOptions.Builder() + // Construct an instance of the UpdateInstanceClusterNetworkAttachmentOptions model + UpdateInstanceClusterNetworkAttachmentOptions updateInstanceClusterNetworkAttachmentOptionsModel = new UpdateInstanceClusterNetworkAttachmentOptions.Builder() + .instanceId("testString") .id("testString") - .placementGroupPatch(placementGroupPatchModelAsPatch) + .instanceClusterNetworkAttachmentPatch(instanceClusterNetworkAttachmentPatchModelAsPatch) .build(); - // Invoke updatePlacementGroup() with a valid options model and verify the result - Response response = vpcService.updatePlacementGroup(updatePlacementGroupOptionsModel).execute(); + // Invoke updateInstanceClusterNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.updateInstanceClusterNetworkAttachment(updateInstanceClusterNetworkAttachmentOptionsModel).execute(); assertNotNull(response); - PlacementGroup responseObj = response.getResult(); + InstanceClusterNetworkAttachment responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -13725,162 +14850,160 @@ public void testUpdatePlacementGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updatePlacementGroupPath); + assertEquals(parsedPath, updateInstanceClusterNetworkAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updatePlacementGroup operation with and without retries enabled + // Test the updateInstanceClusterNetworkAttachment operation with and without retries enabled @Test - public void testUpdatePlacementGroupWRetries() throws Throwable { + public void testUpdateInstanceClusterNetworkAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdatePlacementGroupWOptions(); + testUpdateInstanceClusterNetworkAttachmentWOptions(); vpcService.disableRetries(); - testUpdatePlacementGroupWOptions(); + testUpdateInstanceClusterNetworkAttachmentWOptions(); } - // Test the updatePlacementGroup operation with a null options model (negative test) + // Test the updateInstanceClusterNetworkAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdatePlacementGroupNoOptions() throws Throwable { + public void testUpdateInstanceClusterNetworkAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updatePlacementGroup(null).execute(); + vpcService.updateInstanceClusterNetworkAttachment(null).execute(); } - // Test the listBareMetalServerProfiles operation with a valid options model parameter + // Test the createInstanceConsoleAccessToken operation with a valid options model parameter @Test - public void testListBareMetalServerProfilesWOptions() throws Throwable { + public void testCreateInstanceConsoleAccessTokenWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"console_types\": {\"type\": \"enum\", \"values\": [\"serial\"]}, \"cpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"cpu_core_count\": {\"type\": \"fixed\", \"value\": 80}, \"cpu_socket_count\": {\"type\": \"fixed\", \"value\": 4}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"fcp\", \"type\": \"enum\", \"values\": [\"fcp\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-metal-192x768\", \"network_attachment_count\": {\"max\": 128, \"min\": 1, \"type\": \"range\"}, \"network_interface_count\": {\"max\": 128, \"min\": 1, \"type\": \"range\"}, \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"reservation_terms\": {\"type\": \"enum\", \"values\": [\"one_year\"]}, \"resource_type\": \"bare_metal_server_profile\", \"supported_trusted_platform_module_modes\": {\"default\": \"disabled\", \"type\": \"enum\", \"values\": [\"disabled\"]}, \"virtual_network_interfaces_supported\": {\"type\": \"fixed\", \"value\": false}}], \"total_count\": 132}"; - String listBareMetalServerProfilesPath = "/bare_metal_server/profiles"; + String mockResponseBody = "{\"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI\", \"console_type\": \"serial\", \"created_at\": \"2020-07-27T21:50:14.000Z\", \"expires_at\": \"2020-07-27T21:51:14.000Z\", \"force\": false, \"href\": \"wss://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI\"}"; + String createInstanceConsoleAccessTokenPath = "/instances/testString/console_access_token"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBareMetalServerProfilesOptions model - ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptionsModel = new ListBareMetalServerProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the CreateInstanceConsoleAccessTokenOptions model + CreateInstanceConsoleAccessTokenOptions createInstanceConsoleAccessTokenOptionsModel = new CreateInstanceConsoleAccessTokenOptions.Builder() + .instanceId("testString") + .consoleType("serial") + .force(false) .build(); - // Invoke listBareMetalServerProfiles() with a valid options model and verify the result - Response response = vpcService.listBareMetalServerProfiles(listBareMetalServerProfilesOptionsModel).execute(); + // Invoke createInstanceConsoleAccessToken() with a valid options model and verify the result + Response response = vpcService.createInstanceConsoleAccessToken(createInstanceConsoleAccessTokenOptionsModel).execute(); assertNotNull(response); - BareMetalServerProfileCollection responseObj = response.getResult(); + InstanceConsoleAccessToken responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBareMetalServerProfilesPath); + assertEquals(parsedPath, createInstanceConsoleAccessTokenPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listBareMetalServerProfiles operation with and without retries enabled + // Test the createInstanceConsoleAccessToken operation with and without retries enabled @Test - public void testListBareMetalServerProfilesWRetries() throws Throwable { + public void testCreateInstanceConsoleAccessTokenWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBareMetalServerProfilesWOptions(); + testCreateInstanceConsoleAccessTokenWOptions(); vpcService.disableRetries(); - testListBareMetalServerProfilesWOptions(); + testCreateInstanceConsoleAccessTokenWOptions(); } - // Test the listBareMetalServerProfiles operation using the BareMetalServerProfilesPager.getNext() method + // Test the createInstanceConsoleAccessToken operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateInstanceConsoleAccessTokenNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createInstanceConsoleAccessToken(null).execute(); + } + + // Test the listInstanceDisks operation with a valid options model parameter @Test - public void testListBareMetalServerProfilesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"console_types\":{\"type\":\"enum\",\"values\":[\"serial\"]},\"cpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"network_attachment_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"network_interface_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"reservation_terms\":{\"type\":\"enum\",\"values\":[\"one_year\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"default\":\"disabled\",\"type\":\"enum\",\"values\":[\"disabled\"]},\"virtual_network_interfaces_supported\":{\"type\":\"fixed\",\"value\":false}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"console_types\":{\"type\":\"enum\",\"values\":[\"serial\"]},\"cpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"network_attachment_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"network_interface_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"reservation_terms\":{\"type\":\"enum\",\"values\":[\"one_year\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"default\":\"disabled\",\"type\":\"enum\",\"values\":[\"disabled\"]},\"virtual_network_interfaces_supported\":{\"type\":\"fixed\",\"value\":false}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); + public void testListInstanceDisksWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}]}"; + String listInstanceDisksPath = "/instances/testString/disks"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + .setBody(mockResponseBody)); - ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() - .limit(Long.valueOf("10")) + // Construct an instance of the ListInstanceDisksOptions model + ListInstanceDisksOptions listInstanceDisksOptionsModel = new ListInstanceDisksOptions.Builder() + .instanceId("testString") .build(); - List allResults = new ArrayList<>(); - BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(vpcService, listBareMetalServerProfilesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Invoke listInstanceDisks() with a valid options model and verify the result + Response response = vpcService.listInstanceDisks(listInstanceDisksOptionsModel).execute(); + assertNotNull(response); + InstanceDiskCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listInstanceDisksPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - - // Test the listBareMetalServerProfiles operation using the BareMetalServerProfilesPager.getAll() method + + // Test the listInstanceDisks operation with and without retries enabled @Test - public void testListBareMetalServerProfilesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"console_types\":{\"type\":\"enum\",\"values\":[\"serial\"]},\"cpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"network_attachment_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"network_interface_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"reservation_terms\":{\"type\":\"enum\",\"values\":[\"one_year\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"default\":\"disabled\",\"type\":\"enum\",\"values\":[\"disabled\"]},\"virtual_network_interfaces_supported\":{\"type\":\"fixed\",\"value\":false}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"bandwidth\":{\"type\":\"fixed\",\"value\":20000},\"console_types\":{\"type\":\"enum\",\"values\":[\"serial\"]},\"cpu_architecture\":{\"type\":\"fixed\",\"value\":\"amd64\"},\"cpu_core_count\":{\"type\":\"fixed\",\"value\":80},\"cpu_socket_count\":{\"type\":\"fixed\",\"value\":4},\"disks\":[{\"quantity\":{\"type\":\"fixed\",\"value\":4},\"size\":{\"type\":\"fixed\",\"value\":100},\"supported_interface_types\":{\"default\":\"fcp\",\"type\":\"enum\",\"values\":[\"fcp\"]}}],\"family\":\"balanced\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"memory\":{\"type\":\"fixed\",\"value\":16},\"name\":\"bx2-metal-192x768\",\"network_attachment_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"network_interface_count\":{\"max\":128,\"min\":1,\"type\":\"range\"},\"os_architecture\":{\"default\":\"amd64\",\"type\":\"enum\",\"values\":[\"amd64\"]},\"reservation_terms\":{\"type\":\"enum\",\"values\":[\"one_year\"]},\"resource_type\":\"bare_metal_server_profile\",\"supported_trusted_platform_module_modes\":{\"default\":\"disabled\",\"type\":\"enum\",\"values\":[\"disabled\"]},\"virtual_network_interfaces_supported\":{\"type\":\"fixed\",\"value\":false}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + public void testListInstanceDisksWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListInstanceDisksWOptions(); - ListBareMetalServerProfilesOptions listBareMetalServerProfilesOptions = new ListBareMetalServerProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .build(); + vpcService.disableRetries(); + testListInstanceDisksWOptions(); + } - BareMetalServerProfilesPager pager = new BareMetalServerProfilesPager(vpcService, listBareMetalServerProfilesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); + // Test the listInstanceDisks operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListInstanceDisksNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listInstanceDisks(null).execute(); } - - // Test the getBareMetalServerProfile operation with a valid options model parameter + + // Test the getInstanceDisk operation with a valid options model parameter @Test - public void testGetBareMetalServerProfileWOptions() throws Throwable { + public void testGetInstanceDiskWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": {\"type\": \"fixed\", \"value\": 20000}, \"console_types\": {\"type\": \"enum\", \"values\": [\"serial\"]}, \"cpu_architecture\": {\"type\": \"fixed\", \"value\": \"amd64\"}, \"cpu_core_count\": {\"type\": \"fixed\", \"value\": 80}, \"cpu_socket_count\": {\"type\": \"fixed\", \"value\": 4}, \"disks\": [{\"quantity\": {\"type\": \"fixed\", \"value\": 4}, \"size\": {\"type\": \"fixed\", \"value\": 100}, \"supported_interface_types\": {\"default\": \"fcp\", \"type\": \"enum\", \"values\": [\"fcp\"]}}], \"family\": \"balanced\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"memory\": {\"type\": \"fixed\", \"value\": 16}, \"name\": \"bx2-metal-192x768\", \"network_attachment_count\": {\"max\": 128, \"min\": 1, \"type\": \"range\"}, \"network_interface_count\": {\"max\": 128, \"min\": 1, \"type\": \"range\"}, \"os_architecture\": {\"default\": \"amd64\", \"type\": \"enum\", \"values\": [\"amd64\"]}, \"reservation_terms\": {\"type\": \"enum\", \"values\": [\"one_year\"]}, \"resource_type\": \"bare_metal_server_profile\", \"supported_trusted_platform_module_modes\": {\"default\": \"disabled\", \"type\": \"enum\", \"values\": [\"disabled\"]}, \"virtual_network_interfaces_supported\": {\"type\": \"fixed\", \"value\": false}}"; - String getBareMetalServerProfilePath = "/bare_metal_server/profiles/bx2-metal-192x768"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}"; + String getInstanceDiskPath = "/instances/testString/disks/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBareMetalServerProfileOptions model - GetBareMetalServerProfileOptions getBareMetalServerProfileOptionsModel = new GetBareMetalServerProfileOptions.Builder() - .name("bx2-metal-192x768") + // Construct an instance of the GetInstanceDiskOptions model + GetInstanceDiskOptions getInstanceDiskOptionsModel = new GetInstanceDiskOptions.Builder() + .instanceId("testString") + .id("testString") .build(); - // Invoke getBareMetalServerProfile() with a valid options model and verify the result - Response response = vpcService.getBareMetalServerProfile(getBareMetalServerProfileOptionsModel).execute(); + // Invoke getInstanceDisk() with a valid options model and verify the result + Response response = vpcService.getInstanceDisk(getInstanceDiskOptionsModel).execute(); assertNotNull(response); - BareMetalServerProfile responseObj = response.getResult(); + InstanceDisk responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -13889,238 +15012,156 @@ public void testGetBareMetalServerProfileWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerProfilePath); + assertEquals(parsedPath, getInstanceDiskPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBareMetalServerProfile operation with and without retries enabled + // Test the getInstanceDisk operation with and without retries enabled @Test - public void testGetBareMetalServerProfileWRetries() throws Throwable { + public void testGetInstanceDiskWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBareMetalServerProfileWOptions(); + testGetInstanceDiskWOptions(); vpcService.disableRetries(); - testGetBareMetalServerProfileWOptions(); + testGetInstanceDiskWOptions(); } - // Test the getBareMetalServerProfile operation with a null options model (negative test) + // Test the getInstanceDisk operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerProfileNoOptions() throws Throwable { + public void testGetInstanceDiskNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBareMetalServerProfile(null).execute(); + vpcService.getInstanceDisk(null).execute(); } - // Test the listBareMetalServers operation with a valid options model parameter + // Test the updateInstanceDisk operation with a valid options model parameter @Test - public void testListBareMetalServersWOptions() throws Throwable { + public void testUpdateInstanceDiskWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bare_metal_servers\": [{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"firmware\": {\"update\": \"none\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"id\": \"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"disabled\", \"supported_modes\": [\"disabled\"]}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listBareMetalServersPath = "/bare_metal_servers"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/disks/10c02d81-0ecb-4dc5-897d-28392913b81e\", \"id\": \"10c02d81-0ecb-4dc5-897d-28392913b81e\", \"interface_type\": \"nvme\", \"name\": \"my-instance-disk\", \"resource_type\": \"instance_disk\", \"size\": 100}"; + String updateInstanceDiskPath = "/instances/testString/disks/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBareMetalServersOptions model - ListBareMetalServersOptions listBareMetalServersOptionsModel = new ListBareMetalServersOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .reservationId("testString") - .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .reservationName("my-reservation") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") + // Construct an instance of the InstanceDiskPatch model + InstanceDiskPatch instanceDiskPatchModel = new InstanceDiskPatch.Builder() + .name("my-instance-disk-updated") .build(); + Map instanceDiskPatchModelAsPatch = instanceDiskPatchModel.asPatch(); - // Invoke listBareMetalServers() with a valid options model and verify the result - Response response = vpcService.listBareMetalServers(listBareMetalServersOptionsModel).execute(); + // Construct an instance of the UpdateInstanceDiskOptions model + UpdateInstanceDiskOptions updateInstanceDiskOptionsModel = new UpdateInstanceDiskOptions.Builder() + .instanceId("testString") + .id("testString") + .instanceDiskPatch(instanceDiskPatchModelAsPatch) + .build(); + + // Invoke updateInstanceDisk() with a valid options model and verify the result + Response response = vpcService.updateInstanceDisk(updateInstanceDiskOptionsModel).execute(); assertNotNull(response); - BareMetalServerCollection responseObj = response.getResult(); + InstanceDisk responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBareMetalServersPath); + assertEquals(parsedPath, updateInstanceDiskPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("reservation.id"), "testString"); - assertEquals(query.get("reservation.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63"); - assertEquals(query.get("reservation.name"), "my-reservation"); - assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); - assertEquals(query.get("vpc.name"), "my-vpc"); } - // Test the listBareMetalServers operation with and without retries enabled + // Test the updateInstanceDisk operation with and without retries enabled @Test - public void testListBareMetalServersWRetries() throws Throwable { + public void testUpdateInstanceDiskWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBareMetalServersWOptions(); + testUpdateInstanceDiskWOptions(); vpcService.disableRetries(); - testListBareMetalServersWOptions(); + testUpdateInstanceDiskWOptions(); } - // Test the listBareMetalServers operation using the BareMetalServersPager.getNext() method + // Test the updateInstanceDisk operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateInstanceDiskNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateInstanceDisk(null).execute(); + } + + // Test the listInstanceNetworkAttachments operation with a valid options model parameter @Test - public void testListBareMetalServersWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"firmware\":{\"update\":\"none\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"id\":\"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":1536,\"name\":\"my-bare-metal-server\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"disabled\",\"supported_modes\":[\"disabled\"]},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"firmware\":{\"update\":\"none\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"id\":\"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":1536,\"name\":\"my-bare-metal-server\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"disabled\",\"supported_modes\":[\"disabled\"]},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); + public void testListInstanceNetworkAttachmentsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"network_attachments\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}]}"; + String listInstanceNetworkAttachmentsPath = "/instances/testString/network_attachments"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + .setBody(mockResponseBody)); - ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .reservationId("testString") - .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .reservationName("my-reservation") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") + // Construct an instance of the ListInstanceNetworkAttachmentsOptions model + ListInstanceNetworkAttachmentsOptions listInstanceNetworkAttachmentsOptionsModel = new ListInstanceNetworkAttachmentsOptions.Builder() + .instanceId("testString") .build(); - List allResults = new ArrayList<>(); - BareMetalServersPager pager = new BareMetalServersPager(vpcService, listBareMetalServersOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Invoke listInstanceNetworkAttachments() with a valid options model and verify the result + Response response = vpcService.listInstanceNetworkAttachments(listInstanceNetworkAttachmentsOptionsModel).execute(); + assertNotNull(response); + InstanceNetworkAttachmentCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listInstanceNetworkAttachmentsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - - // Test the listBareMetalServers operation using the BareMetalServersPager.getAll() method + + // Test the listInstanceNetworkAttachments operation with and without retries enabled @Test - public void testListBareMetalServersWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"firmware\":{\"update\":\"none\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"id\":\"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":1536,\"name\":\"my-bare-metal-server\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"disabled\",\"supported_modes\":[\"disabled\"]},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"bare_metal_servers\":[{\"bandwidth\":20000,\"boot_target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\"},\"cpu\":{\"architecture\":\"amd64\",\"core_count\":80,\"socket_count\":4,\"threads_per_core\":2},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"disks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"id\":\"0717-3744f199-6ccc-4698-8772-bb3937348c96\",\"interface_type\":\"fcp\",\"name\":\"my-bare-metal-server-disk\",\"resource_type\":\"bare_metal_server_disk\",\"size\":100}],\"enable_secure_boot\":false,\"firmware\":{\"update\":\"none\"},\"health_reasons\":[{\"code\":\"reservation_expired\",\"message\":\"The reservation cannot be used because it has expired.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"id\":\"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"memory\":1536,\"name\":\"my-bare-metal-server\",\"network_attachments\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}}],\"network_interfaces\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}}],\"primary_network_attachment\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-attachment\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"}},\"primary_network_interface\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\",\"name\":\"bx2-metal-192x768\",\"resource_type\":\"bare_metal_server_profile\"},\"reservation\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"},\"reservation_affinity\":{\"policy\":\"automatic\",\"pool\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"name\":\"my-reservation\",\"resource_type\":\"reservation\"}]},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"bare_metal_server\",\"status\":\"deleting\",\"status_reasons\":[{\"code\":\"cannot_start_capacity\",\"message\":\"The bare metal server cannot start as there is no more capacity in this\\nzone for a bare metal server with the requested profile.\",\"more_info\":\"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}],\"trusted_platform_module\":{\"enabled\":true,\"mode\":\"disabled\",\"supported_modes\":[\"disabled\"]},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + public void testListInstanceNetworkAttachmentsWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListInstanceNetworkAttachmentsWOptions(); - ListBareMetalServersOptions listBareMetalServersOptions = new ListBareMetalServersOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .reservationId("testString") - .reservationCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .reservationName("my-reservation") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .build(); + vpcService.disableRetries(); + testListInstanceNetworkAttachmentsWOptions(); + } - BareMetalServersPager pager = new BareMetalServersPager(vpcService, listBareMetalServersOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); + // Test the listInstanceNetworkAttachments operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListInstanceNetworkAttachmentsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listInstanceNetworkAttachments(null).execute(); } - - // Test the createBareMetalServer operation with a valid options model parameter + + // Test the createInstanceNetworkAttachment operation with a valid options model parameter @Test - public void testCreateBareMetalServerWOptions() throws Throwable { + public void testCreateInstanceNetworkAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"firmware\": {\"update\": \"none\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"id\": \"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"disabled\", \"supported_modes\": [\"disabled\"]}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createBareMetalServerPath = "/bare_metal_servers"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}"; + String createInstanceNetworkAttachmentPath = "/instances/testString/network_attachments"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ImageIdentityById model - ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .build(); - - // Construct an instance of the KeyIdentityById model - KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") - .build(); - - // Construct an instance of the BareMetalServerInitializationPrototype model - BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() - .image(imageIdentityModel) - .keys(java.util.Arrays.asList(keyIdentityModel)) - .userData("testString") - .build(); - - // Construct an instance of the BareMetalServerProfileIdentityByName model - BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() - .name("bx2-metal-192x768") - .build(); - - // Construct an instance of the ReservationIdentityById model - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") - .build(); - - // Construct an instance of the BareMetalServerReservationAffinityPrototype model - BareMetalServerReservationAffinityPrototype bareMetalServerReservationAffinityPrototypeModel = new BareMetalServerReservationAffinityPrototype.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) - .build(); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the BareMetalServerTrustedPlatformModulePrototype model - BareMetalServerTrustedPlatformModulePrototype bareMetalServerTrustedPlatformModulePrototypeModel = new BareMetalServerTrustedPlatformModulePrototype.Builder() - .mode("disabled") - .build(); - - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() .address("10.0.0.5") @@ -14130,11 +15171,16 @@ public void testCreateBareMetalServerWOptions() throws Throwable { // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") + .address("10.0.0.7") .autoDelete(false) .name("my-reserved-ip") .build(); + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + // Construct an instance of the SecurityGroupIdentityById model SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") @@ -14145,8 +15191,8 @@ public void testCreateBareMetalServerWOptions() throws Throwable { .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - // Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.Builder() + // Construct an instance of the InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext model + InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new InstanceNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeInstanceNetworkAttachmentContext.Builder() .allowIpSpoofing(true) .autoDelete(false) .enableInfrastructureNat(true) @@ -14159,209 +15205,238 @@ public void testCreateBareMetalServerWOptions() throws Throwable { .subnet(subnetIdentityModel) .build(); - // Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype bareMetalServerNetworkAttachmentPrototypeModel = new BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.Builder() - .name("my-bare-metal-server-network-attachment") - .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) - .interfaceType("pci") + // Construct an instance of the CreateInstanceNetworkAttachmentOptions model + CreateInstanceNetworkAttachmentOptions createInstanceNetworkAttachmentOptionsModel = new CreateInstanceNetworkAttachmentOptions.Builder() + .instanceId("testString") + .virtualNetworkInterface(instanceNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) + .name("testString") .build(); - // Construct an instance of the BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype model - BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype bareMetalServerPrimaryNetworkAttachmentPrototypeModel = new BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype.Builder() - .name("my-bare-metal-server-network-attachment") - .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) - .interfaceType("pci") - .build(); + // Invoke createInstanceNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.createInstanceNetworkAttachment(createInstanceNetworkAttachmentOptionsModel).execute(); + assertNotNull(response); + InstanceNetworkAttachment responseObj = response.getResult(); + assertNotNull(responseObj); - // Construct an instance of the BareMetalServerPrototypeBareMetalServerByNetworkAttachment model - BareMetalServerPrototypeBareMetalServerByNetworkAttachment bareMetalServerPrototypeModel = new BareMetalServerPrototypeBareMetalServerByNetworkAttachment.Builder() - .bandwidth(Long.valueOf("20000")) - .enableSecureBoot(false) - .initialization(bareMetalServerInitializationPrototypeModel) - .name("my-bare-metal-server") - .profile(bareMetalServerProfileIdentityModel) - .reservationAffinity(bareMetalServerReservationAffinityPrototypeModel) - .resourceGroup(resourceGroupIdentityModel) - .trustedPlatformModule(bareMetalServerTrustedPlatformModulePrototypeModel) - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) - .networkAttachments(java.util.Arrays.asList(bareMetalServerNetworkAttachmentPrototypeModel)) - .primaryNetworkAttachment(bareMetalServerPrimaryNetworkAttachmentPrototypeModel) - .build(); + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createInstanceNetworkAttachmentPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } - // Construct an instance of the CreateBareMetalServerOptions model - CreateBareMetalServerOptions createBareMetalServerOptionsModel = new CreateBareMetalServerOptions.Builder() - .bareMetalServerPrototype(bareMetalServerPrototypeModel) + // Test the createInstanceNetworkAttachment operation with and without retries enabled + @Test + public void testCreateInstanceNetworkAttachmentWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateInstanceNetworkAttachmentWOptions(); + + vpcService.disableRetries(); + testCreateInstanceNetworkAttachmentWOptions(); + } + + // Test the createInstanceNetworkAttachment operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateInstanceNetworkAttachmentNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createInstanceNetworkAttachment(null).execute(); + } + + // Test the deleteInstanceNetworkAttachment operation with a valid options model parameter + @Test + public void testDeleteInstanceNetworkAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteInstanceNetworkAttachmentPath = "/instances/testString/network_attachments/testString"; + server.enqueue(new MockResponse() + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteInstanceNetworkAttachmentOptions model + DeleteInstanceNetworkAttachmentOptions deleteInstanceNetworkAttachmentOptionsModel = new DeleteInstanceNetworkAttachmentOptions.Builder() + .instanceId("testString") + .id("testString") .build(); - // Invoke createBareMetalServer() with a valid options model and verify the result - Response response = vpcService.createBareMetalServer(createBareMetalServerOptionsModel).execute(); + // Invoke deleteInstanceNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.deleteInstanceNetworkAttachment(deleteInstanceNetworkAttachmentOptionsModel).execute(); assertNotNull(response); - BareMetalServer responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createBareMetalServerPath); + assertEquals(parsedPath, deleteInstanceNetworkAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createBareMetalServer operation with and without retries enabled + // Test the deleteInstanceNetworkAttachment operation with and without retries enabled @Test - public void testCreateBareMetalServerWRetries() throws Throwable { + public void testDeleteInstanceNetworkAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateBareMetalServerWOptions(); + testDeleteInstanceNetworkAttachmentWOptions(); vpcService.disableRetries(); - testCreateBareMetalServerWOptions(); + testDeleteInstanceNetworkAttachmentWOptions(); } - // Test the createBareMetalServer operation with a null options model (negative test) + // Test the deleteInstanceNetworkAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateBareMetalServerNoOptions() throws Throwable { + public void testDeleteInstanceNetworkAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createBareMetalServer(null).execute(); + vpcService.deleteInstanceNetworkAttachment(null).execute(); } - // Test the createBareMetalServerConsoleAccessToken operation with a valid options model parameter + // Test the getInstanceNetworkAttachment operation with a valid options model parameter @Test - public void testCreateBareMetalServerConsoleAccessTokenWOptions() throws Throwable { + public void testGetInstanceNetworkAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI\", \"console_type\": \"serial\", \"created_at\": \"2020-07-27T21:50:14.000Z\", \"expires_at\": \"2020-07-27T21:51:14.000Z\", \"force\": false, \"href\": \"wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/console?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50IjoiYWEyNDMyYjFmYTRkNGFjZTg5MWU5YjgwZmMxMDRlMzQiLCJzZWNyZXQiOiJRVzRnWlhoaGJYQnNaU0J6WldOeVpYUUsiLCJleHAiOjE3MjYwNzU1OTR9.UFDVzzGJ54Go9Z4jgyPSLG49zNx-AjHTQrJA6ee8KLI\"}"; - String createBareMetalServerConsoleAccessTokenPath = "/bare_metal_servers/testString/console_access_token"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}"; + String getInstanceNetworkAttachmentPath = "/instances/testString/network_attachments/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the CreateBareMetalServerConsoleAccessTokenOptions model - CreateBareMetalServerConsoleAccessTokenOptions createBareMetalServerConsoleAccessTokenOptionsModel = new CreateBareMetalServerConsoleAccessTokenOptions.Builder() - .bareMetalServerId("testString") - .consoleType("serial") - .force(false) + // Construct an instance of the GetInstanceNetworkAttachmentOptions model + GetInstanceNetworkAttachmentOptions getInstanceNetworkAttachmentOptionsModel = new GetInstanceNetworkAttachmentOptions.Builder() + .instanceId("testString") + .id("testString") .build(); - // Invoke createBareMetalServerConsoleAccessToken() with a valid options model and verify the result - Response response = vpcService.createBareMetalServerConsoleAccessToken(createBareMetalServerConsoleAccessTokenOptionsModel).execute(); + // Invoke getInstanceNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.getInstanceNetworkAttachment(getInstanceNetworkAttachmentOptionsModel).execute(); assertNotNull(response); - BareMetalServerConsoleAccessToken responseObj = response.getResult(); + InstanceNetworkAttachment responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createBareMetalServerConsoleAccessTokenPath); + assertEquals(parsedPath, getInstanceNetworkAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createBareMetalServerConsoleAccessToken operation with and without retries enabled + // Test the getInstanceNetworkAttachment operation with and without retries enabled @Test - public void testCreateBareMetalServerConsoleAccessTokenWRetries() throws Throwable { + public void testGetInstanceNetworkAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateBareMetalServerConsoleAccessTokenWOptions(); + testGetInstanceNetworkAttachmentWOptions(); vpcService.disableRetries(); - testCreateBareMetalServerConsoleAccessTokenWOptions(); + testGetInstanceNetworkAttachmentWOptions(); } - // Test the createBareMetalServerConsoleAccessToken operation with a null options model (negative test) + // Test the getInstanceNetworkAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateBareMetalServerConsoleAccessTokenNoOptions() throws Throwable { + public void testGetInstanceNetworkAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createBareMetalServerConsoleAccessToken(null).execute(); + vpcService.getInstanceNetworkAttachment(null).execute(); } - // Test the listBareMetalServerDisks operation with a valid options model parameter + // Test the updateInstanceNetworkAttachment operation with a valid options model parameter @Test - public void testListBareMetalServerDisksWOptions() throws Throwable { + public void testUpdateInstanceNetworkAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}]}"; - String listBareMetalServerDisksPath = "/bare_metal_servers/testString/disks"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_attachments/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"lifecycle_state\": \"stable\", \"name\": \"my-instance-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"instance_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}"; + String updateInstanceNetworkAttachmentPath = "/instances/testString/network_attachments/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBareMetalServerDisksOptions model - ListBareMetalServerDisksOptions listBareMetalServerDisksOptionsModel = new ListBareMetalServerDisksOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the InstanceNetworkAttachmentPatch model + InstanceNetworkAttachmentPatch instanceNetworkAttachmentPatchModel = new InstanceNetworkAttachmentPatch.Builder() + .name("my-instance-network-attachment-updated") .build(); + Map instanceNetworkAttachmentPatchModelAsPatch = instanceNetworkAttachmentPatchModel.asPatch(); - // Invoke listBareMetalServerDisks() with a valid options model and verify the result - Response response = vpcService.listBareMetalServerDisks(listBareMetalServerDisksOptionsModel).execute(); + // Construct an instance of the UpdateInstanceNetworkAttachmentOptions model + UpdateInstanceNetworkAttachmentOptions updateInstanceNetworkAttachmentOptionsModel = new UpdateInstanceNetworkAttachmentOptions.Builder() + .instanceId("testString") + .id("testString") + .instanceNetworkAttachmentPatch(instanceNetworkAttachmentPatchModelAsPatch) + .build(); + + // Invoke updateInstanceNetworkAttachment() with a valid options model and verify the result + Response response = vpcService.updateInstanceNetworkAttachment(updateInstanceNetworkAttachmentOptionsModel).execute(); assertNotNull(response); - BareMetalServerDiskCollection responseObj = response.getResult(); + InstanceNetworkAttachment responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBareMetalServerDisksPath); + assertEquals(parsedPath, updateInstanceNetworkAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listBareMetalServerDisks operation with and without retries enabled + // Test the updateInstanceNetworkAttachment operation with and without retries enabled @Test - public void testListBareMetalServerDisksWRetries() throws Throwable { + public void testUpdateInstanceNetworkAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBareMetalServerDisksWOptions(); + testUpdateInstanceNetworkAttachmentWOptions(); vpcService.disableRetries(); - testListBareMetalServerDisksWOptions(); + testUpdateInstanceNetworkAttachmentWOptions(); } - // Test the listBareMetalServerDisks operation with a null options model (negative test) + // Test the updateInstanceNetworkAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListBareMetalServerDisksNoOptions() throws Throwable { + public void testUpdateInstanceNetworkAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listBareMetalServerDisks(null).execute(); + vpcService.updateInstanceNetworkAttachment(null).execute(); } - // Test the getBareMetalServerDisk operation with a valid options model parameter + // Test the listInstanceNetworkInterfaces operation with a valid options model parameter @Test - public void testGetBareMetalServerDiskWOptions() throws Throwable { + public void testListInstanceNetworkInterfacesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}"; - String getBareMetalServerDiskPath = "/bare_metal_servers/testString/disks/testString"; + String mockResponseBody = "{\"network_interfaces\": [{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\"}]}"; + String listInstanceNetworkInterfacesPath = "/instances/testString/network_interfaces"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBareMetalServerDiskOptions model - GetBareMetalServerDiskOptions getBareMetalServerDiskOptionsModel = new GetBareMetalServerDiskOptions.Builder() - .bareMetalServerId("testString") - .id("testString") + // Construct an instance of the ListInstanceNetworkInterfacesOptions model + ListInstanceNetworkInterfacesOptions listInstanceNetworkInterfacesOptionsModel = new ListInstanceNetworkInterfacesOptions.Builder() + .instanceId("testString") .build(); - // Invoke getBareMetalServerDisk() with a valid options model and verify the result - Response response = vpcService.getBareMetalServerDisk(getBareMetalServerDiskOptionsModel).execute(); + // Invoke listInstanceNetworkInterfaces() with a valid options model and verify the result + Response response = vpcService.listInstanceNetworkInterfaces(listInstanceNetworkInterfacesOptionsModel).execute(); assertNotNull(response); - BareMetalServerDisk responseObj = response.getResult(); + NetworkInterfaceUnpaginatedCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -14370,336 +15445,348 @@ public void testGetBareMetalServerDiskWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerDiskPath); + assertEquals(parsedPath, listInstanceNetworkInterfacesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBareMetalServerDisk operation with and without retries enabled + // Test the listInstanceNetworkInterfaces operation with and without retries enabled @Test - public void testGetBareMetalServerDiskWRetries() throws Throwable { + public void testListInstanceNetworkInterfacesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBareMetalServerDiskWOptions(); + testListInstanceNetworkInterfacesWOptions(); vpcService.disableRetries(); - testGetBareMetalServerDiskWOptions(); + testListInstanceNetworkInterfacesWOptions(); } - // Test the getBareMetalServerDisk operation with a null options model (negative test) + // Test the listInstanceNetworkInterfaces operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerDiskNoOptions() throws Throwable { + public void testListInstanceNetworkInterfacesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBareMetalServerDisk(null).execute(); + vpcService.listInstanceNetworkInterfaces(null).execute(); } - // Test the updateBareMetalServerDisk operation with a valid options model parameter + // Test the createInstanceNetworkInterface operation with a valid options model parameter @Test - public void testUpdateBareMetalServerDiskWOptions() throws Throwable { + public void testCreateInstanceNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}"; - String updateBareMetalServerDiskPath = "/bare_metal_servers/testString/disks/testString"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\"}"; + String createInstanceNetworkInterfacePath = "/instances/testString/network_interfaces"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the BareMetalServerDiskPatch model - BareMetalServerDiskPatch bareMetalServerDiskPatchModel = new BareMetalServerDiskPatch.Builder() - .name("my-bare-metal-server-disk-updated") + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - Map bareMetalServerDiskPatchModelAsPatch = bareMetalServerDiskPatchModel.asPatch(); - // Construct an instance of the UpdateBareMetalServerDiskOptions model - UpdateBareMetalServerDiskOptions updateBareMetalServerDiskOptionsModel = new UpdateBareMetalServerDiskOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model + NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the CreateInstanceNetworkInterfaceOptions model + CreateInstanceNetworkInterfaceOptions createInstanceNetworkInterfaceOptionsModel = new CreateInstanceNetworkInterfaceOptions.Builder() + .instanceId("testString") + .subnet(subnetIdentityModel) + .allowIpSpoofing(true) + .name("my-instance-network-interface") + .primaryIp(networkInterfaceIpPrototypeModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .build(); + + // Invoke createInstanceNetworkInterface() with a valid options model and verify the result + Response response = vpcService.createInstanceNetworkInterface(createInstanceNetworkInterfaceOptionsModel).execute(); + assertNotNull(response); + NetworkInterface responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createInstanceNetworkInterfacePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createInstanceNetworkInterface operation with and without retries enabled + @Test + public void testCreateInstanceNetworkInterfaceWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateInstanceNetworkInterfaceWOptions(); + + vpcService.disableRetries(); + testCreateInstanceNetworkInterfaceWOptions(); + } + + // Test the createInstanceNetworkInterface operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateInstanceNetworkInterfaceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createInstanceNetworkInterface(null).execute(); + } + + // Test the deleteInstanceNetworkInterface operation with a valid options model parameter + @Test + public void testDeleteInstanceNetworkInterfaceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteInstanceNetworkInterfacePath = "/instances/testString/network_interfaces/testString"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteInstanceNetworkInterfaceOptions model + DeleteInstanceNetworkInterfaceOptions deleteInstanceNetworkInterfaceOptionsModel = new DeleteInstanceNetworkInterfaceOptions.Builder() + .instanceId("testString") .id("testString") - .bareMetalServerDiskPatch(bareMetalServerDiskPatchModelAsPatch) .build(); - // Invoke updateBareMetalServerDisk() with a valid options model and verify the result - Response response = vpcService.updateBareMetalServerDisk(updateBareMetalServerDiskOptionsModel).execute(); + // Invoke deleteInstanceNetworkInterface() with a valid options model and verify the result + Response response = vpcService.deleteInstanceNetworkInterface(deleteInstanceNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - BareMetalServerDisk responseObj = response.getResult(); + Void responseObj = response.getResult(); + assertNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteInstanceNetworkInterfacePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the deleteInstanceNetworkInterface operation with and without retries enabled + @Test + public void testDeleteInstanceNetworkInterfaceWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testDeleteInstanceNetworkInterfaceWOptions(); + + vpcService.disableRetries(); + testDeleteInstanceNetworkInterfaceWOptions(); + } + + // Test the deleteInstanceNetworkInterface operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteInstanceNetworkInterfaceNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.deleteInstanceNetworkInterface(null).execute(); + } + + // Test the getInstanceNetworkInterface operation with a valid options model parameter + @Test + public void testGetInstanceNetworkInterfaceWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\"}"; + String getInstanceNetworkInterfacePath = "/instances/testString/network_interfaces/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetInstanceNetworkInterfaceOptions model + GetInstanceNetworkInterfaceOptions getInstanceNetworkInterfaceOptionsModel = new GetInstanceNetworkInterfaceOptions.Builder() + .instanceId("testString") + .id("testString") + .build(); + + // Invoke getInstanceNetworkInterface() with a valid options model and verify the result + Response response = vpcService.getInstanceNetworkInterface(getInstanceNetworkInterfaceOptionsModel).execute(); + assertNotNull(response); + NetworkInterface responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateBareMetalServerDiskPath); + assertEquals(parsedPath, getInstanceNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateBareMetalServerDisk operation with and without retries enabled + // Test the getInstanceNetworkInterface operation with and without retries enabled @Test - public void testUpdateBareMetalServerDiskWRetries() throws Throwable { + public void testGetInstanceNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateBareMetalServerDiskWOptions(); + testGetInstanceNetworkInterfaceWOptions(); vpcService.disableRetries(); - testUpdateBareMetalServerDiskWOptions(); + testGetInstanceNetworkInterfaceWOptions(); } - // Test the updateBareMetalServerDisk operation with a null options model (negative test) + // Test the getInstanceNetworkInterface operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateBareMetalServerDiskNoOptions() throws Throwable { + public void testGetInstanceNetworkInterfaceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateBareMetalServerDisk(null).execute(); + vpcService.getInstanceNetworkInterface(null).execute(); } - // Test the listBareMetalServerNetworkAttachments operation with a valid options model parameter + // Test the updateInstanceNetworkInterface operation with a valid options model parameter @Test - public void testListBareMetalServerNetworkAttachmentsWOptions() throws Throwable { + public void testUpdateInstanceNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"network_attachments\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"lifecycle_state\": \"stable\", \"name\": \"my-bare-metal-server-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"allowed_vlans\": [4], \"interface_type\": \"pci\"}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listBareMetalServerNetworkAttachmentsPath = "/bare_metal_servers/testString/network_attachments"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\"}"; + String updateInstanceNetworkInterfacePath = "/instances/testString/network_interfaces/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBareMetalServerNetworkAttachmentsOptions model - ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptionsModel = new ListBareMetalServerNetworkAttachmentsOptions.Builder() - .bareMetalServerId("testString") - .start("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the NetworkInterfacePatch model + NetworkInterfacePatch networkInterfacePatchModel = new NetworkInterfacePatch.Builder() + .allowIpSpoofing(true) + .name("my-network-interface-updated") .build(); + Map networkInterfacePatchModelAsPatch = networkInterfacePatchModel.asPatch(); - // Invoke listBareMetalServerNetworkAttachments() with a valid options model and verify the result - Response response = vpcService.listBareMetalServerNetworkAttachments(listBareMetalServerNetworkAttachmentsOptionsModel).execute(); + // Construct an instance of the UpdateInstanceNetworkInterfaceOptions model + UpdateInstanceNetworkInterfaceOptions updateInstanceNetworkInterfaceOptionsModel = new UpdateInstanceNetworkInterfaceOptions.Builder() + .instanceId("testString") + .id("testString") + .networkInterfacePatch(networkInterfacePatchModelAsPatch) + .build(); + + // Invoke updateInstanceNetworkInterface() with a valid options model and verify the result + Response response = vpcService.updateInstanceNetworkInterface(updateInstanceNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - BareMetalServerNetworkAttachmentCollection responseObj = response.getResult(); + NetworkInterface responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBareMetalServerNetworkAttachmentsPath); + assertEquals(parsedPath, updateInstanceNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listBareMetalServerNetworkAttachments operation with and without retries enabled + // Test the updateInstanceNetworkInterface operation with and without retries enabled @Test - public void testListBareMetalServerNetworkAttachmentsWRetries() throws Throwable { + public void testUpdateInstanceNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBareMetalServerNetworkAttachmentsWOptions(); + testUpdateInstanceNetworkInterfaceWOptions(); vpcService.disableRetries(); - testListBareMetalServerNetworkAttachmentsWOptions(); + testUpdateInstanceNetworkInterfaceWOptions(); } - // Test the listBareMetalServerNetworkAttachments operation with a null options model (negative test) + // Test the updateInstanceNetworkInterface operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListBareMetalServerNetworkAttachmentsNoOptions() throws Throwable { + public void testUpdateInstanceNetworkInterfaceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listBareMetalServerNetworkAttachments(null).execute(); - } - - // Test the listBareMetalServerNetworkAttachments operation using the BareMetalServerNetworkAttachmentsPager.getNext() method - @Test - public void testListBareMetalServerNetworkAttachmentsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_attachments\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"lifecycle_state\":\"stable\",\"name\":\"my-bare-metal-server-network-attachment\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"allowed_vlans\":[4],\"interface_type\":\"pci\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_attachments\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"lifecycle_state\":\"stable\",\"name\":\"my-bare-metal-server-network-attachment\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"allowed_vlans\":[4],\"interface_type\":\"pci\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptions = new ListBareMetalServerNetworkAttachmentsOptions.Builder() - .bareMetalServerId("testString") - .limit(Long.valueOf("10")) - .build(); - - List allResults = new ArrayList<>(); - BareMetalServerNetworkAttachmentsPager pager = new BareMetalServerNetworkAttachmentsPager(vpcService, listBareMetalServerNetworkAttachmentsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + vpcService.updateInstanceNetworkInterface(null).execute(); } - - // Test the listBareMetalServerNetworkAttachments operation using the BareMetalServerNetworkAttachmentsPager.getAll() method - @Test - public void testListBareMetalServerNetworkAttachmentsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_attachments\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"lifecycle_state\":\"stable\",\"name\":\"my-bare-metal-server-network-attachment\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"allowed_vlans\":[4],\"interface_type\":\"pci\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_attachments\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"lifecycle_state\":\"stable\",\"name\":\"my-bare-metal-server-network-attachment\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"bare_metal_server_network_attachment\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"allowed_vlans\":[4],\"interface_type\":\"pci\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListBareMetalServerNetworkAttachmentsOptions listBareMetalServerNetworkAttachmentsOptions = new ListBareMetalServerNetworkAttachmentsOptions.Builder() - .bareMetalServerId("testString") - .limit(Long.valueOf("10")) - .build(); - BareMetalServerNetworkAttachmentsPager pager = new BareMetalServerNetworkAttachmentsPager(vpcService, listBareMetalServerNetworkAttachmentsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createBareMetalServerNetworkAttachment operation with a valid options model parameter + // Test the listInstanceNetworkInterfaceFloatingIps operation with a valid options model parameter @Test - public void testCreateBareMetalServerNetworkAttachmentWOptions() throws Throwable { + public void testListInstanceNetworkInterfaceFloatingIpsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"lifecycle_state\": \"stable\", \"name\": \"my-bare-metal-server-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; - String createBareMetalServerNetworkAttachmentPath = "/bare_metal_servers/testString/network_attachments"; + String mockResponseBody = "{\"floating_ips\": [{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; + String listInstanceNetworkInterfaceFloatingIpsPath = "/instances/testString/network_interfaces/testString/floating_ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext model - BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel = new BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); - - // Construct an instance of the BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype model - BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype bareMetalServerNetworkAttachmentPrototypeModel = new BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype.Builder() - .name("my-bare-metal-server-network-attachment") - .virtualNetworkInterface(bareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceModel) - .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) - .interfaceType("pci") - .build(); - - // Construct an instance of the CreateBareMetalServerNetworkAttachmentOptions model - CreateBareMetalServerNetworkAttachmentOptions createBareMetalServerNetworkAttachmentOptionsModel = new CreateBareMetalServerNetworkAttachmentOptions.Builder() - .bareMetalServerId("testString") - .bareMetalServerNetworkAttachmentPrototype(bareMetalServerNetworkAttachmentPrototypeModel) + // Construct an instance of the ListInstanceNetworkInterfaceFloatingIpsOptions model + ListInstanceNetworkInterfaceFloatingIpsOptions listInstanceNetworkInterfaceFloatingIpsOptionsModel = new ListInstanceNetworkInterfaceFloatingIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .build(); - // Invoke createBareMetalServerNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.createBareMetalServerNetworkAttachment(createBareMetalServerNetworkAttachmentOptionsModel).execute(); + // Invoke listInstanceNetworkInterfaceFloatingIps() with a valid options model and verify the result + Response response = vpcService.listInstanceNetworkInterfaceFloatingIps(listInstanceNetworkInterfaceFloatingIpsOptionsModel).execute(); assertNotNull(response); - BareMetalServerNetworkAttachment responseObj = response.getResult(); + FloatingIPUnpaginatedCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createBareMetalServerNetworkAttachmentPath); + assertEquals(parsedPath, listInstanceNetworkInterfaceFloatingIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createBareMetalServerNetworkAttachment operation with and without retries enabled + // Test the listInstanceNetworkInterfaceFloatingIps operation with and without retries enabled @Test - public void testCreateBareMetalServerNetworkAttachmentWRetries() throws Throwable { + public void testListInstanceNetworkInterfaceFloatingIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateBareMetalServerNetworkAttachmentWOptions(); + testListInstanceNetworkInterfaceFloatingIpsWOptions(); vpcService.disableRetries(); - testCreateBareMetalServerNetworkAttachmentWOptions(); + testListInstanceNetworkInterfaceFloatingIpsWOptions(); } - // Test the createBareMetalServerNetworkAttachment operation with a null options model (negative test) + // Test the listInstanceNetworkInterfaceFloatingIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateBareMetalServerNetworkAttachmentNoOptions() throws Throwable { + public void testListInstanceNetworkInterfaceFloatingIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createBareMetalServerNetworkAttachment(null).execute(); + vpcService.listInstanceNetworkInterfaceFloatingIps(null).execute(); } - // Test the deleteBareMetalServerNetworkAttachment operation with a valid options model parameter + // Test the removeInstanceNetworkInterfaceFloatingIp operation with a valid options model parameter @Test - public void testDeleteBareMetalServerNetworkAttachmentWOptions() throws Throwable { + public void testRemoveInstanceNetworkInterfaceFloatingIpWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteBareMetalServerNetworkAttachmentPath = "/bare_metal_servers/testString/network_attachments/testString"; + String removeInstanceNetworkInterfaceFloatingIpPath = "/instances/testString/network_interfaces/testString/floating_ips/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteBareMetalServerNetworkAttachmentOptions model - DeleteBareMetalServerNetworkAttachmentOptions deleteBareMetalServerNetworkAttachmentOptionsModel = new DeleteBareMetalServerNetworkAttachmentOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the RemoveInstanceNetworkInterfaceFloatingIpOptions model + RemoveInstanceNetworkInterfaceFloatingIpOptions removeInstanceNetworkInterfaceFloatingIpOptionsModel = new RemoveInstanceNetworkInterfaceFloatingIpOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .id("testString") .build(); - // Invoke deleteBareMetalServerNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.deleteBareMetalServerNetworkAttachment(deleteBareMetalServerNetworkAttachmentOptionsModel).execute(); + // Invoke removeInstanceNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.removeInstanceNetworkInterfaceFloatingIp(removeInstanceNetworkInterfaceFloatingIpOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -14710,52 +15797,53 @@ public void testDeleteBareMetalServerNetworkAttachmentWOptions() throws Throwabl assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteBareMetalServerNetworkAttachmentPath); + assertEquals(parsedPath, removeInstanceNetworkInterfaceFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteBareMetalServerNetworkAttachment operation with and without retries enabled + // Test the removeInstanceNetworkInterfaceFloatingIp operation with and without retries enabled @Test - public void testDeleteBareMetalServerNetworkAttachmentWRetries() throws Throwable { + public void testRemoveInstanceNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteBareMetalServerNetworkAttachmentWOptions(); + testRemoveInstanceNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testDeleteBareMetalServerNetworkAttachmentWOptions(); + testRemoveInstanceNetworkInterfaceFloatingIpWOptions(); } - // Test the deleteBareMetalServerNetworkAttachment operation with a null options model (negative test) + // Test the removeInstanceNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteBareMetalServerNetworkAttachmentNoOptions() throws Throwable { + public void testRemoveInstanceNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteBareMetalServerNetworkAttachment(null).execute(); + vpcService.removeInstanceNetworkInterfaceFloatingIp(null).execute(); } - // Test the getBareMetalServerNetworkAttachment operation with a valid options model parameter + // Test the getInstanceNetworkInterfaceFloatingIp operation with a valid options model parameter @Test - public void testGetBareMetalServerNetworkAttachmentWOptions() throws Throwable { + public void testGetInstanceNetworkInterfaceFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"lifecycle_state\": \"stable\", \"name\": \"my-bare-metal-server-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; - String getBareMetalServerNetworkAttachmentPath = "/bare_metal_servers/testString/network_attachments/testString"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getInstanceNetworkInterfaceFloatingIpPath = "/instances/testString/network_interfaces/testString/floating_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBareMetalServerNetworkAttachmentOptions model - GetBareMetalServerNetworkAttachmentOptions getBareMetalServerNetworkAttachmentOptionsModel = new GetBareMetalServerNetworkAttachmentOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the GetInstanceNetworkInterfaceFloatingIpOptions model + GetInstanceNetworkInterfaceFloatingIpOptions getInstanceNetworkInterfaceFloatingIpOptionsModel = new GetInstanceNetworkInterfaceFloatingIpOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .id("testString") .build(); - // Invoke getBareMetalServerNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.getBareMetalServerNetworkAttachment(getBareMetalServerNetworkAttachmentOptionsModel).execute(); + // Invoke getInstanceNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.getInstanceNetworkInterfaceFloatingIp(getInstanceNetworkInterfaceFloatingIpOptionsModel).execute(); assertNotNull(response); - BareMetalServerNetworkAttachment responseObj = response.getResult(); + FloatingIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -14764,115 +15852,109 @@ public void testGetBareMetalServerNetworkAttachmentWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerNetworkAttachmentPath); + assertEquals(parsedPath, getInstanceNetworkInterfaceFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBareMetalServerNetworkAttachment operation with and without retries enabled + // Test the getInstanceNetworkInterfaceFloatingIp operation with and without retries enabled @Test - public void testGetBareMetalServerNetworkAttachmentWRetries() throws Throwable { + public void testGetInstanceNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBareMetalServerNetworkAttachmentWOptions(); + testGetInstanceNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testGetBareMetalServerNetworkAttachmentWOptions(); + testGetInstanceNetworkInterfaceFloatingIpWOptions(); } - // Test the getBareMetalServerNetworkAttachment operation with a null options model (negative test) + // Test the getInstanceNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerNetworkAttachmentNoOptions() throws Throwable { + public void testGetInstanceNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBareMetalServerNetworkAttachment(null).execute(); + vpcService.getInstanceNetworkInterfaceFloatingIp(null).execute(); } - // Test the updateBareMetalServerNetworkAttachment operation with a valid options model parameter + // Test the addInstanceNetworkInterfaceFloatingIp operation with a valid options model parameter @Test - public void testUpdateBareMetalServerNetworkAttachmentWOptions() throws Throwable { + public void testAddInstanceNetworkInterfaceFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"lifecycle_state\": \"stable\", \"name\": \"my-bare-metal-server-network-attachment\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"allowed_vlans\": [4], \"interface_type\": \"pci\"}"; - String updateBareMetalServerNetworkAttachmentPath = "/bare_metal_servers/testString/network_attachments/testString"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String addInstanceNetworkInterfaceFloatingIpPath = "/instances/testString/network_interfaces/testString/floating_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the BareMetalServerNetworkAttachmentPatch model - BareMetalServerNetworkAttachmentPatch bareMetalServerNetworkAttachmentPatchModel = new BareMetalServerNetworkAttachmentPatch.Builder() - .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) - .name("my-bare-metal-server-network-attachment-updated") - .build(); - Map bareMetalServerNetworkAttachmentPatchModelAsPatch = bareMetalServerNetworkAttachmentPatchModel.asPatch(); - - // Construct an instance of the UpdateBareMetalServerNetworkAttachmentOptions model - UpdateBareMetalServerNetworkAttachmentOptions updateBareMetalServerNetworkAttachmentOptionsModel = new UpdateBareMetalServerNetworkAttachmentOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the AddInstanceNetworkInterfaceFloatingIpOptions model + AddInstanceNetworkInterfaceFloatingIpOptions addInstanceNetworkInterfaceFloatingIpOptionsModel = new AddInstanceNetworkInterfaceFloatingIpOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .id("testString") - .bareMetalServerNetworkAttachmentPatch(bareMetalServerNetworkAttachmentPatchModelAsPatch) .build(); - // Invoke updateBareMetalServerNetworkAttachment() with a valid options model and verify the result - Response response = vpcService.updateBareMetalServerNetworkAttachment(updateBareMetalServerNetworkAttachmentOptionsModel).execute(); + // Invoke addInstanceNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.addInstanceNetworkInterfaceFloatingIp(addInstanceNetworkInterfaceFloatingIpOptionsModel).execute(); assertNotNull(response); - BareMetalServerNetworkAttachment responseObj = response.getResult(); + FloatingIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateBareMetalServerNetworkAttachmentPath); + assertEquals(parsedPath, addInstanceNetworkInterfaceFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateBareMetalServerNetworkAttachment operation with and without retries enabled + // Test the addInstanceNetworkInterfaceFloatingIp operation with and without retries enabled @Test - public void testUpdateBareMetalServerNetworkAttachmentWRetries() throws Throwable { + public void testAddInstanceNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateBareMetalServerNetworkAttachmentWOptions(); + testAddInstanceNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testUpdateBareMetalServerNetworkAttachmentWOptions(); + testAddInstanceNetworkInterfaceFloatingIpWOptions(); } - // Test the updateBareMetalServerNetworkAttachment operation with a null options model (negative test) + // Test the addInstanceNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateBareMetalServerNetworkAttachmentNoOptions() throws Throwable { + public void testAddInstanceNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateBareMetalServerNetworkAttachment(null).execute(); + vpcService.addInstanceNetworkInterfaceFloatingIp(null).execute(); } - // Test the listBareMetalServerNetworkInterfaces operation with a valid options model parameter + // Test the listInstanceNetworkInterfaceIps operation with a valid options model parameter @Test - public void testListBareMetalServerNetworkInterfacesWOptions() throws Throwable { + public void testListInstanceNetworkInterfaceIpsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"network_interfaces\": [{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"mac_address\": \"02:00:04:00:C4:6A\", \"name\": \"my-bare-metal-server-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listBareMetalServerNetworkInterfacesPath = "/bare_metal_servers/testString/network_interfaces"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listInstanceNetworkInterfaceIpsPath = "/instances/testString/network_interfaces/testString/ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBareMetalServerNetworkInterfacesOptions model - ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptionsModel = new ListBareMetalServerNetworkInterfacesOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the ListInstanceNetworkInterfaceIpsOptions model + ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptionsModel = new ListInstanceNetworkInterfaceIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .start("testString") .limit(Long.valueOf("10")) .build(); - // Invoke listBareMetalServerNetworkInterfaces() with a valid options model and verify the result - Response response = vpcService.listBareMetalServerNetworkInterfaces(listBareMetalServerNetworkInterfacesOptionsModel).execute(); + // Invoke listInstanceNetworkInterfaceIps() with a valid options model and verify the result + Response response = vpcService.listInstanceNetworkInterfaceIps(listInstanceNetworkInterfaceIpsOptionsModel).execute(); assertNotNull(response); - BareMetalServerNetworkInterfaceCollection responseObj = response.getResult(); + ReservedIPCollectionInstanceNetworkInterfaceContext responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -14881,39 +15963,39 @@ public void testListBareMetalServerNetworkInterfacesWOptions() throws Throwable assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBareMetalServerNetworkInterfacesPath); + assertEquals(parsedPath, listInstanceNetworkInterfaceIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listBareMetalServerNetworkInterfaces operation with and without retries enabled + // Test the listInstanceNetworkInterfaceIps operation with and without retries enabled @Test - public void testListBareMetalServerNetworkInterfacesWRetries() throws Throwable { + public void testListInstanceNetworkInterfaceIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBareMetalServerNetworkInterfacesWOptions(); + testListInstanceNetworkInterfaceIpsWOptions(); vpcService.disableRetries(); - testListBareMetalServerNetworkInterfacesWOptions(); + testListInstanceNetworkInterfaceIpsWOptions(); } - // Test the listBareMetalServerNetworkInterfaces operation with a null options model (negative test) + // Test the listInstanceNetworkInterfaceIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListBareMetalServerNetworkInterfacesNoOptions() throws Throwable { + public void testListInstanceNetworkInterfaceIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listBareMetalServerNetworkInterfaces(null).execute(); + vpcService.listInstanceNetworkInterfaceIps(null).execute(); } - // Test the listBareMetalServerNetworkInterfaces operation using the BareMetalServerNetworkInterfacesPager.getNext() method + // Test the listInstanceNetworkInterfaceIps operation using the InstanceNetworkInterfaceIpsPager.getNext() method @Test - public void testListBareMetalServerNetworkInterfacesWithPagerGetNext() throws Throwable { + public void testListInstanceNetworkInterfaceIpsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"mac_address\":\"02:00:04:00:C4:6A\",\"name\":\"my-bare-metal-server-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"mac_address\":\"02:00:04:00:C4:6A\",\"name\":\"my-bare-metal-server-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -14927,27 +16009,28 @@ public void testListBareMetalServerNetworkInterfacesWithPagerGetNext() throws Th .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() - .bareMetalServerId("testString") + ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .limit(Long.valueOf("10")) .build(); - List allResults = new ArrayList<>(); - BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(vpcService, listBareMetalServerNetworkInterfacesOptions); + List allResults = new ArrayList<>(); + InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(vpcService, listInstanceNetworkInterfaceIpsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listBareMetalServerNetworkInterfaces operation using the BareMetalServerNetworkInterfacesPager.getAll() method + // Test the listInstanceNetworkInterfaceIps operation using the InstanceNetworkInterfaceIpsPager.getAll() method @Test - public void testListBareMetalServerNetworkInterfacesWithPagerGetAll() throws Throwable { + public void testListInstanceNetworkInterfaceIpsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"mac_address\":\"02:00:04:00:C4:6A\",\"name\":\"my-bare-metal-server-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"network_interfaces\":[{\"allow_ip_spoofing\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":true,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}],\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"mac_address\":\"02:00:04:00:C4:6A\",\"name\":\"my-bare-metal-server-network-interface\",\"port_speed\":1000,\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"status\":\"available\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"type\":\"primary\",\"interface_type\":\"hipersocket\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -14961,66 +16044,154 @@ public void testListBareMetalServerNetworkInterfacesWithPagerGetAll() throws Thr .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListBareMetalServerNetworkInterfacesOptions listBareMetalServerNetworkInterfacesOptions = new ListBareMetalServerNetworkInterfacesOptions.Builder() - .bareMetalServerId("testString") + ListInstanceNetworkInterfaceIpsOptions listInstanceNetworkInterfaceIpsOptions = new ListInstanceNetworkInterfaceIpsOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") .limit(Long.valueOf("10")) .build(); - BareMetalServerNetworkInterfacesPager pager = new BareMetalServerNetworkInterfacesPager(vpcService, listBareMetalServerNetworkInterfacesOptions); - List allResults = pager.getAll(); + InstanceNetworkInterfaceIpsPager pager = new InstanceNetworkInterfaceIpsPager(vpcService, listInstanceNetworkInterfaceIpsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createBareMetalServerNetworkInterface operation with a valid options model parameter + // Test the getInstanceNetworkInterfaceIp operation with a valid options model parameter @Test - public void testCreateBareMetalServerNetworkInterfaceWOptions() throws Throwable { + public void testGetInstanceNetworkInterfaceIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"mac_address\": \"02:00:04:00:C4:6A\", \"name\": \"my-bare-metal-server-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; - String createBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; + String getInstanceNetworkInterfaceIpPath = "/instances/testString/network_interfaces/testString/ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext model - NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext networkInterfaceIpPrototypeModel = new NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") + // Construct an instance of the GetInstanceNetworkInterfaceIpOptions model + GetInstanceNetworkInterfaceIpOptions getInstanceNetworkInterfaceIpOptionsModel = new GetInstanceNetworkInterfaceIpOptions.Builder() + .instanceId("testString") + .networkInterfaceId("testString") + .id("testString") .build(); - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); + // Invoke getInstanceNetworkInterfaceIp() with a valid options model and verify the result + Response response = vpcService.getInstanceNetworkInterfaceIp(getInstanceNetworkInterfaceIpOptionsModel).execute(); + assertNotNull(response); + ReservedIP responseObj = response.getResult(); + assertNotNull(responseObj); - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getInstanceNetworkInterfaceIpPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } - // Construct an instance of the BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype model - BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype bareMetalServerNetworkInterfacePrototypeModel = new BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype.Builder() - .allowIpSpoofing(true) - .enableInfrastructureNat(true) - .name("my-bare-metal-server-network-interface") - .primaryIp(networkInterfaceIpPrototypeModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .interfaceType("hipersocket") + // Test the getInstanceNetworkInterfaceIp operation with and without retries enabled + @Test + public void testGetInstanceNetworkInterfaceIpWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetInstanceNetworkInterfaceIpWOptions(); + + vpcService.disableRetries(); + testGetInstanceNetworkInterfaceIpWOptions(); + } + + // Test the getInstanceNetworkInterfaceIp operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetInstanceNetworkInterfaceIpNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getInstanceNetworkInterfaceIp(null).execute(); + } + + // Test the listInstanceVolumeAttachments operation with a valid options model parameter + @Test + public void testListInstanceVolumeAttachmentsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"volume_attachments\": [{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}]}"; + String listInstanceVolumeAttachmentsPath = "/instances/testString/volume_attachments"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListInstanceVolumeAttachmentsOptions model + ListInstanceVolumeAttachmentsOptions listInstanceVolumeAttachmentsOptionsModel = new ListInstanceVolumeAttachmentsOptions.Builder() + .instanceId("testString") .build(); - // Construct an instance of the CreateBareMetalServerNetworkInterfaceOptions model - CreateBareMetalServerNetworkInterfaceOptions createBareMetalServerNetworkInterfaceOptionsModel = new CreateBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") - .bareMetalServerNetworkInterfacePrototype(bareMetalServerNetworkInterfacePrototypeModel) + // Invoke listInstanceVolumeAttachments() with a valid options model and verify the result + Response response = vpcService.listInstanceVolumeAttachments(listInstanceVolumeAttachmentsOptionsModel).execute(); + assertNotNull(response); + VolumeAttachmentCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listInstanceVolumeAttachmentsPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the listInstanceVolumeAttachments operation with and without retries enabled + @Test + public void testListInstanceVolumeAttachmentsWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListInstanceVolumeAttachmentsWOptions(); + + vpcService.disableRetries(); + testListInstanceVolumeAttachmentsWOptions(); + } + + // Test the listInstanceVolumeAttachments operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListInstanceVolumeAttachmentsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listInstanceVolumeAttachments(null).execute(); + } + + // Test the createInstanceVolumeAttachment operation with a valid options model parameter + @Test + public void testCreateInstanceVolumeAttachmentWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}"; + String createInstanceVolumeAttachmentPath = "/instances/testString/volume_attachments"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById model + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() + .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .build(); + + // Construct an instance of the CreateInstanceVolumeAttachmentOptions model + CreateInstanceVolumeAttachmentOptions createInstanceVolumeAttachmentOptionsModel = new CreateInstanceVolumeAttachmentOptions.Builder() + .instanceId("testString") + .volume(volumeAttachmentPrototypeVolumeModel) + .deleteVolumeOnInstanceDelete(false) + .name("my-volume-attachment") .build(); - // Invoke createBareMetalServerNetworkInterface() with a valid options model and verify the result - Response response = vpcService.createBareMetalServerNetworkInterface(createBareMetalServerNetworkInterfaceOptionsModel).execute(); + // Invoke createInstanceVolumeAttachment() with a valid options model and verify the result + Response response = vpcService.createInstanceVolumeAttachment(createInstanceVolumeAttachmentOptionsModel).execute(); assertNotNull(response); - BareMetalServerNetworkInterface responseObj = response.getResult(); + VolumeAttachment responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -15029,49 +16200,49 @@ public void testCreateBareMetalServerNetworkInterfaceWOptions() throws Throwable assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createBareMetalServerNetworkInterfacePath); + assertEquals(parsedPath, createInstanceVolumeAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createBareMetalServerNetworkInterface operation with and without retries enabled + // Test the createInstanceVolumeAttachment operation with and without retries enabled @Test - public void testCreateBareMetalServerNetworkInterfaceWRetries() throws Throwable { + public void testCreateInstanceVolumeAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateBareMetalServerNetworkInterfaceWOptions(); + testCreateInstanceVolumeAttachmentWOptions(); vpcService.disableRetries(); - testCreateBareMetalServerNetworkInterfaceWOptions(); + testCreateInstanceVolumeAttachmentWOptions(); } - // Test the createBareMetalServerNetworkInterface operation with a null options model (negative test) + // Test the createInstanceVolumeAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateBareMetalServerNetworkInterfaceNoOptions() throws Throwable { + public void testCreateInstanceVolumeAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createBareMetalServerNetworkInterface(null).execute(); + vpcService.createInstanceVolumeAttachment(null).execute(); } - // Test the deleteBareMetalServerNetworkInterface operation with a valid options model parameter + // Test the deleteInstanceVolumeAttachment operation with a valid options model parameter @Test - public void testDeleteBareMetalServerNetworkInterfaceWOptions() throws Throwable { + public void testDeleteInstanceVolumeAttachmentWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces/testString"; + String deleteInstanceVolumeAttachmentPath = "/instances/testString/volume_attachments/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteBareMetalServerNetworkInterfaceOptions model - DeleteBareMetalServerNetworkInterfaceOptions deleteBareMetalServerNetworkInterfaceOptionsModel = new DeleteBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the DeleteInstanceVolumeAttachmentOptions model + DeleteInstanceVolumeAttachmentOptions deleteInstanceVolumeAttachmentOptionsModel = new DeleteInstanceVolumeAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); - // Invoke deleteBareMetalServerNetworkInterface() with a valid options model and verify the result - Response response = vpcService.deleteBareMetalServerNetworkInterface(deleteBareMetalServerNetworkInterfaceOptionsModel).execute(); + // Invoke deleteInstanceVolumeAttachment() with a valid options model and verify the result + Response response = vpcService.deleteInstanceVolumeAttachment(deleteInstanceVolumeAttachmentOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -15082,52 +16253,52 @@ public void testDeleteBareMetalServerNetworkInterfaceWOptions() throws Throwable assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteBareMetalServerNetworkInterfacePath); + assertEquals(parsedPath, deleteInstanceVolumeAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteBareMetalServerNetworkInterface operation with and without retries enabled + // Test the deleteInstanceVolumeAttachment operation with and without retries enabled @Test - public void testDeleteBareMetalServerNetworkInterfaceWRetries() throws Throwable { + public void testDeleteInstanceVolumeAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteBareMetalServerNetworkInterfaceWOptions(); + testDeleteInstanceVolumeAttachmentWOptions(); vpcService.disableRetries(); - testDeleteBareMetalServerNetworkInterfaceWOptions(); + testDeleteInstanceVolumeAttachmentWOptions(); } - // Test the deleteBareMetalServerNetworkInterface operation with a null options model (negative test) + // Test the deleteInstanceVolumeAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteBareMetalServerNetworkInterfaceNoOptions() throws Throwable { + public void testDeleteInstanceVolumeAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteBareMetalServerNetworkInterface(null).execute(); + vpcService.deleteInstanceVolumeAttachment(null).execute(); } - // Test the getBareMetalServerNetworkInterface operation with a valid options model parameter + // Test the getInstanceVolumeAttachment operation with a valid options model parameter @Test - public void testGetBareMetalServerNetworkInterfaceWOptions() throws Throwable { + public void testGetInstanceVolumeAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"mac_address\": \"02:00:04:00:C4:6A\", \"name\": \"my-bare-metal-server-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; - String getBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces/testString"; + String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}"; + String getInstanceVolumeAttachmentPath = "/instances/testString/volume_attachments/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBareMetalServerNetworkInterfaceOptions model - GetBareMetalServerNetworkInterfaceOptions getBareMetalServerNetworkInterfaceOptionsModel = new GetBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the GetInstanceVolumeAttachmentOptions model + GetInstanceVolumeAttachmentOptions getInstanceVolumeAttachmentOptionsModel = new GetInstanceVolumeAttachmentOptions.Builder() + .instanceId("testString") .id("testString") .build(); - // Invoke getBareMetalServerNetworkInterface() with a valid options model and verify the result - Response response = vpcService.getBareMetalServerNetworkInterface(getBareMetalServerNetworkInterfaceOptionsModel).execute(); + // Invoke getInstanceVolumeAttachment() with a valid options model and verify the result + Response response = vpcService.getInstanceVolumeAttachment(getInstanceVolumeAttachmentOptionsModel).execute(); assertNotNull(response); - BareMetalServerNetworkInterface responseObj = response.getResult(); + VolumeAttachment responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -15136,62 +16307,60 @@ public void testGetBareMetalServerNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerNetworkInterfacePath); + assertEquals(parsedPath, getInstanceVolumeAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBareMetalServerNetworkInterface operation with and without retries enabled + // Test the getInstanceVolumeAttachment operation with and without retries enabled @Test - public void testGetBareMetalServerNetworkInterfaceWRetries() throws Throwable { + public void testGetInstanceVolumeAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBareMetalServerNetworkInterfaceWOptions(); + testGetInstanceVolumeAttachmentWOptions(); vpcService.disableRetries(); - testGetBareMetalServerNetworkInterfaceWOptions(); + testGetInstanceVolumeAttachmentWOptions(); } - // Test the getBareMetalServerNetworkInterface operation with a null options model (negative test) + // Test the getInstanceVolumeAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerNetworkInterfaceNoOptions() throws Throwable { + public void testGetInstanceVolumeAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBareMetalServerNetworkInterface(null).execute(); + vpcService.getInstanceVolumeAttachment(null).execute(); } - // Test the updateBareMetalServerNetworkInterface operation with a valid options model parameter + // Test the updateInstanceVolumeAttachment operation with a valid options model parameter @Test - public void testUpdateBareMetalServerNetworkInterfaceWOptions() throws Throwable { + public void testUpdateInstanceVolumeAttachmentWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": true, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"mac_address\": \"02:00:04:00:C4:6A\", \"name\": \"my-bare-metal-server-network-interface\", \"port_speed\": 1000, \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"status\": \"available\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"type\": \"primary\", \"interface_type\": \"hipersocket\"}"; - String updateBareMetalServerNetworkInterfacePath = "/bare_metal_servers/testString/network_interfaces/testString"; + String mockResponseBody = "{\"bandwidth\": 250, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"delete_volume_on_instance_delete\": true, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"name\": \"my-volume-attachment\", \"status\": \"attached\", \"type\": \"boot\", \"volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"resource_type\": \"volume\"}}"; + String updateInstanceVolumeAttachmentPath = "/instances/testString/volume_attachments/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the BareMetalServerNetworkInterfacePatch model - BareMetalServerNetworkInterfacePatch bareMetalServerNetworkInterfacePatchModel = new BareMetalServerNetworkInterfacePatch.Builder() - .allowIpSpoofing(true) - .allowedVlans(java.util.Arrays.asList(Long.valueOf("4"))) - .enableInfrastructureNat(true) - .name("my-bare-metal-server-network-interface") + // Construct an instance of the VolumeAttachmentPatch model + VolumeAttachmentPatch volumeAttachmentPatchModel = new VolumeAttachmentPatch.Builder() + .deleteVolumeOnInstanceDelete(true) + .name("my-volume-attachment") .build(); - Map bareMetalServerNetworkInterfacePatchModelAsPatch = bareMetalServerNetworkInterfacePatchModel.asPatch(); + Map volumeAttachmentPatchModelAsPatch = volumeAttachmentPatchModel.asPatch(); - // Construct an instance of the UpdateBareMetalServerNetworkInterfaceOptions model - UpdateBareMetalServerNetworkInterfaceOptions updateBareMetalServerNetworkInterfaceOptionsModel = new UpdateBareMetalServerNetworkInterfaceOptions.Builder() - .bareMetalServerId("testString") + // Construct an instance of the UpdateInstanceVolumeAttachmentOptions model + UpdateInstanceVolumeAttachmentOptions updateInstanceVolumeAttachmentOptionsModel = new UpdateInstanceVolumeAttachmentOptions.Builder() + .instanceId("testString") .id("testString") - .bareMetalServerNetworkInterfacePatch(bareMetalServerNetworkInterfacePatchModelAsPatch) + .volumeAttachmentPatch(volumeAttachmentPatchModelAsPatch) .build(); - // Invoke updateBareMetalServerNetworkInterface() with a valid options model and verify the result - Response response = vpcService.updateBareMetalServerNetworkInterface(updateBareMetalServerNetworkInterfaceOptionsModel).execute(); + // Invoke updateInstanceVolumeAttachment() with a valid options model and verify the result + Response response = vpcService.updateInstanceVolumeAttachment(updateInstanceVolumeAttachmentOptionsModel).execute(); assertNotNull(response); - BareMetalServerNetworkInterface responseObj = response.getResult(); + VolumeAttachment responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -15200,52 +16369,53 @@ public void testUpdateBareMetalServerNetworkInterfaceWOptions() throws Throwable assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateBareMetalServerNetworkInterfacePath); + assertEquals(parsedPath, updateInstanceVolumeAttachmentPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateBareMetalServerNetworkInterface operation with and without retries enabled + // Test the updateInstanceVolumeAttachment operation with and without retries enabled @Test - public void testUpdateBareMetalServerNetworkInterfaceWRetries() throws Throwable { + public void testUpdateInstanceVolumeAttachmentWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateBareMetalServerNetworkInterfaceWOptions(); + testUpdateInstanceVolumeAttachmentWOptions(); vpcService.disableRetries(); - testUpdateBareMetalServerNetworkInterfaceWOptions(); + testUpdateInstanceVolumeAttachmentWOptions(); } - // Test the updateBareMetalServerNetworkInterface operation with a null options model (negative test) + // Test the updateInstanceVolumeAttachment operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateBareMetalServerNetworkInterfaceNoOptions() throws Throwable { + public void testUpdateInstanceVolumeAttachmentNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateBareMetalServerNetworkInterface(null).execute(); + vpcService.updateInstanceVolumeAttachment(null).execute(); } - // Test the listBareMetalServerNetworkInterfaceFloatingIps operation with a valid options model parameter + // Test the listKeys operation with a valid options model parameter @Test - public void testListBareMetalServerNetworkInterfaceFloatingIpsWOptions() throws Throwable { + public void testListKeysWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"floating_ips\": [{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; - String listBareMetalServerNetworkInterfaceFloatingIpsPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"keys\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"length\": 2048, \"name\": \"my-key-1\", \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"type\": \"ed25519\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listKeysPath = "/keys"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBareMetalServerNetworkInterfaceFloatingIpsOptions model - ListBareMetalServerNetworkInterfaceFloatingIpsOptions listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel = new ListBareMetalServerNetworkInterfaceFloatingIpsOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + // Construct an instance of the ListKeysOptions model + ListKeysOptions listKeysOptionsModel = new ListKeysOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); - // Invoke listBareMetalServerNetworkInterfaceFloatingIps() with a valid options model and verify the result - Response response = vpcService.listBareMetalServerNetworkInterfaceFloatingIps(listBareMetalServerNetworkInterfaceFloatingIpsOptionsModel).execute(); + // Invoke listKeys() with a valid options model and verify the result + Response response = vpcService.listKeys(listKeysOptionsModel).execute(); assertNotNull(response); - FloatingIPUnpaginatedCollection responseObj = response.getResult(); + KeyCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -15254,50 +16424,169 @@ public void testListBareMetalServerNetworkInterfaceFloatingIpsWOptions() throws assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBareMetalServerNetworkInterfaceFloatingIpsPath); + assertEquals(parsedPath, listKeysPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); } - // Test the listBareMetalServerNetworkInterfaceFloatingIps operation with and without retries enabled + // Test the listKeys operation with and without retries enabled @Test - public void testListBareMetalServerNetworkInterfaceFloatingIpsWRetries() throws Throwable { + public void testListKeysWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBareMetalServerNetworkInterfaceFloatingIpsWOptions(); + testListKeysWOptions(); vpcService.disableRetries(); - testListBareMetalServerNetworkInterfaceFloatingIpsWOptions(); + testListKeysWOptions(); } - // Test the listBareMetalServerNetworkInterfaceFloatingIps operation with a null options model (negative test) + // Test the listKeys operation using the KeysPager.getNext() method + @Test + public void testListKeysWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"id\":\"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"length\":2048,\"name\":\"my-key-1\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"ed25519\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"id\":\"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"length\":2048,\"name\":\"my-key-1\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"ed25519\"}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + List allResults = new ArrayList<>(); + KeysPager pager = new KeysPager(vpcService, listKeysOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listKeys operation using the KeysPager.getAll() method + @Test + public void testListKeysWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"id\":\"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"length\":2048,\"name\":\"my-key-1\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"ed25519\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"keys\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"fingerprint\":\"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"id\":\"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\",\"length\":2048,\"name\":\"my-key-1\",\"public_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"type\":\"ed25519\"}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListKeysOptions listKeysOptions = new ListKeysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); + + KeysPager pager = new KeysPager(vpcService, listKeysOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createKey operation with a valid options model parameter + @Test + public void testCreateKeyWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"length\": 2048, \"name\": \"my-key-1\", \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"type\": \"ed25519\"}"; + String createKeyPath = "/keys"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the CreateKeyOptions model + CreateKeyOptions createKeyOptionsModel = new CreateKeyOptions.Builder() + .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En") + .name("my-key-1") + .resourceGroup(resourceGroupIdentityModel) + .type("rsa") + .build(); + + // Invoke createKey() with a valid options model and verify the result + Response response = vpcService.createKey(createKeyOptionsModel).execute(); + assertNotNull(response); + Key responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createKeyPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createKey operation with and without retries enabled + @Test + public void testCreateKeyWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateKeyWOptions(); + + vpcService.disableRetries(); + testCreateKeyWOptions(); + } + + // Test the createKey operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListBareMetalServerNetworkInterfaceFloatingIpsNoOptions() throws Throwable { + public void testCreateKeyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listBareMetalServerNetworkInterfaceFloatingIps(null).execute(); + vpcService.createKey(null).execute(); } - // Test the removeBareMetalServerNetworkInterfaceFloatingIp operation with a valid options model parameter + // Test the deleteKey operation with a valid options model parameter @Test - public void testRemoveBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Throwable { + public void testDeleteKeyWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String removeBareMetalServerNetworkInterfaceFloatingIpPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"; + String deleteKeyPath = "/keys/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the RemoveBareMetalServerNetworkInterfaceFloatingIpOptions model - RemoveBareMetalServerNetworkInterfaceFloatingIpOptions removeBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new RemoveBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + // Construct an instance of the DeleteKeyOptions model + DeleteKeyOptions deleteKeyOptionsModel = new DeleteKeyOptions.Builder() .id("testString") .build(); - // Invoke removeBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.removeBareMetalServerNetworkInterfaceFloatingIp(removeBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke deleteKey() with a valid options model and verify the result + Response response = vpcService.deleteKey(deleteKeyOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -15308,53 +16597,51 @@ public void testRemoveBareMetalServerNetworkInterfaceFloatingIpWOptions() throws assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, removeBareMetalServerNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, deleteKeyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the removeBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the deleteKey operation with and without retries enabled @Test - public void testRemoveBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testDeleteKeyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testRemoveBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testDeleteKeyWOptions(); vpcService.disableRetries(); - testRemoveBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testDeleteKeyWOptions(); } - // Test the removeBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the deleteKey operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testRemoveBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testDeleteKeyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.removeBareMetalServerNetworkInterfaceFloatingIp(null).execute(); + vpcService.deleteKey(null).execute(); } - // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with a valid options model parameter + // Test the getKey operation with a valid options model parameter @Test - public void testGetBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Throwable { + public void testGetKeyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getBareMetalServerNetworkInterfaceFloatingIpPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"length\": 2048, \"name\": \"my-key-1\", \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"type\": \"ed25519\"}"; + String getKeyPath = "/keys/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBareMetalServerNetworkInterfaceFloatingIpOptions model - GetBareMetalServerNetworkInterfaceFloatingIpOptions getBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new GetBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + // Construct an instance of the GetKeyOptions model + GetKeyOptions getKeyOptionsModel = new GetKeyOptions.Builder() .id("testString") .build(); - // Invoke getBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.getBareMetalServerNetworkInterfaceFloatingIp(getBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke getKey() with a valid options model and verify the result + Response response = vpcService.getKey(getKeyOptionsModel).execute(); assertNotNull(response); - FloatingIP responseObj = response.getResult(); + Key responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -15363,107 +16650,112 @@ public void testGetBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Th assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, getKeyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the getKey operation with and without retries enabled @Test - public void testGetBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testGetKeyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testGetKeyWOptions(); vpcService.disableRetries(); - testGetBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testGetKeyWOptions(); } - // Test the getBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the getKey operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testGetKeyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBareMetalServerNetworkInterfaceFloatingIp(null).execute(); + vpcService.getKey(null).execute(); } - // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with a valid options model parameter + // Test the updateKey operation with a valid options model parameter @Test - public void testAddBareMetalServerNetworkInterfaceFloatingIpWOptions() throws Throwable { + public void testUpdateKeyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String addBareMetalServerNetworkInterfaceFloatingIpPath = "/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"length\": 2048, \"name\": \"my-key-1\", \"public_key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"type\": \"ed25519\"}"; + String updateKeyPath = "/keys/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the AddBareMetalServerNetworkInterfaceFloatingIpOptions model - AddBareMetalServerNetworkInterfaceFloatingIpOptions addBareMetalServerNetworkInterfaceFloatingIpOptionsModel = new AddBareMetalServerNetworkInterfaceFloatingIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + // Construct an instance of the KeyPatch model + KeyPatch keyPatchModel = new KeyPatch.Builder() + .name("my-key-1") + .build(); + Map keyPatchModelAsPatch = keyPatchModel.asPatch(); + + // Construct an instance of the UpdateKeyOptions model + UpdateKeyOptions updateKeyOptionsModel = new UpdateKeyOptions.Builder() .id("testString") + .keyPatch(keyPatchModelAsPatch) .build(); - // Invoke addBareMetalServerNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.addBareMetalServerNetworkInterfaceFloatingIp(addBareMetalServerNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke updateKey() with a valid options model and verify the result + Response response = vpcService.updateKey(updateKeyOptionsModel).execute(); assertNotNull(response); - FloatingIP responseObj = response.getResult(); + Key responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addBareMetalServerNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, updateKeyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the updateKey operation with and without retries enabled @Test - public void testAddBareMetalServerNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testUpdateKeyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testAddBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testUpdateKeyWOptions(); vpcService.disableRetries(); - testAddBareMetalServerNetworkInterfaceFloatingIpWOptions(); + testUpdateKeyWOptions(); } - // Test the addBareMetalServerNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the updateKey operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddBareMetalServerNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testUpdateKeyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.addBareMetalServerNetworkInterfaceFloatingIp(null).execute(); + vpcService.updateKey(null).execute(); } - // Test the listBareMetalServerNetworkInterfaceIps operation with a valid options model parameter + // Test the listLoadBalancerProfiles operation with a valid options model parameter @Test - public void testListBareMetalServerNetworkInterfaceIpsWOptions() throws Throwable { + public void testListLoadBalancerProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listBareMetalServerNetworkInterfaceIpsPath = "/bare_metal_servers/testString/network_interfaces/testString/ips"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"access_modes\": {\"type\": \"enum\", \"values\": [\"private\"]}, \"availability\": {\"type\": \"fixed\", \"value\": \"region\"}, \"failsafe_policy_actions\": {\"default\": \"fail\", \"type\": \"enum\", \"values\": [\"forward\"]}, \"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"instance_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"logging_supported\": {\"type\": \"fixed\", \"value\": [\"datapath\"]}, \"name\": \"network-fixed\", \"route_mode_supported\": {\"type\": \"fixed\", \"value\": true}, \"security_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"source_ip_session_persistence_supported\": {\"type\": \"fixed\", \"value\": true}, \"targetable_load_balancer_profiles\": [{\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}], \"targetable_resource_types\": {\"type\": \"enum\", \"values\": [\"instance\"]}, \"udp_supported\": {\"type\": \"fixed\", \"value\": true}}], \"total_count\": 132}"; + String listLoadBalancerProfilesPath = "/load_balancer/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBareMetalServerNetworkInterfaceIpsOptions model - ListBareMetalServerNetworkInterfaceIpsOptions listBareMetalServerNetworkInterfaceIpsOptionsModel = new ListBareMetalServerNetworkInterfaceIpsOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") + // Construct an instance of the ListLoadBalancerProfilesOptions model + ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptionsModel = new ListLoadBalancerProfilesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke listBareMetalServerNetworkInterfaceIps() with a valid options model and verify the result - Response response = vpcService.listBareMetalServerNetworkInterfaceIps(listBareMetalServerNetworkInterfaceIpsOptionsModel).execute(); + // Invoke listLoadBalancerProfiles() with a valid options model and verify the result + Response response = vpcService.listLoadBalancerProfiles(listLoadBalancerProfilesOptionsModel).execute(); assertNotNull(response); - ReservedIPCollectionBareMetalServerNetworkInterfaceContext responseObj = response.getResult(); + LoadBalancerProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -15472,53 +16764,108 @@ public void testListBareMetalServerNetworkInterfaceIpsWOptions() throws Throwabl assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBareMetalServerNetworkInterfaceIpsPath); + assertEquals(parsedPath, listLoadBalancerProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listBareMetalServerNetworkInterfaceIps operation with and without retries enabled + // Test the listLoadBalancerProfiles operation with and without retries enabled @Test - public void testListBareMetalServerNetworkInterfaceIpsWRetries() throws Throwable { + public void testListLoadBalancerProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBareMetalServerNetworkInterfaceIpsWOptions(); + testListLoadBalancerProfilesWOptions(); vpcService.disableRetries(); - testListBareMetalServerNetworkInterfaceIpsWOptions(); + testListLoadBalancerProfilesWOptions(); } - // Test the listBareMetalServerNetworkInterfaceIps operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListBareMetalServerNetworkInterfaceIpsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listBareMetalServerNetworkInterfaceIps(null).execute(); + // Test the listLoadBalancerProfiles operation using the LoadBalancerProfilesPager.getNext() method + @Test + public void testListLoadBalancerProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"access_modes\":{\"type\":\"enum\",\"values\":[\"private\"]},\"availability\":{\"type\":\"fixed\",\"value\":\"region\"},\"failsafe_policy_actions\":{\"default\":\"fail\",\"type\":\"enum\",\"values\":[\"forward\"]},\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"instance_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"source_ip_session_persistence_supported\":{\"type\":\"fixed\",\"value\":true},\"targetable_load_balancer_profiles\":[{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"}],\"targetable_resource_types\":{\"type\":\"enum\",\"values\":[\"instance\"]},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"access_modes\":{\"type\":\"enum\",\"values\":[\"private\"]},\"availability\":{\"type\":\"fixed\",\"value\":\"region\"},\"failsafe_policy_actions\":{\"default\":\"fail\",\"type\":\"enum\",\"values\":[\"forward\"]},\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"instance_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"source_ip_session_persistence_supported\":{\"type\":\"fixed\",\"value\":true},\"targetable_load_balancer_profiles\":[{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"}],\"targetable_resource_types\":{\"type\":\"enum\",\"values\":[\"instance\"]},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(vpcService, listLoadBalancerProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listLoadBalancerProfiles operation using the LoadBalancerProfilesPager.getAll() method + @Test + public void testListLoadBalancerProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"access_modes\":{\"type\":\"enum\",\"values\":[\"private\"]},\"availability\":{\"type\":\"fixed\",\"value\":\"region\"},\"failsafe_policy_actions\":{\"default\":\"fail\",\"type\":\"enum\",\"values\":[\"forward\"]},\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"instance_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"source_ip_session_persistence_supported\":{\"type\":\"fixed\",\"value\":true},\"targetable_load_balancer_profiles\":[{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"}],\"targetable_resource_types\":{\"type\":\"enum\",\"values\":[\"instance\"]},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"access_modes\":{\"type\":\"enum\",\"values\":[\"private\"]},\"availability\":{\"type\":\"fixed\",\"value\":\"region\"},\"failsafe_policy_actions\":{\"default\":\"fail\",\"type\":\"enum\",\"values\":[\"forward\"]},\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"instance_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"source_ip_session_persistence_supported\":{\"type\":\"fixed\",\"value\":true},\"targetable_load_balancer_profiles\":[{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"}],\"targetable_resource_types\":{\"type\":\"enum\",\"values\":[\"instance\"]},\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(vpcService, listLoadBalancerProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the getBareMetalServerNetworkInterfaceIp operation with a valid options model parameter + + // Test the getLoadBalancerProfile operation with a valid options model parameter @Test - public void testGetBareMetalServerNetworkInterfaceIpWOptions() throws Throwable { + public void testGetLoadBalancerProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; - String getBareMetalServerNetworkInterfaceIpPath = "/bare_metal_servers/testString/network_interfaces/testString/ips/testString"; + String mockResponseBody = "{\"access_modes\": {\"type\": \"enum\", \"values\": [\"private\"]}, \"availability\": {\"type\": \"fixed\", \"value\": \"region\"}, \"failsafe_policy_actions\": {\"default\": \"fail\", \"type\": \"enum\", \"values\": [\"forward\"]}, \"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"instance_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"logging_supported\": {\"type\": \"fixed\", \"value\": [\"datapath\"]}, \"name\": \"network-fixed\", \"route_mode_supported\": {\"type\": \"fixed\", \"value\": true}, \"security_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"source_ip_session_persistence_supported\": {\"type\": \"fixed\", \"value\": true}, \"targetable_load_balancer_profiles\": [{\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}], \"targetable_resource_types\": {\"type\": \"enum\", \"values\": [\"instance\"]}, \"udp_supported\": {\"type\": \"fixed\", \"value\": true}}"; + String getLoadBalancerProfilePath = "/load_balancer/profiles/network-fixed"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBareMetalServerNetworkInterfaceIpOptions model - GetBareMetalServerNetworkInterfaceIpOptions getBareMetalServerNetworkInterfaceIpOptionsModel = new GetBareMetalServerNetworkInterfaceIpOptions.Builder() - .bareMetalServerId("testString") - .networkInterfaceId("testString") - .id("testString") + // Construct an instance of the GetLoadBalancerProfileOptions model + GetLoadBalancerProfileOptions getLoadBalancerProfileOptionsModel = new GetLoadBalancerProfileOptions.Builder() + .name("network-fixed") .build(); - // Invoke getBareMetalServerNetworkInterfaceIp() with a valid options model and verify the result - Response response = vpcService.getBareMetalServerNetworkInterfaceIp(getBareMetalServerNetworkInterfaceIpOptionsModel).execute(); + // Invoke getLoadBalancerProfile() with a valid options model and verify the result + Response response = vpcService.getLoadBalancerProfile(getLoadBalancerProfileOptionsModel).execute(); assertNotNull(response); - ReservedIP responseObj = response.getResult(); + LoadBalancerProfile responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -15527,234 +16874,344 @@ public void testGetBareMetalServerNetworkInterfaceIpWOptions() throws Throwable assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerNetworkInterfaceIpPath); + assertEquals(parsedPath, getLoadBalancerProfilePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBareMetalServerNetworkInterfaceIp operation with and without retries enabled + // Test the getLoadBalancerProfile operation with and without retries enabled @Test - public void testGetBareMetalServerNetworkInterfaceIpWRetries() throws Throwable { + public void testGetLoadBalancerProfileWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBareMetalServerNetworkInterfaceIpWOptions(); + testGetLoadBalancerProfileWOptions(); vpcService.disableRetries(); - testGetBareMetalServerNetworkInterfaceIpWOptions(); + testGetLoadBalancerProfileWOptions(); } - // Test the getBareMetalServerNetworkInterfaceIp operation with a null options model (negative test) + // Test the getLoadBalancerProfile operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerNetworkInterfaceIpNoOptions() throws Throwable { + public void testGetLoadBalancerProfileNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBareMetalServerNetworkInterfaceIp(null).execute(); + vpcService.getLoadBalancerProfile(null).execute(); } - // Test the deleteBareMetalServer operation with a valid options model parameter + // Test the listLoadBalancers operation with a valid options model parameter @Test - public void testDeleteBareMetalServerWOptions() throws Throwable { + public void testListLoadBalancersWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteBareMetalServerPath = "/bare_metal_servers/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"load_balancers\": [{\"access_mode\": \"private\", \"attached_load_balancer_pool_members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"availability\": \"region\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"failsafe_policy_actions\": [\"forward\"], \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": true, \"is_private_path\": true, \"is_public\": true, \"listeners\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}], \"logging\": {\"datapath\": {\"active\": true}}, \"name\": \"my-load-balancer\", \"operating_status\": \"offline\", \"pools\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}], \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}, \"provisioning_status\": \"active\", \"public_ips\": [{\"address\": \"192.168.3.4\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"load_balancer\", \"route_mode\": true, \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"source_ip_session_persistence_supported\": true, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listLoadBalancersPath = "/load_balancers"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteBareMetalServerOptions model - DeleteBareMetalServerOptions deleteBareMetalServerOptionsModel = new DeleteBareMetalServerOptions.Builder() - .id("testString") + // Construct an instance of the ListLoadBalancersOptions model + ListLoadBalancersOptions listLoadBalancersOptionsModel = new ListLoadBalancersOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke deleteBareMetalServer() with a valid options model and verify the result - Response response = vpcService.deleteBareMetalServer(deleteBareMetalServerOptionsModel).execute(); + // Invoke listLoadBalancers() with a valid options model and verify the result + Response response = vpcService.listLoadBalancers(listLoadBalancersOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + LoadBalancerCollection responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteBareMetalServerPath); + assertEquals(parsedPath, listLoadBalancersPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the deleteBareMetalServer operation with and without retries enabled + // Test the listLoadBalancers operation with and without retries enabled @Test - public void testDeleteBareMetalServerWRetries() throws Throwable { + public void testListLoadBalancersWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteBareMetalServerWOptions(); + testListLoadBalancersWOptions(); vpcService.disableRetries(); - testDeleteBareMetalServerWOptions(); - } - - // Test the deleteBareMetalServer operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteBareMetalServerNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.deleteBareMetalServer(null).execute(); + testListLoadBalancersWOptions(); } - // Test the getBareMetalServer operation with a valid options model parameter + // Test the listLoadBalancers operation using the LoadBalancersPager.getNext() method @Test - public void testGetBareMetalServerWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"firmware\": {\"update\": \"none\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"id\": \"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"disabled\", \"supported_modes\": [\"disabled\"]}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getBareMetalServerPath = "/bare_metal_servers/testString"; + public void testListLoadBalancersWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"access_mode\":\"private\",\"attached_load_balancer_pool_members\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\",\"id\":\"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}],\"availability\":\"region\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"failsafe_policy_actions\":[\"forward\"],\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":true,\"is_private_path\":true,\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\",\"id\":\"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"source_ip_session_persistence_supported\":true,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"access_mode\":\"private\",\"attached_load_balancer_pool_members\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\",\"id\":\"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}],\"availability\":\"region\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"failsafe_policy_actions\":[\"forward\"],\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":true,\"is_private_path\":true,\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\",\"id\":\"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"source_ip_session_persistence_supported\":true,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the GetBareMetalServerOptions model - GetBareMetalServerOptions getBareMetalServerOptionsModel = new GetBareMetalServerOptions.Builder() - .id("testString") + ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() + .limit(Long.valueOf("10")) .build(); - // Invoke getBareMetalServer() with a valid options model and verify the result - Response response = vpcService.getBareMetalServer(getBareMetalServerOptionsModel).execute(); - assertNotNull(response); - BareMetalServer responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + List allResults = new ArrayList<>(); + LoadBalancersPager pager = new LoadBalancersPager(vpcService, listLoadBalancersOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } - - // Test the getBareMetalServer operation with and without retries enabled + + // Test the listLoadBalancers operation using the LoadBalancersPager.getAll() method @Test - public void testGetBareMetalServerWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetBareMetalServerWOptions(); + public void testListLoadBalancersWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"access_mode\":\"private\",\"attached_load_balancer_pool_members\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\",\"id\":\"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}],\"availability\":\"region\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"failsafe_policy_actions\":[\"forward\"],\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":true,\"is_private_path\":true,\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\",\"id\":\"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"source_ip_session_persistence_supported\":true,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"access_mode\":\"private\",\"attached_load_balancer_pool_members\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\",\"id\":\"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}],\"availability\":\"region\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"failsafe_policy_actions\":[\"forward\"],\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":true,\"is_private_path\":true,\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\",\"id\":\"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"source_ip_session_persistence_supported\":true,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testGetBareMetalServerWOptions(); - } + ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() + .limit(Long.valueOf("10")) + .build(); - // Test the getBareMetalServer operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getBareMetalServer(null).execute(); + LoadBalancersPager pager = new LoadBalancersPager(vpcService, listLoadBalancersOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the updateBareMetalServer operation with a valid options model parameter + + // Test the createLoadBalancer operation with a valid options model parameter @Test - public void testUpdateBareMetalServerWOptions() throws Throwable { + public void testCreateLoadBalancerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"bandwidth\": 20000, \"boot_target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\"}, \"cpu\": {\"architecture\": \"amd64\", \"core_count\": 80, \"socket_count\": 4, \"threads_per_core\": 2}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::bare-metal-server:0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"disks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/disks/0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"id\": \"0717-3744f199-6ccc-4698-8772-bb3937348c96\", \"interface_type\": \"fcp\", \"name\": \"my-bare-metal-server-disk\", \"resource_type\": \"bare_metal_server_disk\", \"size\": 100}], \"enable_secure_boot\": false, \"firmware\": {\"update\": \"none\"}, \"health_reasons\": [{\"code\": \"reservation_expired\", \"message\": \"The reservation cannot be used because it has expired.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-server-health-status-reasons\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"id\": \"0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"memory\": 1536, \"name\": \"my-bare-metal-server\", \"network_attachments\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}], \"network_interfaces\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}], \"primary_network_attachment\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_attachments/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-attachment\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"bare_metal_server_network_attachment\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}}, \"primary_network_interface\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768\", \"name\": \"bx2-metal-192x768\", \"resource_type\": \"bare_metal_server_profile\"}, \"reservation\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}, \"reservation_affinity\": {\"policy\": \"automatic\", \"pool\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"name\": \"my-reservation\", \"resource_type\": \"reservation\"}]}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"bare_metal_server\", \"status\": \"deleting\", \"status_reasons\": [{\"code\": \"cannot_start_capacity\", \"message\": \"The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.\", \"more_info\": \"https://console.bluemix.net/docs/iaas/bare_metal_server.html\"}], \"trusted_platform_module\": {\"enabled\": true, \"mode\": \"disabled\", \"supported_modes\": [\"disabled\"]}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateBareMetalServerPath = "/bare_metal_servers/testString"; + String mockResponseBody = "{\"access_mode\": \"private\", \"attached_load_balancer_pool_members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"availability\": \"region\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"failsafe_policy_actions\": [\"forward\"], \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": true, \"is_private_path\": true, \"is_public\": true, \"listeners\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}], \"logging\": {\"datapath\": {\"active\": true}}, \"name\": \"my-load-balancer\", \"operating_status\": \"offline\", \"pools\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}], \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}, \"provisioning_status\": \"active\", \"public_ips\": [{\"address\": \"192.168.3.4\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"load_balancer\", \"route_mode\": true, \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"source_ip_session_persistence_supported\": true, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; + String createLoadBalancerPath = "/load_balancers"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ReservationIdentityById model - ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() - .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - // Construct an instance of the BareMetalServerReservationAffinityPatch model - BareMetalServerReservationAffinityPatch bareMetalServerReservationAffinityPatchModel = new BareMetalServerReservationAffinityPatch.Builder() - .policy("automatic") - .pool(java.util.Arrays.asList(reservationIdentityModel)) + // Construct an instance of the DNSInstanceIdentityByCRN model + DNSInstanceIdentityByCRN dnsInstanceIdentityModel = new DNSInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::") .build(); - // Construct an instance of the BareMetalServerTrustedPlatformModulePatch model - BareMetalServerTrustedPlatformModulePatch bareMetalServerTrustedPlatformModulePatchModel = new BareMetalServerTrustedPlatformModulePatch.Builder() - .mode("disabled") + // Construct an instance of the DNSZoneIdentityById model + DNSZoneIdentityById dnsZoneIdentityModel = new DNSZoneIdentityById.Builder() + .id("d66662cc-aa23-4fe1-9987-858487a61f45") .build(); - // Construct an instance of the BareMetalServerPatch model - BareMetalServerPatch bareMetalServerPatchModel = new BareMetalServerPatch.Builder() - .bandwidth(Long.valueOf("20000")) - .enableSecureBoot(false) - .name("my-bare-metal-server") - .reservationAffinity(bareMetalServerReservationAffinityPatchModel) - .trustedPlatformModule(bareMetalServerTrustedPlatformModulePatchModel) + // Construct an instance of the LoadBalancerDNSPrototype model + LoadBalancerDNSPrototype loadBalancerDnsPrototypeModel = new LoadBalancerDNSPrototype.Builder() + .instance(dnsInstanceIdentityModel) + .zone(dnsZoneIdentityModel) .build(); - Map bareMetalServerPatchModelAsPatch = bareMetalServerPatchModel.asPatch(); - // Construct an instance of the UpdateBareMetalServerOptions model - UpdateBareMetalServerOptions updateBareMetalServerOptionsModel = new UpdateBareMetalServerOptions.Builder() - .id("testString") - .bareMetalServerPatch(bareMetalServerPatchModelAsPatch) + // Construct an instance of the CertificateInstanceIdentityByCRN model + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") .build(); - // Invoke updateBareMetalServer() with a valid options model and verify the result - Response response = vpcService.updateBareMetalServer(updateBareMetalServerOptionsModel).execute(); + // Construct an instance of the LoadBalancerPoolIdentityByName model + LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByNameModel = new LoadBalancerPoolIdentityByName.Builder() + .name("my-load-balancer-pool") + .build(); + + // Construct an instance of the LoadBalancerListenerIdentityById model + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") + .build(); + + // Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model + LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); + + // Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model + LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModel = new LoadBalancerListenerPrototypeLoadBalancerContext.Builder() + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerPoolIdentityByNameModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) + .idleConnectionTimeout(Long.valueOf("100")) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .protocol("http") + .build(); + + // Construct an instance of the LoadBalancerLoggingDatapathPrototype model + LoadBalancerLoggingDatapathPrototype loadBalancerLoggingDatapathPrototypeModel = new LoadBalancerLoggingDatapathPrototype.Builder() + .active(true) + .build(); + + // Construct an instance of the LoadBalancerLoggingPrototype model + LoadBalancerLoggingPrototype loadBalancerLoggingPrototypeModel = new LoadBalancerLoggingPrototype.Builder() + .datapath(loadBalancerLoggingDatapathPrototypeModel) + .build(); + + // Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model + LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype.Builder() + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("tcp") + .build(); + + // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") + .build(); + + // Construct an instance of the LoadBalancerPoolMemberPrototype model + LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); + + // Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model + LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() + .cookieName("my-cookie-name") + .type("app_cookie") + .build(); + + // Construct an instance of the LoadBalancerPoolPrototypeLoadBalancerContext model + LoadBalancerPoolPrototypeLoadBalancerContext loadBalancerPoolPrototypeLoadBalancerContextModel = new LoadBalancerPoolPrototypeLoadBalancerContext.Builder() + .algorithm("least_connections") + .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + .name("my-load-balancer-pool") + .protocol("http") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + .build(); + + // Construct an instance of the LoadBalancerProfileIdentityByName model + LoadBalancerProfileIdentityByName loadBalancerProfileIdentityModel = new LoadBalancerProfileIdentityByName.Builder() + .name("network-fixed") + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the CreateLoadBalancerOptions model + CreateLoadBalancerOptions createLoadBalancerOptionsModel = new CreateLoadBalancerOptions.Builder() + .isPublic(true) + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .dns(loadBalancerDnsPrototypeModel) + .isPrivatePath(true) + .listeners(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel)) + .logging(loadBalancerLoggingPrototypeModel) + .name("my-load-balancer") + .pools(java.util.Arrays.asList(loadBalancerPoolPrototypeLoadBalancerContextModel)) + .profile(loadBalancerProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .routeMode(true) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .build(); + + // Invoke createLoadBalancer() with a valid options model and verify the result + Response response = vpcService.createLoadBalancer(createLoadBalancerOptionsModel).execute(); assertNotNull(response); - BareMetalServer responseObj = response.getResult(); + LoadBalancer responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateBareMetalServerPath); + assertEquals(parsedPath, createLoadBalancerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateBareMetalServer operation with and without retries enabled + // Test the createLoadBalancer operation with and without retries enabled @Test - public void testUpdateBareMetalServerWRetries() throws Throwable { + public void testCreateLoadBalancerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateBareMetalServerWOptions(); + testCreateLoadBalancerWOptions(); vpcService.disableRetries(); - testUpdateBareMetalServerWOptions(); + testCreateLoadBalancerWOptions(); } - // Test the updateBareMetalServer operation with a null options model (negative test) + // Test the createLoadBalancer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateBareMetalServerNoOptions() throws Throwable { + public void testCreateLoadBalancerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateBareMetalServer(null).execute(); + vpcService.createLoadBalancer(null).execute(); } - // Test the updateFirmwareForBareMetalServer operation with a valid options model parameter + // Test the deleteLoadBalancer operation with a valid options model parameter @Test - public void testUpdateFirmwareForBareMetalServerWOptions() throws Throwable { + public void testDeleteLoadBalancerWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String updateFirmwareForBareMetalServerPath = "/bare_metal_servers/testString/firmware/update"; + String deleteLoadBalancerPath = "/load_balancers/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the UpdateFirmwareForBareMetalServerOptions model - UpdateFirmwareForBareMetalServerOptions updateFirmwareForBareMetalServerOptionsModel = new UpdateFirmwareForBareMetalServerOptions.Builder() + // Construct an instance of the DeleteLoadBalancerOptions model + DeleteLoadBalancerOptions deleteLoadBalancerOptionsModel = new DeleteLoadBalancerOptions.Builder() .id("testString") - .autoStart(true) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateFirmwareForBareMetalServer() with a valid options model and verify the result - Response response = vpcService.updateFirmwareForBareMetalServer(updateFirmwareForBareMetalServerOptionsModel).execute(); + // Invoke deleteLoadBalancer() with a valid options model and verify the result + Response response = vpcService.deleteLoadBalancer(deleteLoadBalancerOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -15762,54 +17219,54 @@ public void testUpdateFirmwareForBareMetalServerWOptions() throws Throwable { // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateFirmwareForBareMetalServerPath); + assertEquals(parsedPath, deleteLoadBalancerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateFirmwareForBareMetalServer operation with and without retries enabled + // Test the deleteLoadBalancer operation with and without retries enabled @Test - public void testUpdateFirmwareForBareMetalServerWRetries() throws Throwable { + public void testDeleteLoadBalancerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateFirmwareForBareMetalServerWOptions(); + testDeleteLoadBalancerWOptions(); vpcService.disableRetries(); - testUpdateFirmwareForBareMetalServerWOptions(); + testDeleteLoadBalancerWOptions(); } - // Test the updateFirmwareForBareMetalServer operation with a null options model (negative test) + // Test the deleteLoadBalancer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateFirmwareForBareMetalServerNoOptions() throws Throwable { + public void testDeleteLoadBalancerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateFirmwareForBareMetalServer(null).execute(); + vpcService.deleteLoadBalancer(null).execute(); } - // Test the getBareMetalServerInitialization operation with a valid options model parameter + // Test the getLoadBalancer operation with a valid options model parameter @Test - public void testGetBareMetalServerInitializationWOptions() throws Throwable { + public void testGetLoadBalancerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"keys\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}], \"user_accounts\": [{\"encrypted_password\": \"qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}, \"resource_type\": \"host_user_account\", \"username\": \"Administrator\"}]}"; - String getBareMetalServerInitializationPath = "/bare_metal_servers/testString/initialization"; + String mockResponseBody = "{\"access_mode\": \"private\", \"attached_load_balancer_pool_members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"availability\": \"region\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"failsafe_policy_actions\": [\"forward\"], \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": true, \"is_private_path\": true, \"is_public\": true, \"listeners\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}], \"logging\": {\"datapath\": {\"active\": true}}, \"name\": \"my-load-balancer\", \"operating_status\": \"offline\", \"pools\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}], \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}, \"provisioning_status\": \"active\", \"public_ips\": [{\"address\": \"192.168.3.4\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"load_balancer\", \"route_mode\": true, \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"source_ip_session_persistence_supported\": true, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; + String getLoadBalancerPath = "/load_balancers/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBareMetalServerInitializationOptions model - GetBareMetalServerInitializationOptions getBareMetalServerInitializationOptionsModel = new GetBareMetalServerInitializationOptions.Builder() + // Construct an instance of the GetLoadBalancerOptions model + GetLoadBalancerOptions getLoadBalancerOptionsModel = new GetLoadBalancerOptions.Builder() .id("testString") .build(); - // Invoke getBareMetalServerInitialization() with a valid options model and verify the result - Response response = vpcService.getBareMetalServerInitialization(getBareMetalServerInitializationOptionsModel).execute(); + // Invoke getLoadBalancer() with a valid options model and verify the result + Response response = vpcService.getLoadBalancer(getLoadBalancerOptionsModel).execute(); assertNotNull(response); - BareMetalServerInitialization responseObj = response.getResult(); + LoadBalancer responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -15818,446 +17275,414 @@ public void testGetBareMetalServerInitializationWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBareMetalServerInitializationPath); + assertEquals(parsedPath, getLoadBalancerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBareMetalServerInitialization operation with and without retries enabled + // Test the getLoadBalancer operation with and without retries enabled @Test - public void testGetBareMetalServerInitializationWRetries() throws Throwable { + public void testGetLoadBalancerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBareMetalServerInitializationWOptions(); + testGetLoadBalancerWOptions(); vpcService.disableRetries(); - testGetBareMetalServerInitializationWOptions(); + testGetLoadBalancerWOptions(); } - // Test the getBareMetalServerInitialization operation with a null options model (negative test) + // Test the getLoadBalancer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBareMetalServerInitializationNoOptions() throws Throwable { + public void testGetLoadBalancerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBareMetalServerInitialization(null).execute(); + vpcService.getLoadBalancer(null).execute(); } - // Test the replaceBareMetalServerInitialization operation with a valid options model parameter + // Test the updateLoadBalancer operation with a valid options model parameter @Test - public void testReplaceBareMetalServerInitializationWOptions() throws Throwable { + public void testUpdateLoadBalancerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"keys\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}], \"user_accounts\": [{\"encrypted_password\": \"qQ+/YEApnl1ZtEgIrfprzb065307thTkzlnLqL5ICpesdbBN03dyCQ==\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::key:r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"fingerprint\": \"SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/keys/r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"id\": \"r006-82679077-ac3b-4c10-be16-63e9c21f0f45\", \"name\": \"my-key-1\"}, \"resource_type\": \"host_user_account\", \"username\": \"Administrator\"}]}"; - String replaceBareMetalServerInitializationPath = "/bare_metal_servers/testString/initialization"; + String mockResponseBody = "{\"access_mode\": \"private\", \"attached_load_balancer_pool_members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"availability\": \"region\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"failsafe_policy_actions\": [\"forward\"], \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": true, \"is_private_path\": true, \"is_public\": true, \"listeners\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}], \"logging\": {\"datapath\": {\"active\": true}}, \"name\": \"my-load-balancer\", \"operating_status\": \"offline\", \"pools\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}], \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}, \"provisioning_status\": \"active\", \"public_ips\": [{\"address\": \"192.168.3.4\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"load_balancer\", \"route_mode\": true, \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"source_ip_session_persistence_supported\": true, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; + String updateLoadBalancerPath = "/load_balancers/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ImageIdentityById model - ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() - .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + // Construct an instance of the DNSInstanceIdentityByCRN model + DNSInstanceIdentityByCRN dnsInstanceIdentityModel = new DNSInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::") .build(); - // Construct an instance of the KeyIdentityById model - KeyIdentityById keyIdentityModel = new KeyIdentityById.Builder() - .id("r006-82679077-ac3b-4c10-be16-63e9c21f0f45") + // Construct an instance of the DNSZoneIdentityById model + DNSZoneIdentityById dnsZoneIdentityModel = new DNSZoneIdentityById.Builder() + .id("d66662cc-aa23-4fe1-9987-858487a61f45") .build(); - // Construct an instance of the ReplaceBareMetalServerInitializationOptions model - ReplaceBareMetalServerInitializationOptions replaceBareMetalServerInitializationOptionsModel = new ReplaceBareMetalServerInitializationOptions.Builder() - .id("testString") - .image(imageIdentityModel) - .keys(java.util.Arrays.asList(keyIdentityModel)) - .userData("testString") + // Construct an instance of the LoadBalancerDNSPatch model + LoadBalancerDNSPatch loadBalancerDnsPatchModel = new LoadBalancerDNSPatch.Builder() + .instance(dnsInstanceIdentityModel) + .zone(dnsZoneIdentityModel) .build(); - // Invoke replaceBareMetalServerInitialization() with a valid options model and verify the result - Response response = vpcService.replaceBareMetalServerInitialization(replaceBareMetalServerInitializationOptionsModel).execute(); - assertNotNull(response); - BareMetalServerInitialization responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, replaceBareMetalServerInitializationPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the replaceBareMetalServerInitialization operation with and without retries enabled - @Test - public void testReplaceBareMetalServerInitializationWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testReplaceBareMetalServerInitializationWOptions(); - - vpcService.disableRetries(); - testReplaceBareMetalServerInitializationWOptions(); - } + // Construct an instance of the LoadBalancerLoggingDatapathPatch model + LoadBalancerLoggingDatapathPatch loadBalancerLoggingDatapathPatchModel = new LoadBalancerLoggingDatapathPatch.Builder() + .active(true) + .build(); - // Test the replaceBareMetalServerInitialization operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testReplaceBareMetalServerInitializationNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.replaceBareMetalServerInitialization(null).execute(); - } + // Construct an instance of the LoadBalancerLoggingPatch model + LoadBalancerLoggingPatch loadBalancerLoggingPatchModel = new LoadBalancerLoggingPatch.Builder() + .datapath(loadBalancerLoggingDatapathPatchModel) + .build(); - // Test the restartBareMetalServer operation with a valid options model parameter - @Test - public void testRestartBareMetalServerWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String restartBareMetalServerPath = "/bare_metal_servers/testString/restart"; - server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); - // Construct an instance of the RestartBareMetalServerOptions model - RestartBareMetalServerOptions restartBareMetalServerOptionsModel = new RestartBareMetalServerOptions.Builder() + // Construct an instance of the LoadBalancerPatch model + LoadBalancerPatch loadBalancerPatchModel = new LoadBalancerPatch.Builder() + .dns(loadBalancerDnsPatchModel) + .logging(loadBalancerLoggingPatchModel) + .name("my-load-balancer") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .build(); + Map loadBalancerPatchModelAsPatch = loadBalancerPatchModel.asPatch(); + + // Construct an instance of the UpdateLoadBalancerOptions model + UpdateLoadBalancerOptions updateLoadBalancerOptionsModel = new UpdateLoadBalancerOptions.Builder() .id("testString") + .loadBalancerPatch(loadBalancerPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke restartBareMetalServer() with a valid options model and verify the result - Response response = vpcService.restartBareMetalServer(restartBareMetalServerOptionsModel).execute(); + // Invoke updateLoadBalancer() with a valid options model and verify the result + Response response = vpcService.updateLoadBalancer(updateLoadBalancerOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + LoadBalancer responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, restartBareMetalServerPath); + assertEquals(parsedPath, updateLoadBalancerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the restartBareMetalServer operation with and without retries enabled + // Test the updateLoadBalancer operation with and without retries enabled @Test - public void testRestartBareMetalServerWRetries() throws Throwable { + public void testUpdateLoadBalancerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testRestartBareMetalServerWOptions(); + testUpdateLoadBalancerWOptions(); vpcService.disableRetries(); - testRestartBareMetalServerWOptions(); + testUpdateLoadBalancerWOptions(); } - // Test the restartBareMetalServer operation with a null options model (negative test) + // Test the updateLoadBalancer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testRestartBareMetalServerNoOptions() throws Throwable { + public void testUpdateLoadBalancerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.restartBareMetalServer(null).execute(); + vpcService.updateLoadBalancer(null).execute(); } - // Test the startBareMetalServer operation with a valid options model parameter + // Test the getLoadBalancerStatistics operation with a valid options model parameter @Test - public void testStartBareMetalServerWOptions() throws Throwable { + public void testGetLoadBalancerStatisticsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String startBareMetalServerPath = "/bare_metal_servers/testString/start"; + String mockResponseBody = "{\"active_connections\": 797, \"connection_rate\": 91.121, \"data_processed_this_month\": 10093173145, \"throughput\": 167.278}"; + String getLoadBalancerStatisticsPath = "/load_balancers/testString/statistics"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the StartBareMetalServerOptions model - StartBareMetalServerOptions startBareMetalServerOptionsModel = new StartBareMetalServerOptions.Builder() + // Construct an instance of the GetLoadBalancerStatisticsOptions model + GetLoadBalancerStatisticsOptions getLoadBalancerStatisticsOptionsModel = new GetLoadBalancerStatisticsOptions.Builder() .id("testString") .build(); - // Invoke startBareMetalServer() with a valid options model and verify the result - Response response = vpcService.startBareMetalServer(startBareMetalServerOptionsModel).execute(); + // Invoke getLoadBalancerStatistics() with a valid options model and verify the result + Response response = vpcService.getLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + LoadBalancerStatistics responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, startBareMetalServerPath); + assertEquals(parsedPath, getLoadBalancerStatisticsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the startBareMetalServer operation with and without retries enabled + // Test the getLoadBalancerStatistics operation with and without retries enabled @Test - public void testStartBareMetalServerWRetries() throws Throwable { + public void testGetLoadBalancerStatisticsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testStartBareMetalServerWOptions(); + testGetLoadBalancerStatisticsWOptions(); vpcService.disableRetries(); - testStartBareMetalServerWOptions(); + testGetLoadBalancerStatisticsWOptions(); } - // Test the startBareMetalServer operation with a null options model (negative test) + // Test the getLoadBalancerStatistics operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testStartBareMetalServerNoOptions() throws Throwable { + public void testGetLoadBalancerStatisticsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.startBareMetalServer(null).execute(); + vpcService.getLoadBalancerStatistics(null).execute(); } - // Test the stopBareMetalServer operation with a valid options model parameter + // Test the listLoadBalancerListeners operation with a valid options model parameter @Test - public void testStopBareMetalServerWOptions() throws Throwable { + public void testListLoadBalancerListenersWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String stopBareMetalServerPath = "/bare_metal_servers/testString/stop"; + String mockResponseBody = "{\"listeners\": [{\"accept_proxy_protocol\": true, \"certificate_instance\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"connection_limit\": 2000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"default_pool\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"https_redirect\": {\"http_status_code\": 301, \"listener\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}, \"uri\": \"/example?doc=get\"}, \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"idle_connection_timeout\": 100, \"policies\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\"}], \"port\": 443, \"port_max\": 499, \"port_min\": 443, \"protocol\": \"http\", \"provisioning_status\": \"active\"}]}"; + String listLoadBalancerListenersPath = "/load_balancers/testString/listeners"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the StopBareMetalServerOptions model - StopBareMetalServerOptions stopBareMetalServerOptionsModel = new StopBareMetalServerOptions.Builder() - .id("testString") - .type("hard") + // Construct an instance of the ListLoadBalancerListenersOptions model + ListLoadBalancerListenersOptions listLoadBalancerListenersOptionsModel = new ListLoadBalancerListenersOptions.Builder() + .loadBalancerId("testString") .build(); - // Invoke stopBareMetalServer() with a valid options model and verify the result - Response response = vpcService.stopBareMetalServer(stopBareMetalServerOptionsModel).execute(); + // Invoke listLoadBalancerListeners() with a valid options model and verify the result + Response response = vpcService.listLoadBalancerListeners(listLoadBalancerListenersOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + LoadBalancerListenerCollection responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, stopBareMetalServerPath); + assertEquals(parsedPath, listLoadBalancerListenersPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the stopBareMetalServer operation with and without retries enabled + // Test the listLoadBalancerListeners operation with and without retries enabled @Test - public void testStopBareMetalServerWRetries() throws Throwable { + public void testListLoadBalancerListenersWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testStopBareMetalServerWOptions(); + testListLoadBalancerListenersWOptions(); vpcService.disableRetries(); - testStopBareMetalServerWOptions(); + testListLoadBalancerListenersWOptions(); } - // Test the stopBareMetalServer operation with a null options model (negative test) + // Test the listLoadBalancerListeners operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testStopBareMetalServerNoOptions() throws Throwable { + public void testListLoadBalancerListenersNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.stopBareMetalServer(null).execute(); + vpcService.listLoadBalancerListeners(null).execute(); } - // Test the listVolumeProfiles operation with a valid options model parameter + // Test the createLoadBalancerListener operation with a valid options model parameter @Test - public void testListVolumeProfilesWOptions() throws Throwable { + public void testCreateLoadBalancerListenerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"adjustable_capacity_states\": {\"type\": \"enum\", \"values\": [\"attached\"]}, \"adjustable_iops_states\": {\"type\": \"enum\", \"values\": [\"attached\"]}, \"bandwidth\": {\"type\": \"fixed\", \"value\": 4000}, \"boot_capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"family\": \"tiered\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"iops\": {\"type\": \"fixed\", \"value\": 4000}, \"name\": \"general-purpose\", \"storage_generation\": {\"type\": \"fixed\", \"value\": 1}}], \"total_count\": 132}"; - String listVolumeProfilesPath = "/volume/profiles"; + String mockResponseBody = "{\"accept_proxy_protocol\": true, \"certificate_instance\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"connection_limit\": 2000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"default_pool\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"https_redirect\": {\"http_status_code\": 301, \"listener\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}, \"uri\": \"/example?doc=get\"}, \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"idle_connection_timeout\": 100, \"policies\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\"}], \"port\": 443, \"port_max\": 499, \"port_min\": 443, \"protocol\": \"http\", \"provisioning_status\": \"active\"}"; + String createLoadBalancerListenerPath = "/load_balancers/testString/listeners"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ListVolumeProfilesOptions model - ListVolumeProfilesOptions listVolumeProfilesOptionsModel = new ListVolumeProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the CertificateInstanceIdentityByCRN model + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") .build(); - // Invoke listVolumeProfiles() with a valid options model and verify the result - Response response = vpcService.listVolumeProfiles(listVolumeProfilesOptionsModel).execute(); + // Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + // Construct an instance of the LoadBalancerListenerIdentityById model + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") + .build(); + + // Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model + LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") + .build(); + + // Construct an instance of the LoadBalancerListenerPolicyRulePrototype model + LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("testString") + .build(); + + // Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + // Construct an instance of the LoadBalancerListenerPolicyPrototype model + LoadBalancerListenerPolicyPrototype loadBalancerListenerPolicyPrototypeModel = new LoadBalancerListenerPolicyPrototype.Builder() + .action("forward_to_listener") + .name("my-load-balancer-listener-policy") + .priority(Long.valueOf("5")) + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) + .target(loadBalancerListenerPolicyTargetPrototypeModel) + .build(); + + // Construct an instance of the CreateLoadBalancerListenerOptions model + CreateLoadBalancerListenerOptions createLoadBalancerListenerOptionsModel = new CreateLoadBalancerListenerOptions.Builder() + .loadBalancerId("testString") + .protocol("http") + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerPoolIdentityModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) + .idleConnectionTimeout(Long.valueOf("100")) + .policies(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel)) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .build(); + + // Invoke createLoadBalancerListener() with a valid options model and verify the result + Response response = vpcService.createLoadBalancerListener(createLoadBalancerListenerOptionsModel).execute(); assertNotNull(response); - VolumeProfileCollection responseObj = response.getResult(); + LoadBalancerListener responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVolumeProfilesPath); + assertEquals(parsedPath, createLoadBalancerListenerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listVolumeProfiles operation with and without retries enabled + // Test the createLoadBalancerListener operation with and without retries enabled @Test - public void testListVolumeProfilesWRetries() throws Throwable { + public void testCreateLoadBalancerListenerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVolumeProfilesWOptions(); + testCreateLoadBalancerListenerWOptions(); vpcService.disableRetries(); - testListVolumeProfilesWOptions(); + testCreateLoadBalancerListenerWOptions(); } - // Test the listVolumeProfiles operation using the VolumeProfilesPager.getNext() method - @Test - public void testListVolumeProfilesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"adjustable_capacity_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"adjustable_iops_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"bandwidth\":{\"type\":\"fixed\",\"value\":4000},\"boot_capacity\":{\"type\":\"fixed\",\"value\":4800},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"general-purpose\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"adjustable_capacity_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"adjustable_iops_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"bandwidth\":{\"type\":\"fixed\",\"value\":4000},\"boot_capacity\":{\"type\":\"fixed\",\"value\":4800},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"general-purpose\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .build(); - - List allResults = new ArrayList<>(); - VolumeProfilesPager pager = new VolumeProfilesPager(vpcService, listVolumeProfilesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Test the createLoadBalancerListener operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateLoadBalancerListenerNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createLoadBalancerListener(null).execute(); } - - // Test the listVolumeProfiles operation using the VolumeProfilesPager.getAll() method - @Test - public void testListVolumeProfilesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"adjustable_capacity_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"adjustable_iops_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"bandwidth\":{\"type\":\"fixed\",\"value\":4000},\"boot_capacity\":{\"type\":\"fixed\",\"value\":4800},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"general-purpose\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"adjustable_capacity_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"adjustable_iops_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"bandwidth\":{\"type\":\"fixed\",\"value\":4000},\"boot_capacity\":{\"type\":\"fixed\",\"value\":4800},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"general-purpose\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .build(); - VolumeProfilesPager pager = new VolumeProfilesPager(vpcService, listVolumeProfilesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the getVolumeProfile operation with a valid options model parameter + // Test the deleteLoadBalancerListener operation with a valid options model parameter @Test - public void testGetVolumeProfileWOptions() throws Throwable { + public void testDeleteLoadBalancerListenerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"adjustable_capacity_states\": {\"type\": \"enum\", \"values\": [\"attached\"]}, \"adjustable_iops_states\": {\"type\": \"enum\", \"values\": [\"attached\"]}, \"bandwidth\": {\"type\": \"fixed\", \"value\": 4000}, \"boot_capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"family\": \"tiered\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"iops\": {\"type\": \"fixed\", \"value\": 4000}, \"name\": \"general-purpose\", \"storage_generation\": {\"type\": \"fixed\", \"value\": 1}}"; - String getVolumeProfilePath = "/volume/profiles/10iops-tier"; + String mockResponseBody = ""; + String deleteLoadBalancerListenerPath = "/load_balancers/testString/listeners/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the GetVolumeProfileOptions model - GetVolumeProfileOptions getVolumeProfileOptionsModel = new GetVolumeProfileOptions.Builder() - .name("10iops-tier") + // Construct an instance of the DeleteLoadBalancerListenerOptions model + DeleteLoadBalancerListenerOptions deleteLoadBalancerListenerOptionsModel = new DeleteLoadBalancerListenerOptions.Builder() + .loadBalancerId("testString") + .id("testString") .build(); - // Invoke getVolumeProfile() with a valid options model and verify the result - Response response = vpcService.getVolumeProfile(getVolumeProfileOptionsModel).execute(); + // Invoke deleteLoadBalancerListener() with a valid options model and verify the result + Response response = vpcService.deleteLoadBalancerListener(deleteLoadBalancerListenerOptionsModel).execute(); assertNotNull(response); - VolumeProfile responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVolumeProfilePath); + assertEquals(parsedPath, deleteLoadBalancerListenerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVolumeProfile operation with and without retries enabled + // Test the deleteLoadBalancerListener operation with and without retries enabled @Test - public void testGetVolumeProfileWRetries() throws Throwable { + public void testDeleteLoadBalancerListenerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVolumeProfileWOptions(); + testDeleteLoadBalancerListenerWOptions(); vpcService.disableRetries(); - testGetVolumeProfileWOptions(); + testDeleteLoadBalancerListenerWOptions(); } - // Test the getVolumeProfile operation with a null options model (negative test) + // Test the deleteLoadBalancerListener operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVolumeProfileNoOptions() throws Throwable { + public void testDeleteLoadBalancerListenerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVolumeProfile(null).execute(); + vpcService.deleteLoadBalancerListener(null).execute(); } - // Test the listVolumes operation with a valid options model parameter + // Test the getLoadBalancerListener operation with a valid options model parameter @Test - public void testListVolumesWOptions() throws Throwable { + public void testGetLoadBalancerListenerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"volumes\": [{\"active\": true, \"adjustable_capacity_states\": [\"attached\"], \"adjustable_iops_states\": [\"attached\"], \"attachment_state\": \"attached\", \"bandwidth\": 100, \"busy\": true, \"capacity\": 1000, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"health_reasons\": [{\"code\": \"initializing_from_snapshot\", \"message\": \"Performance will be degraded while this volume is being initialized from its snapshot\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"name\": \"general-purpose\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"volume\", \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"name\": \"my-volume-attachment\", \"type\": \"boot\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; - String listVolumesPath = "/volumes"; + String mockResponseBody = "{\"accept_proxy_protocol\": true, \"certificate_instance\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"connection_limit\": 2000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"default_pool\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"https_redirect\": {\"http_status_code\": 301, \"listener\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}, \"uri\": \"/example?doc=get\"}, \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"idle_connection_timeout\": 100, \"policies\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\"}], \"port\": 443, \"port_max\": 499, \"port_min\": 443, \"protocol\": \"http\", \"provisioning_status\": \"active\"}"; + String getLoadBalancerListenerPath = "/load_balancers/testString/listeners/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVolumesOptions model - ListVolumesOptions listVolumesOptionsModel = new ListVolumesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .attachmentState("attached") - .encryption("provider_managed") - .name("my-name") - .operatingSystemFamily("Ubuntu Server") - .operatingSystemArchitecture("amd64") - .tag("testString") - .zoneName("us-south-1") + // Construct an instance of the GetLoadBalancerListenerOptions model + GetLoadBalancerListenerOptions getLoadBalancerListenerOptionsModel = new GetLoadBalancerListenerOptions.Builder() + .loadBalancerId("testString") + .id("testString") .build(); - // Invoke listVolumes() with a valid options model and verify the result - Response response = vpcService.listVolumes(listVolumesOptionsModel).execute(); + // Invoke getLoadBalancerListener() with a valid options model and verify the result + Response response = vpcService.getLoadBalancerListener(getLoadBalancerListenerOptionsModel).execute(); assertNotNull(response); - VolumeCollection responseObj = response.getResult(); + LoadBalancerListener responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -16266,397 +17691,325 @@ public void testListVolumesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVolumesPath); + assertEquals(parsedPath, getLoadBalancerListenerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("attachment_state"), "attached"); - assertEquals(query.get("encryption"), "provider_managed"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("operating_system.family"), "Ubuntu Server"); - assertEquals(query.get("operating_system.architecture"), "amd64"); - assertEquals(query.get("tag"), "testString"); - assertEquals(query.get("zone.name"), "us-south-1"); } - // Test the listVolumes operation with and without retries enabled + // Test the getLoadBalancerListener operation with and without retries enabled @Test - public void testListVolumesWRetries() throws Throwable { + public void testGetLoadBalancerListenerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVolumesWOptions(); + testGetLoadBalancerListenerWOptions(); vpcService.disableRetries(); - testListVolumesWOptions(); + testGetLoadBalancerListenerWOptions(); } - // Test the listVolumes operation using the VolumesPager.getNext() method - @Test - public void testListVolumesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"adjustable_capacity_states\":[\"attached\"],\"adjustable_iops_states\":[\"attached\"],\"attachment_state\":\"attached\",\"bandwidth\":100,\"busy\":true,\"capacity\":1000,\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"health_reasons\":[{\"code\":\"initializing_from_snapshot\",\"message\":\"Performance will be degraded while this volume is being initialized from its snapshot\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"volume\",\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"adjustable_capacity_states\":[\"attached\"],\"adjustable_iops_states\":[\"attached\"],\"attachment_state\":\"attached\",\"bandwidth\":100,\"busy\":true,\"capacity\":1000,\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"health_reasons\":[{\"code\":\"initializing_from_snapshot\",\"message\":\"Performance will be degraded while this volume is being initialized from its snapshot\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"volume\",\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() - .limit(Long.valueOf("10")) - .attachmentState("attached") - .encryption("provider_managed") - .name("my-name") - .operatingSystemFamily("Ubuntu Server") - .operatingSystemArchitecture("amd64") - .tag("testString") - .zoneName("us-south-1") - .build(); - - List allResults = new ArrayList<>(); - VolumesPager pager = new VolumesPager(vpcService, listVolumesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Test the getLoadBalancerListener operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetLoadBalancerListenerNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getLoadBalancerListener(null).execute(); } - - // Test the listVolumes operation using the VolumesPager.getAll() method - @Test - public void testListVolumesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"adjustable_capacity_states\":[\"attached\"],\"adjustable_iops_states\":[\"attached\"],\"attachment_state\":\"attached\",\"bandwidth\":100,\"busy\":true,\"capacity\":1000,\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"health_reasons\":[{\"code\":\"initializing_from_snapshot\",\"message\":\"Performance will be degraded while this volume is being initialized from its snapshot\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"volume\",\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"adjustable_capacity_states\":[\"attached\"],\"adjustable_iops_states\":[\"attached\"],\"attachment_state\":\"attached\",\"bandwidth\":100,\"busy\":true,\"capacity\":1000,\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"health_reasons\":[{\"code\":\"initializing_from_snapshot\",\"message\":\"Performance will be degraded while this volume is being initialized from its snapshot\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"volume\",\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() - .limit(Long.valueOf("10")) - .attachmentState("attached") - .encryption("provider_managed") - .name("my-name") - .operatingSystemFamily("Ubuntu Server") - .operatingSystemArchitecture("amd64") - .tag("testString") - .zoneName("us-south-1") - .build(); - - VolumesPager pager = new VolumesPager(vpcService, listVolumesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createVolume operation with a valid options model parameter + // Test the updateLoadBalancerListener operation with a valid options model parameter @Test - public void testCreateVolumeWOptions() throws Throwable { + public void testUpdateLoadBalancerListenerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"adjustable_capacity_states\": [\"attached\"], \"adjustable_iops_states\": [\"attached\"], \"attachment_state\": \"attached\", \"bandwidth\": 100, \"busy\": true, \"capacity\": 1000, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"health_reasons\": [{\"code\": \"initializing_from_snapshot\", \"message\": \"Performance will be degraded while this volume is being initialized from its snapshot\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"name\": \"general-purpose\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"volume\", \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"name\": \"my-volume-attachment\", \"type\": \"boot\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createVolumePath = "/volumes"; + String mockResponseBody = "{\"accept_proxy_protocol\": true, \"certificate_instance\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"connection_limit\": 2000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"default_pool\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"https_redirect\": {\"http_status_code\": 301, \"listener\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}, \"uri\": \"/example?doc=get\"}, \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"idle_connection_timeout\": 100, \"policies\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\"}], \"port\": 443, \"port_max\": 499, \"port_min\": 443, \"protocol\": \"http\", \"provisioning_status\": \"active\"}"; + String updateLoadBalancerListenerPath = "/load_balancers/testString/listeners/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VolumeProfileIdentityByName model - VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("custom") + // Construct an instance of the CertificateInstanceIdentityByCRN model + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") .build(); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + // Construct an instance of the LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById model + LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById loadBalancerListenerDefaultPoolPatchModel = new LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") .build(); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the LoadBalancerListenerIdentityById model + LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() + .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") .build(); - // Construct an instance of the EncryptionKeyIdentityByCRN model - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + // Construct an instance of the LoadBalancerListenerHTTPSRedirectPatch model + LoadBalancerListenerHTTPSRedirectPatch loadBalancerListenerHttpsRedirectPatchModel = new LoadBalancerListenerHTTPSRedirectPatch.Builder() + .httpStatusCode(Long.valueOf("301")) + .listener(loadBalancerListenerIdentityModel) + .uri("/example?doc=get") .build(); - // Construct an instance of the VolumePrototypeVolumeByCapacity model - VolumePrototypeVolumeByCapacity volumePrototypeModel = new VolumePrototypeVolumeByCapacity.Builder() - .bandwidth(Long.valueOf("1000")) - .iops(Long.valueOf("10000")) - .name("my-volume") - .profile(volumeProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .zone(zoneIdentityModel) - .capacity(Long.valueOf("100")) - .encryptionKey(encryptionKeyIdentityModel) + // Construct an instance of the LoadBalancerListenerPatch model + LoadBalancerListenerPatch loadBalancerListenerPatchModel = new LoadBalancerListenerPatch.Builder() + .acceptProxyProtocol(true) + .certificateInstance(certificateInstanceIdentityModel) + .connectionLimit(Long.valueOf("2000")) + .defaultPool(loadBalancerListenerDefaultPoolPatchModel) + .httpsRedirect(loadBalancerListenerHttpsRedirectPatchModel) + .idleConnectionTimeout(Long.valueOf("100")) + .port(Long.valueOf("443")) + .portMax(Long.valueOf("499")) + .portMin(Long.valueOf("443")) + .protocol("http") .build(); - - // Construct an instance of the CreateVolumeOptions model - CreateVolumeOptions createVolumeOptionsModel = new CreateVolumeOptions.Builder() - .volumePrototype(volumePrototypeModel) + Map loadBalancerListenerPatchModelAsPatch = loadBalancerListenerPatchModel.asPatch(); + + // Construct an instance of the UpdateLoadBalancerListenerOptions model + UpdateLoadBalancerListenerOptions updateLoadBalancerListenerOptionsModel = new UpdateLoadBalancerListenerOptions.Builder() + .loadBalancerId("testString") + .id("testString") + .loadBalancerListenerPatch(loadBalancerListenerPatchModelAsPatch) .build(); - // Invoke createVolume() with a valid options model and verify the result - Response response = vpcService.createVolume(createVolumeOptionsModel).execute(); + // Invoke updateLoadBalancerListener() with a valid options model and verify the result + Response response = vpcService.updateLoadBalancerListener(updateLoadBalancerListenerOptionsModel).execute(); assertNotNull(response); - Volume responseObj = response.getResult(); + LoadBalancerListener responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVolumePath); + assertEquals(parsedPath, updateLoadBalancerListenerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVolume operation with and without retries enabled + // Test the updateLoadBalancerListener operation with and without retries enabled @Test - public void testCreateVolumeWRetries() throws Throwable { + public void testUpdateLoadBalancerListenerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVolumeWOptions(); + testUpdateLoadBalancerListenerWOptions(); vpcService.disableRetries(); - testCreateVolumeWOptions(); + testUpdateLoadBalancerListenerWOptions(); } - // Test the createVolume operation with a null options model (negative test) + // Test the updateLoadBalancerListener operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVolumeNoOptions() throws Throwable { + public void testUpdateLoadBalancerListenerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVolume(null).execute(); + vpcService.updateLoadBalancerListener(null).execute(); } - // Test the deleteVolume operation with a valid options model parameter + // Test the listLoadBalancerListenerPolicies operation with a valid options model parameter @Test - public void testDeleteVolumeWOptions() throws Throwable { + public void testListLoadBalancerListenerPoliciesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteVolumePath = "/volumes/testString"; + String mockResponseBody = "{\"policies\": [{\"action\": \"forward_to_listener\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\", \"priority\": 5, \"provisioning_status\": \"active\", \"rules\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\"}], \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}]}"; + String listLoadBalancerListenerPoliciesPath = "/load_balancers/testString/listeners/testString/policies"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVolumeOptions model - DeleteVolumeOptions deleteVolumeOptionsModel = new DeleteVolumeOptions.Builder() - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + // Construct an instance of the ListLoadBalancerListenerPoliciesOptions model + ListLoadBalancerListenerPoliciesOptions listLoadBalancerListenerPoliciesOptionsModel = new ListLoadBalancerListenerPoliciesOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") .build(); - // Invoke deleteVolume() with a valid options model and verify the result - Response response = vpcService.deleteVolume(deleteVolumeOptionsModel).execute(); + // Invoke listLoadBalancerListenerPolicies() with a valid options model and verify the result + Response response = vpcService.listLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + LoadBalancerListenerPolicyCollection responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVolumePath); + assertEquals(parsedPath, listLoadBalancerListenerPoliciesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVolume operation with and without retries enabled + // Test the listLoadBalancerListenerPolicies operation with and without retries enabled @Test - public void testDeleteVolumeWRetries() throws Throwable { + public void testListLoadBalancerListenerPoliciesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVolumeWOptions(); + testListLoadBalancerListenerPoliciesWOptions(); vpcService.disableRetries(); - testDeleteVolumeWOptions(); + testListLoadBalancerListenerPoliciesWOptions(); } - // Test the deleteVolume operation with a null options model (negative test) + // Test the listLoadBalancerListenerPolicies operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVolumeNoOptions() throws Throwable { + public void testListLoadBalancerListenerPoliciesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVolume(null).execute(); + vpcService.listLoadBalancerListenerPolicies(null).execute(); } - // Test the getVolume operation with a valid options model parameter + // Test the createLoadBalancerListenerPolicy operation with a valid options model parameter @Test - public void testGetVolumeWOptions() throws Throwable { + public void testCreateLoadBalancerListenerPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"adjustable_capacity_states\": [\"attached\"], \"adjustable_iops_states\": [\"attached\"], \"attachment_state\": \"attached\", \"bandwidth\": 100, \"busy\": true, \"capacity\": 1000, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"health_reasons\": [{\"code\": \"initializing_from_snapshot\", \"message\": \"Performance will be degraded while this volume is being initialized from its snapshot\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"name\": \"general-purpose\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"volume\", \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"name\": \"my-volume-attachment\", \"type\": \"boot\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getVolumePath = "/volumes/testString"; + String mockResponseBody = "{\"action\": \"forward_to_listener\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\", \"priority\": 5, \"provisioning_status\": \"active\", \"rules\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\"}], \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}"; + String createLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the GetVolumeOptions model - GetVolumeOptions getVolumeOptionsModel = new GetVolumeOptions.Builder() - .id("testString") + // Construct an instance of the LoadBalancerListenerPolicyRulePrototype model + LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("testString") .build(); - // Invoke getVolume() with a valid options model and verify the result - Response response = vpcService.getVolume(getVolumeOptionsModel).execute(); + // Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + .build(); + + // Construct an instance of the CreateLoadBalancerListenerPolicyOptions model + CreateLoadBalancerListenerPolicyOptions createLoadBalancerListenerPolicyOptionsModel = new CreateLoadBalancerListenerPolicyOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .action("forward_to_listener") + .priority(Long.valueOf("5")) + .name("my-load-balancer-listener-policy") + .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) + .target(loadBalancerListenerPolicyTargetPrototypeModel) + .build(); + + // Invoke createLoadBalancerListenerPolicy() with a valid options model and verify the result + Response response = vpcService.createLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModel).execute(); assertNotNull(response); - Volume responseObj = response.getResult(); + LoadBalancerListenerPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVolumePath); + assertEquals(parsedPath, createLoadBalancerListenerPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVolume operation with and without retries enabled + // Test the createLoadBalancerListenerPolicy operation with and without retries enabled @Test - public void testGetVolumeWRetries() throws Throwable { + public void testCreateLoadBalancerListenerPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVolumeWOptions(); + testCreateLoadBalancerListenerPolicyWOptions(); vpcService.disableRetries(); - testGetVolumeWOptions(); + testCreateLoadBalancerListenerPolicyWOptions(); } - // Test the getVolume operation with a null options model (negative test) + // Test the createLoadBalancerListenerPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVolumeNoOptions() throws Throwable { + public void testCreateLoadBalancerListenerPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVolume(null).execute(); + vpcService.createLoadBalancerListenerPolicy(null).execute(); } - // Test the updateVolume operation with a valid options model parameter + // Test the deleteLoadBalancerListenerPolicy operation with a valid options model parameter @Test - public void testUpdateVolumeWOptions() throws Throwable { + public void testDeleteLoadBalancerListenerPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"adjustable_capacity_states\": [\"attached\"], \"adjustable_iops_states\": [\"attached\"], \"attachment_state\": \"attached\", \"bandwidth\": 100, \"busy\": true, \"capacity\": 1000, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"health_reasons\": [{\"code\": \"initializing_from_snapshot\", \"message\": \"Performance will be degraded while this volume is being initialized from its snapshot\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"name\": \"general-purpose\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"volume\", \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"name\": \"my-volume-attachment\", \"type\": \"boot\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateVolumePath = "/volumes/testString"; + String mockResponseBody = ""; + String deleteLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the VolumeProfileIdentityByName model - VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() - .name("general-purpose") - .build(); - - // Construct an instance of the VolumePatch model - VolumePatch volumePatchModel = new VolumePatch.Builder() - .bandwidth(Long.valueOf("1000")) - .capacity(Long.valueOf("100")) - .iops(Long.valueOf("10000")) - .name("my-volume") - .profile(volumeProfileIdentityModel) - .userTags(java.util.Arrays.asList("testString")) - .build(); - Map volumePatchModelAsPatch = volumePatchModel.asPatch(); - - // Construct an instance of the UpdateVolumeOptions model - UpdateVolumeOptions updateVolumeOptionsModel = new UpdateVolumeOptions.Builder() + // Construct an instance of the DeleteLoadBalancerListenerPolicyOptions model + DeleteLoadBalancerListenerPolicyOptions deleteLoadBalancerListenerPolicyOptionsModel = new DeleteLoadBalancerListenerPolicyOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") .id("testString") - .volumePatch(volumePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateVolume() with a valid options model and verify the result - Response response = vpcService.updateVolume(updateVolumeOptionsModel).execute(); + // Invoke deleteLoadBalancerListenerPolicy() with a valid options model and verify the result + Response response = vpcService.deleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptionsModel).execute(); assertNotNull(response); - Volume responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVolumePath); + assertEquals(parsedPath, deleteLoadBalancerListenerPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVolume operation with and without retries enabled + // Test the deleteLoadBalancerListenerPolicy operation with and without retries enabled @Test - public void testUpdateVolumeWRetries() throws Throwable { + public void testDeleteLoadBalancerListenerPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVolumeWOptions(); + testDeleteLoadBalancerListenerPolicyWOptions(); vpcService.disableRetries(); - testUpdateVolumeWOptions(); + testDeleteLoadBalancerListenerPolicyWOptions(); } - // Test the updateVolume operation with a null options model (negative test) + // Test the deleteLoadBalancerListenerPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVolumeNoOptions() throws Throwable { + public void testDeleteLoadBalancerListenerPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVolume(null).execute(); + vpcService.deleteLoadBalancerListenerPolicy(null).execute(); } - // Test the listSnapshotConsistencyGroups operation with a valid options model parameter + // Test the getLoadBalancerListenerPolicy operation with a valid options model parameter @Test - public void testListSnapshotConsistencyGroupsWOptions() throws Throwable { + public void testGetLoadBalancerListenerPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"snapshot_consistency_groups\": [{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}], \"total_count\": 132}"; - String listSnapshotConsistencyGroupsPath = "/snapshot_consistency_groups"; + String mockResponseBody = "{\"action\": \"forward_to_listener\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\", \"priority\": 5, \"provisioning_status\": \"active\", \"rules\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\"}], \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}"; + String getLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListSnapshotConsistencyGroupsOptions model - ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptionsModel = new ListSnapshotConsistencyGroupsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .backupPolicyPlanId("testString") + // Construct an instance of the GetLoadBalancerListenerPolicyOptions model + GetLoadBalancerListenerPolicyOptions getLoadBalancerListenerPolicyOptionsModel = new GetLoadBalancerListenerPolicyOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .id("testString") .build(); - // Invoke listSnapshotConsistencyGroups() with a valid options model and verify the result - Response response = vpcService.listSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptionsModel).execute(); + // Invoke getLoadBalancerListenerPolicy() with a valid options model and verify the result + Response response = vpcService.getLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModel).execute(); assertNotNull(response); - SnapshotConsistencyGroupCollection responseObj = response.getResult(); + LoadBalancerListenerPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -16665,440 +18018,411 @@ public void testListSnapshotConsistencyGroupsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSnapshotConsistencyGroupsPath); + assertEquals(parsedPath, getLoadBalancerListenerPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("sort"), "name"); - assertEquals(query.get("backup_policy_plan.id"), "testString"); } - // Test the listSnapshotConsistencyGroups operation with and without retries enabled + // Test the getLoadBalancerListenerPolicy operation with and without retries enabled @Test - public void testListSnapshotConsistencyGroupsWRetries() throws Throwable { + public void testGetLoadBalancerListenerPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSnapshotConsistencyGroupsWOptions(); + testGetLoadBalancerListenerPolicyWOptions(); vpcService.disableRetries(); - testListSnapshotConsistencyGroupsWOptions(); + testGetLoadBalancerListenerPolicyWOptions(); } - // Test the listSnapshotConsistencyGroups operation using the SnapshotConsistencyGroupsPager.getNext() method + // Test the getLoadBalancerListenerPolicy operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetLoadBalancerListenerPolicyNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getLoadBalancerListenerPolicy(null).execute(); + } + + // Test the updateLoadBalancerListenerPolicy operation with a valid options model parameter @Test - public void testListSnapshotConsistencyGroupsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"snapshot_consistency_groups\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"delete_snapshots_on_delete\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"name\":\"my-snapshot-consistency-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot_consistency_group\",\"service_tags\":[\"serviceTags\"],\"snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"snapshot_consistency_groups\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"delete_snapshots_on_delete\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"name\":\"my-snapshot-consistency-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot_consistency_group\",\"service_tags\":[\"serviceTags\"],\"snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); + public void testUpdateLoadBalancerListenerPolicyWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"action\": \"forward_to_listener\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\", \"priority\": 5, \"provisioning_status\": \"active\", \"rules\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\"}], \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}"; + String updateLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + .setBody(mockResponseBody)); - ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptions = new ListSnapshotConsistencyGroupsOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .backupPolicyPlanId("testString") + // Construct an instance of the LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPatchModel = new LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") .build(); - List allResults = new ArrayList<>(); - SnapshotConsistencyGroupsPager pager = new SnapshotConsistencyGroupsPager(vpcService, listSnapshotConsistencyGroupsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Construct an instance of the LoadBalancerListenerPolicyPatch model + LoadBalancerListenerPolicyPatch loadBalancerListenerPolicyPatchModel = new LoadBalancerListenerPolicyPatch.Builder() + .name("my-load-balancer-listener-policy-updated") + .priority(Long.valueOf("5")) + .target(loadBalancerListenerPolicyTargetPatchModel) + .build(); + Map loadBalancerListenerPolicyPatchModelAsPatch = loadBalancerListenerPolicyPatchModel.asPatch(); + + // Construct an instance of the UpdateLoadBalancerListenerPolicyOptions model + UpdateLoadBalancerListenerPolicyOptions updateLoadBalancerListenerPolicyOptionsModel = new UpdateLoadBalancerListenerPolicyOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .id("testString") + .loadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatchModelAsPatch) + .build(); + + // Invoke updateLoadBalancerListenerPolicy() with a valid options model and verify the result + Response response = vpcService.updateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModel).execute(); + assertNotNull(response); + LoadBalancerListenerPolicy responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateLoadBalancerListenerPolicyPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - - // Test the listSnapshotConsistencyGroups operation using the SnapshotConsistencyGroupsPager.getAll() method + + // Test the updateLoadBalancerListenerPolicy operation with and without retries enabled @Test - public void testListSnapshotConsistencyGroupsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"snapshot_consistency_groups\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"delete_snapshots_on_delete\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"name\":\"my-snapshot-consistency-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot_consistency_group\",\"service_tags\":[\"serviceTags\"],\"snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"snapshot_consistency_groups\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"delete_snapshots_on_delete\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"name\":\"my-snapshot-consistency-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot_consistency_group\",\"service_tags\":[\"serviceTags\"],\"snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + public void testUpdateLoadBalancerListenerPolicyWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testUpdateLoadBalancerListenerPolicyWOptions(); - ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptions = new ListSnapshotConsistencyGroupsOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .backupPolicyPlanId("testString") - .build(); + vpcService.disableRetries(); + testUpdateLoadBalancerListenerPolicyWOptions(); + } - SnapshotConsistencyGroupsPager pager = new SnapshotConsistencyGroupsPager(vpcService, listSnapshotConsistencyGroupsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); + // Test the updateLoadBalancerListenerPolicy operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateLoadBalancerListenerPolicyNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateLoadBalancerListenerPolicy(null).execute(); } - - // Test the createSnapshotConsistencyGroup operation with a valid options model parameter + + // Test the listLoadBalancerListenerPolicyRules operation with a valid options model parameter @Test - public void testCreateSnapshotConsistencyGroupWOptions() throws Throwable { + public void testListLoadBalancerListenerPolicyRulesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; - String createSnapshotConsistencyGroupPath = "/snapshot_consistency_groups"; + String mockResponseBody = "{\"rules\": [{\"condition\": \"contains\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"field\": \"MY-APP-HEADER\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"provisioning_status\": \"active\", \"type\": \"body\", \"value\": \"value\"}]}"; + String listLoadBalancerListenerPolicyRulesPath = "/load_balancers/testString/listeners/testString/policies/testString/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the VolumeIdentityById model - VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() - .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .build(); - - // Construct an instance of the SnapshotPrototypeSnapshotConsistencyGroupContext model - SnapshotPrototypeSnapshotConsistencyGroupContext snapshotPrototypeSnapshotConsistencyGroupContextModel = new SnapshotPrototypeSnapshotConsistencyGroupContext.Builder() - .name("my-snapshot") - .sourceVolume(volumeIdentityModel) - .userTags(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model - SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots snapshotConsistencyGroupPrototypeModel = new SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots.Builder() - .deleteSnapshotsOnDelete(true) - .name("my-snapshot-consistency-group") - .resourceGroup(resourceGroupIdentityModel) - .snapshots(java.util.Arrays.asList(snapshotPrototypeSnapshotConsistencyGroupContextModel)) - .build(); - - // Construct an instance of the CreateSnapshotConsistencyGroupOptions model - CreateSnapshotConsistencyGroupOptions createSnapshotConsistencyGroupOptionsModel = new CreateSnapshotConsistencyGroupOptions.Builder() - .snapshotConsistencyGroupPrototype(snapshotConsistencyGroupPrototypeModel) + // Construct an instance of the ListLoadBalancerListenerPolicyRulesOptions model + ListLoadBalancerListenerPolicyRulesOptions listLoadBalancerListenerPolicyRulesOptionsModel = new ListLoadBalancerListenerPolicyRulesOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") .build(); - // Invoke createSnapshotConsistencyGroup() with a valid options model and verify the result - Response response = vpcService.createSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModel).execute(); + // Invoke listLoadBalancerListenerPolicyRules() with a valid options model and verify the result + Response response = vpcService.listLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModel).execute(); assertNotNull(response); - SnapshotConsistencyGroup responseObj = response.getResult(); + LoadBalancerListenerPolicyRuleCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSnapshotConsistencyGroupPath); + assertEquals(parsedPath, listLoadBalancerListenerPolicyRulesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createSnapshotConsistencyGroup operation with and without retries enabled + // Test the listLoadBalancerListenerPolicyRules operation with and without retries enabled @Test - public void testCreateSnapshotConsistencyGroupWRetries() throws Throwable { + public void testListLoadBalancerListenerPolicyRulesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateSnapshotConsistencyGroupWOptions(); + testListLoadBalancerListenerPolicyRulesWOptions(); vpcService.disableRetries(); - testCreateSnapshotConsistencyGroupWOptions(); + testListLoadBalancerListenerPolicyRulesWOptions(); } - // Test the createSnapshotConsistencyGroup operation with a null options model (negative test) + // Test the listLoadBalancerListenerPolicyRules operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateSnapshotConsistencyGroupNoOptions() throws Throwable { + public void testListLoadBalancerListenerPolicyRulesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createSnapshotConsistencyGroup(null).execute(); + vpcService.listLoadBalancerListenerPolicyRules(null).execute(); } - // Test the deleteSnapshotConsistencyGroup operation with a valid options model parameter + // Test the createLoadBalancerListenerPolicyRule operation with a valid options model parameter @Test - public void testDeleteSnapshotConsistencyGroupWOptions() throws Throwable { + public void testCreateLoadBalancerListenerPolicyRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; - String deleteSnapshotConsistencyGroupPath = "/snapshot_consistency_groups/testString"; + String mockResponseBody = "{\"condition\": \"contains\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"field\": \"MY-APP-HEADER\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"provisioning_status\": \"active\", \"type\": \"body\", \"value\": \"value\"}"; + String createLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the DeleteSnapshotConsistencyGroupOptions model - DeleteSnapshotConsistencyGroupOptions deleteSnapshotConsistencyGroupOptionsModel = new DeleteSnapshotConsistencyGroupOptions.Builder() - .id("testString") + // Construct an instance of the CreateLoadBalancerListenerPolicyRuleOptions model + CreateLoadBalancerListenerPolicyRuleOptions createLoadBalancerListenerPolicyRuleOptionsModel = new CreateLoadBalancerListenerPolicyRuleOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .condition("contains") + .type("body") + .value("testString") + .field("MY-APP-HEADER") .build(); - // Invoke deleteSnapshotConsistencyGroup() with a valid options model and verify the result - Response response = vpcService.deleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModel).execute(); + // Invoke createLoadBalancerListenerPolicyRule() with a valid options model and verify the result + Response response = vpcService.createLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModel).execute(); assertNotNull(response); - SnapshotConsistencyGroup responseObj = response.getResult(); + LoadBalancerListenerPolicyRule responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSnapshotConsistencyGroupPath); + assertEquals(parsedPath, createLoadBalancerListenerPolicyRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteSnapshotConsistencyGroup operation with and without retries enabled + // Test the createLoadBalancerListenerPolicyRule operation with and without retries enabled @Test - public void testDeleteSnapshotConsistencyGroupWRetries() throws Throwable { + public void testCreateLoadBalancerListenerPolicyRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSnapshotConsistencyGroupWOptions(); + testCreateLoadBalancerListenerPolicyRuleWOptions(); vpcService.disableRetries(); - testDeleteSnapshotConsistencyGroupWOptions(); + testCreateLoadBalancerListenerPolicyRuleWOptions(); } - // Test the deleteSnapshotConsistencyGroup operation with a null options model (negative test) + // Test the createLoadBalancerListenerPolicyRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSnapshotConsistencyGroupNoOptions() throws Throwable { + public void testCreateLoadBalancerListenerPolicyRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSnapshotConsistencyGroup(null).execute(); + vpcService.createLoadBalancerListenerPolicyRule(null).execute(); } - // Test the getSnapshotConsistencyGroup operation with a valid options model parameter + // Test the deleteLoadBalancerListenerPolicyRule operation with a valid options model parameter @Test - public void testGetSnapshotConsistencyGroupWOptions() throws Throwable { + public void testDeleteLoadBalancerListenerPolicyRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; - String getSnapshotConsistencyGroupPath = "/snapshot_consistency_groups/testString"; + String mockResponseBody = ""; + String deleteLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the GetSnapshotConsistencyGroupOptions model - GetSnapshotConsistencyGroupOptions getSnapshotConsistencyGroupOptionsModel = new GetSnapshotConsistencyGroupOptions.Builder() + // Construct an instance of the DeleteLoadBalancerListenerPolicyRuleOptions model + DeleteLoadBalancerListenerPolicyRuleOptions deleteLoadBalancerListenerPolicyRuleOptionsModel = new DeleteLoadBalancerListenerPolicyRuleOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") .id("testString") .build(); - // Invoke getSnapshotConsistencyGroup() with a valid options model and verify the result - Response response = vpcService.getSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModel).execute(); + // Invoke deleteLoadBalancerListenerPolicyRule() with a valid options model and verify the result + Response response = vpcService.deleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptionsModel).execute(); assertNotNull(response); - SnapshotConsistencyGroup responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSnapshotConsistencyGroupPath); + assertEquals(parsedPath, deleteLoadBalancerListenerPolicyRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getSnapshotConsistencyGroup operation with and without retries enabled + // Test the deleteLoadBalancerListenerPolicyRule operation with and without retries enabled @Test - public void testGetSnapshotConsistencyGroupWRetries() throws Throwable { + public void testDeleteLoadBalancerListenerPolicyRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSnapshotConsistencyGroupWOptions(); + testDeleteLoadBalancerListenerPolicyRuleWOptions(); vpcService.disableRetries(); - testGetSnapshotConsistencyGroupWOptions(); + testDeleteLoadBalancerListenerPolicyRuleWOptions(); } - // Test the getSnapshotConsistencyGroup operation with a null options model (negative test) + // Test the deleteLoadBalancerListenerPolicyRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSnapshotConsistencyGroupNoOptions() throws Throwable { + public void testDeleteLoadBalancerListenerPolicyRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSnapshotConsistencyGroup(null).execute(); + vpcService.deleteLoadBalancerListenerPolicyRule(null).execute(); } - // Test the updateSnapshotConsistencyGroup operation with a valid options model parameter + // Test the getLoadBalancerListenerPolicyRule operation with a valid options model parameter @Test - public void testUpdateSnapshotConsistencyGroupWOptions() throws Throwable { + public void testGetLoadBalancerListenerPolicyRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; - String updateSnapshotConsistencyGroupPath = "/snapshot_consistency_groups/testString"; + String mockResponseBody = "{\"condition\": \"contains\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"field\": \"MY-APP-HEADER\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"provisioning_status\": \"active\", \"type\": \"body\", \"value\": \"value\"}"; + String getLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the SnapshotConsistencyGroupPatch model - SnapshotConsistencyGroupPatch snapshotConsistencyGroupPatchModel = new SnapshotConsistencyGroupPatch.Builder() - .deleteSnapshotsOnDelete(false) - .name("my-snapshot-consistency-group") - .build(); - Map snapshotConsistencyGroupPatchModelAsPatch = snapshotConsistencyGroupPatchModel.asPatch(); - - // Construct an instance of the UpdateSnapshotConsistencyGroupOptions model - UpdateSnapshotConsistencyGroupOptions updateSnapshotConsistencyGroupOptionsModel = new UpdateSnapshotConsistencyGroupOptions.Builder() + // Construct an instance of the GetLoadBalancerListenerPolicyRuleOptions model + GetLoadBalancerListenerPolicyRuleOptions getLoadBalancerListenerPolicyRuleOptionsModel = new GetLoadBalancerListenerPolicyRuleOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") .id("testString") - .snapshotConsistencyGroupPatch(snapshotConsistencyGroupPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateSnapshotConsistencyGroup() with a valid options model and verify the result - Response response = vpcService.updateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModel).execute(); + // Invoke getLoadBalancerListenerPolicyRule() with a valid options model and verify the result + Response response = vpcService.getLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModel).execute(); assertNotNull(response); - SnapshotConsistencyGroup responseObj = response.getResult(); + LoadBalancerListenerPolicyRule responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateSnapshotConsistencyGroupPath); + assertEquals(parsedPath, getLoadBalancerListenerPolicyRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateSnapshotConsistencyGroup operation with and without retries enabled + // Test the getLoadBalancerListenerPolicyRule operation with and without retries enabled @Test - public void testUpdateSnapshotConsistencyGroupWRetries() throws Throwable { + public void testGetLoadBalancerListenerPolicyRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateSnapshotConsistencyGroupWOptions(); + testGetLoadBalancerListenerPolicyRuleWOptions(); vpcService.disableRetries(); - testUpdateSnapshotConsistencyGroupWOptions(); + testGetLoadBalancerListenerPolicyRuleWOptions(); } - // Test the updateSnapshotConsistencyGroup operation with a null options model (negative test) + // Test the getLoadBalancerListenerPolicyRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateSnapshotConsistencyGroupNoOptions() throws Throwable { + public void testGetLoadBalancerListenerPolicyRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateSnapshotConsistencyGroup(null).execute(); + vpcService.getLoadBalancerListenerPolicyRule(null).execute(); } - // Test the deleteSnapshots operation with a valid options model parameter + // Test the updateLoadBalancerListenerPolicyRule operation with a valid options model parameter @Test - public void testDeleteSnapshotsWOptions() throws Throwable { + public void testUpdateLoadBalancerListenerPolicyRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteSnapshotsPath = "/snapshots"; + String mockResponseBody = "{\"condition\": \"contains\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"field\": \"MY-APP-HEADER\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"provisioning_status\": \"active\", \"type\": \"body\", \"value\": \"value\"}"; + String updateLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteSnapshotsOptions model - DeleteSnapshotsOptions deleteSnapshotsOptionsModel = new DeleteSnapshotsOptions.Builder() - .sourceVolumeId("testString") + // Construct an instance of the LoadBalancerListenerPolicyRulePatch model + LoadBalancerListenerPolicyRulePatch loadBalancerListenerPolicyRulePatchModel = new LoadBalancerListenerPolicyRulePatch.Builder() + .condition("contains") + .field("MY-APP-HEADER") + .type("body") + .value("my-example-hostname-updated") .build(); + Map loadBalancerListenerPolicyRulePatchModelAsPatch = loadBalancerListenerPolicyRulePatchModel.asPatch(); - // Invoke deleteSnapshots() with a valid options model and verify the result - Response response = vpcService.deleteSnapshots(deleteSnapshotsOptionsModel).execute(); + // Construct an instance of the UpdateLoadBalancerListenerPolicyRuleOptions model + UpdateLoadBalancerListenerPolicyRuleOptions updateLoadBalancerListenerPolicyRuleOptionsModel = new UpdateLoadBalancerListenerPolicyRuleOptions.Builder() + .loadBalancerId("testString") + .listenerId("testString") + .policyId("testString") + .id("testString") + .loadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatchModelAsPatch) + .build(); + + // Invoke updateLoadBalancerListenerPolicyRule() with a valid options model and verify the result + Response response = vpcService.updateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + LoadBalancerListenerPolicyRule responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSnapshotsPath); + assertEquals(parsedPath, updateLoadBalancerListenerPolicyRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("source_volume.id"), "testString"); } - // Test the deleteSnapshots operation with and without retries enabled + // Test the updateLoadBalancerListenerPolicyRule operation with and without retries enabled @Test - public void testDeleteSnapshotsWRetries() throws Throwable { + public void testUpdateLoadBalancerListenerPolicyRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSnapshotsWOptions(); + testUpdateLoadBalancerListenerPolicyRuleWOptions(); vpcService.disableRetries(); - testDeleteSnapshotsWOptions(); + testUpdateLoadBalancerListenerPolicyRuleWOptions(); } - // Test the deleteSnapshots operation with a null options model (negative test) + // Test the updateLoadBalancerListenerPolicyRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSnapshotsNoOptions() throws Throwable { + public void testUpdateLoadBalancerListenerPolicyRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSnapshots(null).execute(); + vpcService.updateLoadBalancerListenerPolicyRule(null).execute(); } - // Test the listSnapshots operation with a valid options model parameter + // Test the listLoadBalancerPools operation with a valid options model parameter @Test - public void testListSnapshotsWOptions() throws Throwable { + public void testListLoadBalancerPoolsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"snapshots\": [{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"copies\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"progress\": 55, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot\", \"service_tags\": [\"serviceTags\"], \"size\": 1, \"snapshot_consistency_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot-consistency-group\", \"resource_type\": \"snapshot_consistency_group\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"]}], \"total_count\": 132}"; - String listSnapshotsPath = "/snapshots"; + String mockResponseBody = "{\"pools\": [{\"algorithm\": \"least_connections\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"failsafe_policy\": {\"action\": \"forward\", \"healthy_member_threshold_count\": 0, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}, \"health_monitor\": {\"delay\": 5, \"max_retries\": 2, \"port\": 22, \"timeout\": 2, \"type\": \"tcp\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"name\": \"my-load-balancer-pool\", \"protocol\": \"http\", \"provisioning_status\": \"active\", \"proxy_protocol\": \"disabled\", \"session_persistence\": {\"cookie_name\": \"my-cookie-name\", \"type\": \"app_cookie\"}}]}"; + String listLoadBalancerPoolsPath = "/load_balancers/testString/pools"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListSnapshotsOptions model - ListSnapshotsOptions listSnapshotsOptionsModel = new ListSnapshotsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .tag("testString") - .resourceGroupId("testString") - .name("my-name") - .sourceVolumeId("testString") - .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .sourceImageId("testString") - .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .sort("name") - .backupPolicyPlanId("testString") - .copiesId("testString") - .copiesName("my-snapshot-copy") - .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") - .copiesRemoteRegionName("us-south") - .sourceSnapshotId("testString") - .sourceSnapshotRemoteRegionName("us-south") - .sourceVolumeRemoteRegionName("us-east") - .sourceImageRemoteRegionName("us-south") - .clonesZoneName("us-south-1") - .snapshotConsistencyGroupId("testString") - .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") + // Construct an instance of the ListLoadBalancerPoolsOptions model + ListLoadBalancerPoolsOptions listLoadBalancerPoolsOptionsModel = new ListLoadBalancerPoolsOptions.Builder() + .loadBalancerId("testString") .build(); - // Invoke listSnapshots() with a valid options model and verify the result - Response response = vpcService.listSnapshots(listSnapshotsOptionsModel).execute(); + // Invoke listLoadBalancerPools() with a valid options model and verify the result + Response response = vpcService.listLoadBalancerPools(listLoadBalancerPoolsOptionsModel).execute(); assertNotNull(response); - SnapshotCollection responseObj = response.getResult(); + LoadBalancerPoolCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -17107,197 +18431,97 @@ public void testListSnapshotsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSnapshotsPath); + assertEquals(parsedPath, listLoadBalancerPoolsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("tag"), "testString"); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("source_volume.id"), "testString"); - assertEquals(query.get("source_volume.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); - assertEquals(query.get("source_image.id"), "testString"); - assertEquals(query.get("source_image.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"); - assertEquals(query.get("sort"), "name"); - assertEquals(query.get("backup_policy_plan.id"), "testString"); - assertEquals(query.get("copies[].id"), "testString"); - assertEquals(query.get("copies[].name"), "my-snapshot-copy"); - assertEquals(query.get("copies[].crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); - assertEquals(query.get("copies[].remote.region.name"), "us-south"); - assertEquals(query.get("source_snapshot.id"), "testString"); - assertEquals(query.get("source_snapshot.remote.region.name"), "us-south"); - assertEquals(query.get("source_volume.remote.region.name"), "us-east"); - assertEquals(query.get("source_image.remote.region.name"), "us-south"); - assertEquals(query.get("clones[].zone.name"), "us-south-1"); - assertEquals(query.get("snapshot_consistency_group.id"), "testString"); - assertEquals(query.get("snapshot_consistency_group.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263"); } - // Test the listSnapshots operation with and without retries enabled + // Test the listLoadBalancerPools operation with and without retries enabled @Test - public void testListSnapshotsWRetries() throws Throwable { + public void testListLoadBalancerPoolsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSnapshotsWOptions(); + testListLoadBalancerPoolsWOptions(); vpcService.disableRetries(); - testListSnapshotsWOptions(); + testListLoadBalancerPoolsWOptions(); } - // Test the listSnapshots operation using the SnapshotsPager.getNext() method - @Test - public void testListSnapshotsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"clones\":[{\"available\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"copies\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"progress\":55,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"snapshot_consistency_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot-consistency-group\",\"resource_type\":\"snapshot_consistency_group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"]}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"clones\":[{\"available\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"copies\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"progress\":55,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"snapshot_consistency_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot-consistency-group\",\"resource_type\":\"snapshot_consistency_group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() - .limit(Long.valueOf("10")) - .tag("testString") - .resourceGroupId("testString") - .name("my-name") - .sourceVolumeId("testString") - .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .sourceImageId("testString") - .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .sort("name") - .backupPolicyPlanId("testString") - .copiesId("testString") - .copiesName("my-snapshot-copy") - .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") - .copiesRemoteRegionName("us-south") - .sourceSnapshotId("testString") - .sourceSnapshotRemoteRegionName("us-south") - .sourceVolumeRemoteRegionName("us-east") - .sourceImageRemoteRegionName("us-south") - .clonesZoneName("us-south-1") - .snapshotConsistencyGroupId("testString") - .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") - .build(); - - List allResults = new ArrayList<>(); - SnapshotsPager pager = new SnapshotsPager(vpcService, listSnapshotsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Test the listLoadBalancerPools operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListLoadBalancerPoolsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listLoadBalancerPools(null).execute(); } - - // Test the listSnapshots operation using the SnapshotsPager.getAll() method - @Test - public void testListSnapshotsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"clones\":[{\"available\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"copies\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"progress\":55,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"snapshot_consistency_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot-consistency-group\",\"resource_type\":\"snapshot_consistency_group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"]}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"clones\":[{\"available\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"copies\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"progress\":55,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"snapshot_consistency_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot-consistency-group\",\"resource_type\":\"snapshot_consistency_group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() - .limit(Long.valueOf("10")) - .tag("testString") - .resourceGroupId("testString") - .name("my-name") - .sourceVolumeId("testString") - .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") - .sourceImageId("testString") - .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") - .sort("name") - .backupPolicyPlanId("testString") - .copiesId("testString") - .copiesName("my-snapshot-copy") - .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") - .copiesRemoteRegionName("us-south") - .sourceSnapshotId("testString") - .sourceSnapshotRemoteRegionName("us-south") - .sourceVolumeRemoteRegionName("us-east") - .sourceImageRemoteRegionName("us-south") - .clonesZoneName("us-south-1") - .snapshotConsistencyGroupId("testString") - .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") - .build(); - SnapshotsPager pager = new SnapshotsPager(vpcService, listSnapshotsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createSnapshot operation with a valid options model parameter + // Test the createLoadBalancerPool operation with a valid options model parameter @Test - public void testCreateSnapshotWOptions() throws Throwable { + public void testCreateLoadBalancerPoolWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"copies\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"progress\": 55, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot\", \"service_tags\": [\"serviceTags\"], \"size\": 1, \"snapshot_consistency_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot-consistency-group\", \"resource_type\": \"snapshot_consistency_group\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"]}"; - String createSnapshotPath = "/snapshots"; + String mockResponseBody = "{\"algorithm\": \"least_connections\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"failsafe_policy\": {\"action\": \"forward\", \"healthy_member_threshold_count\": 0, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}, \"health_monitor\": {\"delay\": 5, \"max_retries\": 2, \"port\": 22, \"timeout\": 2, \"type\": \"tcp\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"name\": \"my-load-balancer-pool\", \"protocol\": \"http\", \"provisioning_status\": \"active\", \"proxy_protocol\": \"disabled\", \"session_persistence\": {\"cookie_name\": \"my-cookie-name\", \"type\": \"app_cookie\"}}"; + String createLoadBalancerPoolPath = "/load_balancers/testString/pools"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model + LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype.Builder() + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("tcp") .build(); - // Construct an instance of the SnapshotClonePrototype model - SnapshotClonePrototype snapshotClonePrototypeModel = new SnapshotClonePrototype.Builder() - .zone(zoneIdentityModel) + // Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityById model + LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") .build(); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + // Construct an instance of the LoadBalancerPoolFailsafePolicyPrototype model + LoadBalancerPoolFailsafePolicyPrototype loadBalancerPoolFailsafePolicyPrototypeModel = new LoadBalancerPoolFailsafePolicyPrototype.Builder() + .action("forward") + .target(loadBalancerPoolIdentityModel) .build(); - // Construct an instance of the VolumeIdentityById model - VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() - .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") .build(); - // Construct an instance of the SnapshotPrototypeSnapshotBySourceVolume model - SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() - .clones(java.util.Arrays.asList(snapshotClonePrototypeModel)) - .name("my-snapshot") - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .sourceVolume(volumeIdentityModel) + // Construct an instance of the LoadBalancerPoolMemberPrototype model + LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) .build(); - // Construct an instance of the CreateSnapshotOptions model - CreateSnapshotOptions createSnapshotOptionsModel = new CreateSnapshotOptions.Builder() - .snapshotPrototype(snapshotPrototypeModel) + // Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model + LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() + .cookieName("my-cookie-name") + .type("app_cookie") .build(); - // Invoke createSnapshot() with a valid options model and verify the result - Response response = vpcService.createSnapshot(createSnapshotOptionsModel).execute(); + // Construct an instance of the CreateLoadBalancerPoolOptions model + CreateLoadBalancerPoolOptions createLoadBalancerPoolOptionsModel = new CreateLoadBalancerPoolOptions.Builder() + .loadBalancerId("testString") + .algorithm("least_connections") + .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) + .protocol("http") + .failsafePolicy(loadBalancerPoolFailsafePolicyPrototypeModel) + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + .name("my-load-balancer-pool") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + .build(); + + // Invoke createLoadBalancerPool() with a valid options model and verify the result + Response response = vpcService.createLoadBalancerPool(createLoadBalancerPoolOptionsModel).execute(); assertNotNull(response); - Snapshot responseObj = response.getResult(); + LoadBalancerPool responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -17306,49 +18530,49 @@ public void testCreateSnapshotWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSnapshotPath); + assertEquals(parsedPath, createLoadBalancerPoolPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createSnapshot operation with and without retries enabled + // Test the createLoadBalancerPool operation with and without retries enabled @Test - public void testCreateSnapshotWRetries() throws Throwable { + public void testCreateLoadBalancerPoolWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateSnapshotWOptions(); + testCreateLoadBalancerPoolWOptions(); vpcService.disableRetries(); - testCreateSnapshotWOptions(); + testCreateLoadBalancerPoolWOptions(); } - // Test the createSnapshot operation with a null options model (negative test) + // Test the createLoadBalancerPool operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateSnapshotNoOptions() throws Throwable { + public void testCreateLoadBalancerPoolNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createSnapshot(null).execute(); + vpcService.createLoadBalancerPool(null).execute(); } - // Test the deleteSnapshot operation with a valid options model parameter + // Test the deleteLoadBalancerPool operation with a valid options model parameter @Test - public void testDeleteSnapshotWOptions() throws Throwable { + public void testDeleteLoadBalancerPoolWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteSnapshotPath = "/snapshots/testString"; + String deleteLoadBalancerPoolPath = "/load_balancers/testString/pools/testString"; server.enqueue(new MockResponse() .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteSnapshotOptions model - DeleteSnapshotOptions deleteSnapshotOptionsModel = new DeleteSnapshotOptions.Builder() + // Construct an instance of the DeleteLoadBalancerPoolOptions model + DeleteLoadBalancerPoolOptions deleteLoadBalancerPoolOptionsModel = new DeleteLoadBalancerPoolOptions.Builder() + .loadBalancerId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteSnapshot() with a valid options model and verify the result - Response response = vpcService.deleteSnapshot(deleteSnapshotOptionsModel).execute(); + // Invoke deleteLoadBalancerPool() with a valid options model and verify the result + Response response = vpcService.deleteLoadBalancerPool(deleteLoadBalancerPoolOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -17359,51 +18583,52 @@ public void testDeleteSnapshotWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSnapshotPath); + assertEquals(parsedPath, deleteLoadBalancerPoolPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteSnapshot operation with and without retries enabled + // Test the deleteLoadBalancerPool operation with and without retries enabled @Test - public void testDeleteSnapshotWRetries() throws Throwable { + public void testDeleteLoadBalancerPoolWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSnapshotWOptions(); + testDeleteLoadBalancerPoolWOptions(); vpcService.disableRetries(); - testDeleteSnapshotWOptions(); + testDeleteLoadBalancerPoolWOptions(); } - // Test the deleteSnapshot operation with a null options model (negative test) + // Test the deleteLoadBalancerPool operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSnapshotNoOptions() throws Throwable { + public void testDeleteLoadBalancerPoolNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSnapshot(null).execute(); + vpcService.deleteLoadBalancerPool(null).execute(); } - // Test the getSnapshot operation with a valid options model parameter + // Test the getLoadBalancerPool operation with a valid options model parameter @Test - public void testGetSnapshotWOptions() throws Throwable { + public void testGetLoadBalancerPoolWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"copies\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"progress\": 55, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot\", \"service_tags\": [\"serviceTags\"], \"size\": 1, \"snapshot_consistency_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot-consistency-group\", \"resource_type\": \"snapshot_consistency_group\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"]}"; - String getSnapshotPath = "/snapshots/testString"; + String mockResponseBody = "{\"algorithm\": \"least_connections\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"failsafe_policy\": {\"action\": \"forward\", \"healthy_member_threshold_count\": 0, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}, \"health_monitor\": {\"delay\": 5, \"max_retries\": 2, \"port\": 22, \"timeout\": 2, \"type\": \"tcp\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"name\": \"my-load-balancer-pool\", \"protocol\": \"http\", \"provisioning_status\": \"active\", \"proxy_protocol\": \"disabled\", \"session_persistence\": {\"cookie_name\": \"my-cookie-name\", \"type\": \"app_cookie\"}}"; + String getLoadBalancerPoolPath = "/load_balancers/testString/pools/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetSnapshotOptions model - GetSnapshotOptions getSnapshotOptionsModel = new GetSnapshotOptions.Builder() + // Construct an instance of the GetLoadBalancerPoolOptions model + GetLoadBalancerPoolOptions getLoadBalancerPoolOptionsModel = new GetLoadBalancerPoolOptions.Builder() + .loadBalancerId("testString") .id("testString") .build(); - // Invoke getSnapshot() with a valid options model and verify the result - Response response = vpcService.getSnapshot(getSnapshotOptionsModel).execute(); + // Invoke getLoadBalancerPool() with a valid options model and verify the result + Response response = vpcService.getLoadBalancerPool(getLoadBalancerPoolOptionsModel).execute(); assertNotNull(response); - Snapshot responseObj = response.getResult(); + LoadBalancerPool responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -17412,60 +18637,92 @@ public void testGetSnapshotWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSnapshotPath); + assertEquals(parsedPath, getLoadBalancerPoolPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getSnapshot operation with and without retries enabled + // Test the getLoadBalancerPool operation with and without retries enabled @Test - public void testGetSnapshotWRetries() throws Throwable { + public void testGetLoadBalancerPoolWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSnapshotWOptions(); + testGetLoadBalancerPoolWOptions(); vpcService.disableRetries(); - testGetSnapshotWOptions(); + testGetLoadBalancerPoolWOptions(); } - // Test the getSnapshot operation with a null options model (negative test) + // Test the getLoadBalancerPool operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSnapshotNoOptions() throws Throwable { + public void testGetLoadBalancerPoolNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSnapshot(null).execute(); + vpcService.getLoadBalancerPool(null).execute(); } - // Test the updateSnapshot operation with a valid options model parameter + // Test the updateLoadBalancerPool operation with a valid options model parameter @Test - public void testUpdateSnapshotWOptions() throws Throwable { + public void testUpdateLoadBalancerPoolWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"copies\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"progress\": 55, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot\", \"service_tags\": [\"serviceTags\"], \"size\": 1, \"snapshot_consistency_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot-consistency-group\", \"resource_type\": \"snapshot_consistency_group\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"]}"; - String updateSnapshotPath = "/snapshots/testString"; + String mockResponseBody = "{\"algorithm\": \"least_connections\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"failsafe_policy\": {\"action\": \"forward\", \"healthy_member_threshold_count\": 0, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}, \"health_monitor\": {\"delay\": 5, \"max_retries\": 2, \"port\": 22, \"timeout\": 2, \"type\": \"tcp\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"name\": \"my-load-balancer-pool\", \"protocol\": \"http\", \"provisioning_status\": \"active\", \"proxy_protocol\": \"disabled\", \"session_persistence\": {\"cookie_name\": \"my-cookie-name\", \"type\": \"app_cookie\"}}"; + String updateLoadBalancerPoolPath = "/load_balancers/testString/pools/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the SnapshotPatch model - SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() - .name("my-snapshot-updated") - .userTags(java.util.Arrays.asList("testString")) + // Construct an instance of the LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById model + LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById loadBalancerPoolFailsafePolicyTargetPatchModel = new LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById.Builder() + .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") .build(); - Map snapshotPatchModelAsPatch = snapshotPatchModel.asPatch(); - // Construct an instance of the UpdateSnapshotOptions model - UpdateSnapshotOptions updateSnapshotOptionsModel = new UpdateSnapshotOptions.Builder() + // Construct an instance of the LoadBalancerPoolFailsafePolicyPatch model + LoadBalancerPoolFailsafePolicyPatch loadBalancerPoolFailsafePolicyPatchModel = new LoadBalancerPoolFailsafePolicyPatch.Builder() + .action("forward") + .target(loadBalancerPoolFailsafePolicyTargetPatchModel) + .build(); + + // Construct an instance of the LoadBalancerPoolHealthMonitorPatch model + LoadBalancerPoolHealthMonitorPatch loadBalancerPoolHealthMonitorPatchModel = new LoadBalancerPoolHealthMonitorPatch.Builder() + .delay(Long.valueOf("5")) + .maxRetries(Long.valueOf("2")) + .port(Long.valueOf("22")) + .timeout(Long.valueOf("2")) + .type("http") + .urlPath("/") + .build(); + + // Construct an instance of the LoadBalancerPoolSessionPersistencePatch model + LoadBalancerPoolSessionPersistencePatch loadBalancerPoolSessionPersistencePatchModel = new LoadBalancerPoolSessionPersistencePatch.Builder() + .cookieName("my-cookie-name") + .type("app_cookie") + .build(); + + // Construct an instance of the LoadBalancerPoolPatch model + LoadBalancerPoolPatch loadBalancerPoolPatchModel = new LoadBalancerPoolPatch.Builder() + .algorithm("weighted_round_robin") + .failsafePolicy(loadBalancerPoolFailsafePolicyPatchModel) + .healthMonitor(loadBalancerPoolHealthMonitorPatchModel) + .name("my-load-balancer-pool") + .protocol("http") + .proxyProtocol("disabled") + .sessionPersistence(loadBalancerPoolSessionPersistencePatchModel) + .build(); + Map loadBalancerPoolPatchModelAsPatch = loadBalancerPoolPatchModel.asPatch(); + + // Construct an instance of the UpdateLoadBalancerPoolOptions model + UpdateLoadBalancerPoolOptions updateLoadBalancerPoolOptionsModel = new UpdateLoadBalancerPoolOptions.Builder() + .loadBalancerId("testString") .id("testString") - .snapshotPatch(snapshotPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .loadBalancerPoolPatch(loadBalancerPoolPatchModelAsPatch) .build(); - // Invoke updateSnapshot() with a valid options model and verify the result - Response response = vpcService.updateSnapshot(updateSnapshotOptionsModel).execute(); + // Invoke updateLoadBalancerPool() with a valid options model and verify the result + Response response = vpcService.updateLoadBalancerPool(updateLoadBalancerPoolOptionsModel).execute(); assertNotNull(response); - Snapshot responseObj = response.getResult(); + LoadBalancerPool responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -17474,51 +18731,52 @@ public void testUpdateSnapshotWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateSnapshotPath); + assertEquals(parsedPath, updateLoadBalancerPoolPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateSnapshot operation with and without retries enabled + // Test the updateLoadBalancerPool operation with and without retries enabled @Test - public void testUpdateSnapshotWRetries() throws Throwable { + public void testUpdateLoadBalancerPoolWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateSnapshotWOptions(); + testUpdateLoadBalancerPoolWOptions(); vpcService.disableRetries(); - testUpdateSnapshotWOptions(); + testUpdateLoadBalancerPoolWOptions(); } - // Test the updateSnapshot operation with a null options model (negative test) + // Test the updateLoadBalancerPool operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateSnapshotNoOptions() throws Throwable { + public void testUpdateLoadBalancerPoolNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateSnapshot(null).execute(); + vpcService.updateLoadBalancerPool(null).execute(); } - // Test the listSnapshotClones operation with a valid options model parameter + // Test the listLoadBalancerPoolMembers operation with a valid options model parameter @Test - public void testListSnapshotClonesWOptions() throws Throwable { + public void testListLoadBalancerPoolMembersWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; - String listSnapshotClonesPath = "/snapshots/testString/clones"; + String mockResponseBody = "{\"members\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}]}"; + String listLoadBalancerPoolMembersPath = "/load_balancers/testString/pools/testString/members"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListSnapshotClonesOptions model - ListSnapshotClonesOptions listSnapshotClonesOptionsModel = new ListSnapshotClonesOptions.Builder() - .id("testString") + // Construct an instance of the ListLoadBalancerPoolMembersOptions model + ListLoadBalancerPoolMembersOptions listLoadBalancerPoolMembersOptionsModel = new ListLoadBalancerPoolMembersOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") .build(); - // Invoke listSnapshotClones() with a valid options model and verify the result - Response response = vpcService.listSnapshotClones(listSnapshotClonesOptionsModel).execute(); + // Invoke listLoadBalancerPoolMembers() with a valid options model and verify the result + Response response = vpcService.listLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModel).execute(); assertNotNull(response); - SnapshotCloneCollection responseObj = response.getResult(); + LoadBalancerPoolMemberCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -17527,214 +18785,236 @@ public void testListSnapshotClonesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSnapshotClonesPath); + assertEquals(parsedPath, listLoadBalancerPoolMembersPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listSnapshotClones operation with and without retries enabled + // Test the listLoadBalancerPoolMembers operation with and without retries enabled @Test - public void testListSnapshotClonesWRetries() throws Throwable { + public void testListLoadBalancerPoolMembersWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSnapshotClonesWOptions(); + testListLoadBalancerPoolMembersWOptions(); vpcService.disableRetries(); - testListSnapshotClonesWOptions(); + testListLoadBalancerPoolMembersWOptions(); } - // Test the listSnapshotClones operation with a null options model (negative test) + // Test the listLoadBalancerPoolMembers operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListSnapshotClonesNoOptions() throws Throwable { + public void testListLoadBalancerPoolMembersNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listSnapshotClones(null).execute(); + vpcService.listLoadBalancerPoolMembers(null).execute(); } - // Test the deleteSnapshotClone operation with a valid options model parameter + // Test the createLoadBalancerPoolMember operation with a valid options model parameter @Test - public void testDeleteSnapshotCloneWOptions() throws Throwable { + public void testCreateLoadBalancerPoolMemberWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteSnapshotClonePath = "/snapshots/testString/clones/us-south-1"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}"; + String createLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the DeleteSnapshotCloneOptions model - DeleteSnapshotCloneOptions deleteSnapshotCloneOptionsModel = new DeleteSnapshotCloneOptions.Builder() - .id("testString") - .zoneName("us-south-1") + // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") .build(); - // Invoke deleteSnapshotClone() with a valid options model and verify the result - Response response = vpcService.deleteSnapshotClone(deleteSnapshotCloneOptionsModel).execute(); + // Construct an instance of the CreateLoadBalancerPoolMemberOptions model + CreateLoadBalancerPoolMemberOptions createLoadBalancerPoolMemberOptionsModel = new CreateLoadBalancerPoolMemberOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); + + // Invoke createLoadBalancerPoolMember() with a valid options model and verify the result + Response response = vpcService.createLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + LoadBalancerPoolMember responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSnapshotClonePath); + assertEquals(parsedPath, createLoadBalancerPoolMemberPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteSnapshotClone operation with and without retries enabled + // Test the createLoadBalancerPoolMember operation with and without retries enabled @Test - public void testDeleteSnapshotCloneWRetries() throws Throwable { + public void testCreateLoadBalancerPoolMemberWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSnapshotCloneWOptions(); + testCreateLoadBalancerPoolMemberWOptions(); vpcService.disableRetries(); - testDeleteSnapshotCloneWOptions(); + testCreateLoadBalancerPoolMemberWOptions(); } - // Test the deleteSnapshotClone operation with a null options model (negative test) + // Test the createLoadBalancerPoolMember operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSnapshotCloneNoOptions() throws Throwable { + public void testCreateLoadBalancerPoolMemberNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSnapshotClone(null).execute(); + vpcService.createLoadBalancerPoolMember(null).execute(); } - // Test the getSnapshotClone operation with a valid options model parameter + // Test the replaceLoadBalancerPoolMembers operation with a valid options model parameter @Test - public void testGetSnapshotCloneWOptions() throws Throwable { + public void testReplaceLoadBalancerPoolMembersWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getSnapshotClonePath = "/snapshots/testString/clones/us-south-1"; + String mockResponseBody = "{\"members\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}]}"; + String replaceLoadBalancerPoolMembersPath = "/load_balancers/testString/pools/testString/members"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetSnapshotCloneOptions model - GetSnapshotCloneOptions getSnapshotCloneOptionsModel = new GetSnapshotCloneOptions.Builder() - .id("testString") - .zoneName("us-south-1") + // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") .build(); - // Invoke getSnapshotClone() with a valid options model and verify the result - Response response = vpcService.getSnapshotClone(getSnapshotCloneOptionsModel).execute(); + // Construct an instance of the LoadBalancerPoolMemberPrototype model + LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("50")) + .build(); + + // Construct an instance of the ReplaceLoadBalancerPoolMembersOptions model + ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptionsModel = new ReplaceLoadBalancerPoolMembersOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") + .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + .build(); + + // Invoke replaceLoadBalancerPoolMembers() with a valid options model and verify the result + Response response = vpcService.replaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModel).execute(); assertNotNull(response); - SnapshotClone responseObj = response.getResult(); + LoadBalancerPoolMemberCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSnapshotClonePath); + assertEquals(parsedPath, replaceLoadBalancerPoolMembersPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getSnapshotClone operation with and without retries enabled + // Test the replaceLoadBalancerPoolMembers operation with and without retries enabled @Test - public void testGetSnapshotCloneWRetries() throws Throwable { + public void testReplaceLoadBalancerPoolMembersWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSnapshotCloneWOptions(); + testReplaceLoadBalancerPoolMembersWOptions(); vpcService.disableRetries(); - testGetSnapshotCloneWOptions(); + testReplaceLoadBalancerPoolMembersWOptions(); } - // Test the getSnapshotClone operation with a null options model (negative test) + // Test the replaceLoadBalancerPoolMembers operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSnapshotCloneNoOptions() throws Throwable { + public void testReplaceLoadBalancerPoolMembersNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSnapshotClone(null).execute(); + vpcService.replaceLoadBalancerPoolMembers(null).execute(); } - // Test the createSnapshotClone operation with a valid options model parameter + // Test the deleteLoadBalancerPoolMember operation with a valid options model parameter @Test - public void testCreateSnapshotCloneWOptions() throws Throwable { + public void testDeleteLoadBalancerPoolMemberWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createSnapshotClonePath = "/snapshots/testString/clones/us-south-1"; + String mockResponseBody = ""; + String deleteLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the CreateSnapshotCloneOptions model - CreateSnapshotCloneOptions createSnapshotCloneOptionsModel = new CreateSnapshotCloneOptions.Builder() + // Construct an instance of the DeleteLoadBalancerPoolMemberOptions model + DeleteLoadBalancerPoolMemberOptions deleteLoadBalancerPoolMemberOptionsModel = new DeleteLoadBalancerPoolMemberOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") .id("testString") - .zoneName("us-south-1") .build(); - // Invoke createSnapshotClone() with a valid options model and verify the result - Response response = vpcService.createSnapshotClone(createSnapshotCloneOptionsModel).execute(); + // Invoke deleteLoadBalancerPoolMember() with a valid options model and verify the result + Response response = vpcService.deleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptionsModel).execute(); assertNotNull(response); - SnapshotClone responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSnapshotClonePath); + assertEquals(parsedPath, deleteLoadBalancerPoolMemberPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createSnapshotClone operation with and without retries enabled + // Test the deleteLoadBalancerPoolMember operation with and without retries enabled @Test - public void testCreateSnapshotCloneWRetries() throws Throwable { + public void testDeleteLoadBalancerPoolMemberWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateSnapshotCloneWOptions(); + testDeleteLoadBalancerPoolMemberWOptions(); vpcService.disableRetries(); - testCreateSnapshotCloneWOptions(); + testDeleteLoadBalancerPoolMemberWOptions(); } - // Test the createSnapshotClone operation with a null options model (negative test) + // Test the deleteLoadBalancerPoolMember operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateSnapshotCloneNoOptions() throws Throwable { + public void testDeleteLoadBalancerPoolMemberNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createSnapshotClone(null).execute(); + vpcService.deleteLoadBalancerPoolMember(null).execute(); } - // Test the listShareProfiles operation with a valid options model parameter + // Test the getLoadBalancerPoolMember operation with a valid options model parameter @Test - public void testListShareProfilesWOptions() throws Throwable { + public void testGetLoadBalancerPoolMemberWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"family\": \"defined_performance\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"iops\": {\"type\": \"fixed\", \"value\": 4000}, \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}], \"total_count\": 132}"; - String listShareProfilesPath = "/share/profiles"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}"; + String getLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListShareProfilesOptions model - ListShareProfilesOptions listShareProfilesOptionsModel = new ListShareProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .sort("name") + // Construct an instance of the GetLoadBalancerPoolMemberOptions model + GetLoadBalancerPoolMemberOptions getLoadBalancerPoolMemberOptionsModel = new GetLoadBalancerPoolMemberOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") + .id("testString") .build(); - // Invoke listShareProfiles() with a valid options model and verify the result - Response response = vpcService.listShareProfiles(listShareProfilesOptionsModel).execute(); + // Invoke getLoadBalancerPoolMember() with a valid options model and verify the result + Response response = vpcService.getLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModel).execute(); assertNotNull(response); - ShareProfileCollection responseObj = response.getResult(); + LoadBalancerPoolMember responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -17743,169 +19023,122 @@ public void testListShareProfilesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listShareProfilesPath); + assertEquals(parsedPath, getLoadBalancerPoolMemberPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("sort"), "name"); } - // Test the listShareProfiles operation with and without retries enabled + // Test the getLoadBalancerPoolMember operation with and without retries enabled @Test - public void testListShareProfilesWRetries() throws Throwable { + public void testGetLoadBalancerPoolMemberWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListShareProfilesWOptions(); + testGetLoadBalancerPoolMemberWOptions(); vpcService.disableRetries(); - testListShareProfilesWOptions(); + testGetLoadBalancerPoolMemberWOptions(); } - // Test the listShareProfiles operation using the ShareProfilesPager.getNext() method - @Test - public void testListShareProfilesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"defined_performance\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"defined_performance\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListShareProfilesOptions listShareProfilesOptions = new ListShareProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .sort("name") - .build(); - - List allResults = new ArrayList<>(); - ShareProfilesPager pager = new ShareProfilesPager(vpcService, listShareProfilesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Test the getLoadBalancerPoolMember operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetLoadBalancerPoolMemberNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getLoadBalancerPoolMember(null).execute(); } - - // Test the listShareProfiles operation using the ShareProfilesPager.getAll() method - @Test - public void testListShareProfilesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"defined_performance\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"defined_performance\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListShareProfilesOptions listShareProfilesOptions = new ListShareProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .sort("name") - .build(); - ShareProfilesPager pager = new ShareProfilesPager(vpcService, listShareProfilesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the getShareProfile operation with a valid options model parameter + // Test the updateLoadBalancerPoolMember operation with a valid options model parameter @Test - public void testGetShareProfileWOptions() throws Throwable { + public void testUpdateLoadBalancerPoolMemberWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"family\": \"defined_performance\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"iops\": {\"type\": \"fixed\", \"value\": 4000}, \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}"; - String getShareProfilePath = "/share/profiles/dp2"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}"; + String updateLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetShareProfileOptions model - GetShareProfileOptions getShareProfileOptionsModel = new GetShareProfileOptions.Builder() - .name("dp2") + // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model + LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() + .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") .build(); - // Invoke getShareProfile() with a valid options model and verify the result - Response response = vpcService.getShareProfile(getShareProfileOptionsModel).execute(); + // Construct an instance of the LoadBalancerPoolMemberPatch model + LoadBalancerPoolMemberPatch loadBalancerPoolMemberPatchModel = new LoadBalancerPoolMemberPatch.Builder() + .port(Long.valueOf("80")) + .target(loadBalancerPoolMemberTargetPrototypeModel) + .weight(Long.valueOf("99")) + .build(); + Map loadBalancerPoolMemberPatchModelAsPatch = loadBalancerPoolMemberPatchModel.asPatch(); + + // Construct an instance of the UpdateLoadBalancerPoolMemberOptions model + UpdateLoadBalancerPoolMemberOptions updateLoadBalancerPoolMemberOptionsModel = new UpdateLoadBalancerPoolMemberOptions.Builder() + .loadBalancerId("testString") + .poolId("testString") + .id("testString") + .loadBalancerPoolMemberPatch(loadBalancerPoolMemberPatchModelAsPatch) + .build(); + + // Invoke updateLoadBalancerPoolMember() with a valid options model and verify the result + Response response = vpcService.updateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModel).execute(); assertNotNull(response); - ShareProfile responseObj = response.getResult(); + LoadBalancerPoolMember responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getShareProfilePath); + assertEquals(parsedPath, updateLoadBalancerPoolMemberPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getShareProfile operation with and without retries enabled + // Test the updateLoadBalancerPoolMember operation with and without retries enabled @Test - public void testGetShareProfileWRetries() throws Throwable { + public void testUpdateLoadBalancerPoolMemberWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetShareProfileWOptions(); + testUpdateLoadBalancerPoolMemberWOptions(); vpcService.disableRetries(); - testGetShareProfileWOptions(); + testUpdateLoadBalancerPoolMemberWOptions(); } - // Test the getShareProfile operation with a null options model (negative test) + // Test the updateLoadBalancerPoolMember operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetShareProfileNoOptions() throws Throwable { + public void testUpdateLoadBalancerPoolMemberNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getShareProfile(null).execute(); + vpcService.updateLoadBalancerPoolMember(null).execute(); } - // Test the listShares operation with a valid options model parameter + // Test the listNetworkAcls operation with a valid options model parameter @Test - public void testListSharesWOptions() throws Throwable { + public void testListNetworkAclsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"shares\": [{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_transit_encryption_modes\": [\"none\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; - String listSharesPath = "/shares"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"network_acls\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listNetworkAclsPath = "/network_acls"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListSharesOptions model - ListSharesOptions listSharesOptionsModel = new ListSharesOptions.Builder() + // Construct an instance of the ListNetworkAclsOptions model + ListNetworkAclsOptions listNetworkAclsOptionsModel = new ListNetworkAclsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") - .name("my-name") - .sort("name") - .replicationRole("none") .build(); - // Invoke listShares() with a valid options model and verify the result - Response response = vpcService.listShares(listSharesOptionsModel).execute(); + // Invoke listNetworkAcls() with a valid options model and verify the result + Response response = vpcService.listNetworkAcls(listNetworkAclsOptionsModel).execute(); assertNotNull(response); - ShareCollection responseObj = response.getResult(); + NetworkACLCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -17914,36 +19147,33 @@ public void testListSharesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSharesPath); + assertEquals(parsedPath, listNetworkAclsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("sort"), "name"); - assertEquals(query.get("replication_role"), "none"); } - // Test the listShares operation with and without retries enabled + // Test the listNetworkAcls operation with and without retries enabled @Test - public void testListSharesWRetries() throws Throwable { + public void testListNetworkAclsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSharesWOptions(); + testListNetworkAclsWOptions(); vpcService.disableRetries(); - testListSharesWOptions(); + testListNetworkAclsWOptions(); } - // Test the listShares operation using the SharesPager.getNext() method + // Test the listNetworkAcls operation using the NetworkAclsPager.getNext() method @Test - public void testListSharesWithPagerGetNext() throws Throwable { + public void testListNetworkAclsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"shares\":[{\"access_control_mode\":\"security_group\",\"accessor_binding_role\":\"accessor\",\"accessor_bindings\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"resource_type\":\"share_accessor_binding\"}],\"allowed_transit_encryption_modes\":[\"none\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"initial_owner\":{\"gid\":50,\"uid\":50},\"iops\":100,\"latest_job\":{\"status\":\"cancelled\",\"status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"type\":\"replication_failover\"},\"latest_sync\":{\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"data_transferred\":0,\"started_at\":\"2019-01-01T12:00:00.000Z\"},\"lifecycle_reasons\":[{\"code\":\"cloning_in_progress\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mount_targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"}],\"name\":\"my-share\",\"origin_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"},\"replica_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"replication_cron_spec\":\"0 */5 * * *\",\"replication_role\":\"none\",\"replication_status\":\"active\",\"replication_status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share\",\"size\":200,\"snapshot_count\":0,\"snapshot_size\":0,\"source_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"name\":\"my-share-snapshot\",\"resource_type\":\"share_snapshot\"},\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"shares\":[{\"access_control_mode\":\"security_group\",\"accessor_binding_role\":\"accessor\",\"accessor_bindings\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"resource_type\":\"share_accessor_binding\"}],\"allowed_transit_encryption_modes\":[\"none\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"initial_owner\":{\"gid\":50,\"uid\":50},\"iops\":100,\"latest_job\":{\"status\":\"cancelled\",\"status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"type\":\"replication_failover\"},\"latest_sync\":{\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"data_transferred\":0,\"started_at\":\"2019-01-01T12:00:00.000Z\"},\"lifecycle_reasons\":[{\"code\":\"cloning_in_progress\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mount_targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"}],\"name\":\"my-share\",\"origin_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"},\"replica_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"replication_cron_spec\":\"0 */5 * * *\",\"replication_role\":\"none\",\"replication_status\":\"active\",\"replication_status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share\",\"size\":200,\"snapshot_count\":0,\"snapshot_size\":0,\"source_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"name\":\"my-share-snapshot\",\"resource_type\":\"share_snapshot\"},\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"any\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"any\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -17957,30 +19187,27 @@ public void testListSharesWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSharesOptions listSharesOptions = new ListSharesOptions.Builder() + ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .name("my-name") - .sort("name") - .replicationRole("none") .build(); - List allResults = new ArrayList<>(); - SharesPager pager = new SharesPager(vpcService, listSharesOptions); + List allResults = new ArrayList<>(); + NetworkAclsPager pager = new NetworkAclsPager(vpcService, listNetworkAclsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listShares operation using the SharesPager.getAll() method + // Test the listNetworkAcls operation using the NetworkAclsPager.getAll() method @Test - public void testListSharesWithPagerGetAll() throws Throwable { + public void testListNetworkAclsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"shares\":[{\"access_control_mode\":\"security_group\",\"accessor_binding_role\":\"accessor\",\"accessor_bindings\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"resource_type\":\"share_accessor_binding\"}],\"allowed_transit_encryption_modes\":[\"none\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"initial_owner\":{\"gid\":50,\"uid\":50},\"iops\":100,\"latest_job\":{\"status\":\"cancelled\",\"status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"type\":\"replication_failover\"},\"latest_sync\":{\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"data_transferred\":0,\"started_at\":\"2019-01-01T12:00:00.000Z\"},\"lifecycle_reasons\":[{\"code\":\"cloning_in_progress\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mount_targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"}],\"name\":\"my-share\",\"origin_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"},\"replica_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"replication_cron_spec\":\"0 */5 * * *\",\"replication_role\":\"none\",\"replication_status\":\"active\",\"replication_status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share\",\"size\":200,\"snapshot_count\":0,\"snapshot_size\":0,\"source_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"name\":\"my-share-snapshot\",\"resource_type\":\"share_snapshot\"},\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"shares\":[{\"access_control_mode\":\"security_group\",\"accessor_binding_role\":\"accessor\",\"accessor_bindings\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"resource_type\":\"share_accessor_binding\"}],\"allowed_transit_encryption_modes\":[\"none\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"initial_owner\":{\"gid\":50,\"uid\":50},\"iops\":100,\"latest_job\":{\"status\":\"cancelled\",\"status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"type\":\"replication_failover\"},\"latest_sync\":{\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"data_transferred\":0,\"started_at\":\"2019-01-01T12:00:00.000Z\"},\"lifecycle_reasons\":[{\"code\":\"cloning_in_progress\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mount_targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"}],\"name\":\"my-share\",\"origin_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"},\"replica_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"replication_cron_spec\":\"0 */5 * * *\",\"replication_role\":\"none\",\"replication_status\":\"active\",\"replication_status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share\",\"size\":200,\"snapshot_count\":0,\"snapshot_size\":0,\"source_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"name\":\"my-share-snapshot\",\"resource_type\":\"share_snapshot\"},\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"any\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"any\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -17994,141 +19221,66 @@ public void testListSharesWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSharesOptions listSharesOptions = new ListSharesOptions.Builder() + ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") - .name("my-name") - .sort("name") - .replicationRole("none") .build(); - SharesPager pager = new SharesPager(vpcService, listSharesOptions); - List allResults = pager.getAll(); + NetworkAclsPager pager = new NetworkAclsPager(vpcService, listNetworkAclsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createShare operation with a valid options model parameter + // Test the createNetworkAcl operation with a valid options model parameter @Test - public void testCreateShareWOptions() throws Throwable { + public void testCreateNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_transit_encryption_modes\": [\"none\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createSharePath = "/shares"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String createNetworkAclPath = "/network_acls"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - // Construct an instance of the ResourceGroupIdentityById model ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext shareMountTargetVirtualNetworkInterfacePrototypeModel = new ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); - - // Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() - .name("my-share-mount-target") - .transitEncryption("none") - .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) - .build(); - - // Construct an instance of the ShareProfileIdentityByName model - ShareProfileIdentityByName shareProfileIdentityModel = new ShareProfileIdentityByName.Builder() - .name("tier-3iops") - .build(); - - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the SharePrototypeShareContext model - SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) - .iops(Long.valueOf("100")) - .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) - .name("my-share") - .profile(shareProfileIdentityModel) - .replicationCronSpec("0 */5 * * *") - .resourceGroup(resourceGroupIdentityModel) - .userTags(java.util.Arrays.asList()) - .zone(zoneIdentityModel) - .build(); - - // Construct an instance of the EncryptionKeyIdentityByCRN model - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - // Construct an instance of the ShareInitialOwner model - ShareInitialOwner shareInitialOwnerModel = new ShareInitialOwner.Builder() - .gid(Long.valueOf("50")) - .uid(Long.valueOf("50")) + // Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype model + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Builder() + .action("allow") + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("any") .build(); - // Construct an instance of the SharePrototypeShareBySize model - SharePrototypeShareBySize sharePrototypeModel = new SharePrototypeShareBySize.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) - .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) - .name("my-share") - .replicaShare(sharePrototypeShareContextModel) - .userTags(java.util.Arrays.asList()) - .accessControlMode("security_group") - .encryptionKey(encryptionKeyIdentityModel) - .initialOwner(shareInitialOwnerModel) - .iops(Long.valueOf("100")) - .profile(shareProfileIdentityModel) + // Construct an instance of the NetworkACLPrototypeNetworkACLByRules model + NetworkACLPrototypeNetworkACLByRules networkAclPrototypeModel = new NetworkACLPrototypeNetworkACLByRules.Builder() + .name("my-network-acl") .resourceGroup(resourceGroupIdentityModel) - .size(Long.valueOf("200")) - .zone(zoneIdentityModel) + .vpc(vpcIdentityModel) + .rules(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)) .build(); - // Construct an instance of the CreateShareOptions model - CreateShareOptions createShareOptionsModel = new CreateShareOptions.Builder() - .sharePrototype(sharePrototypeModel) + // Construct an instance of the CreateNetworkAclOptions model + CreateNetworkAclOptions createNetworkAclOptionsModel = new CreateNetworkAclOptions.Builder() + .networkAclPrototype(networkAclPrototypeModel) .build(); - // Invoke createShare() with a valid options model and verify the result - Response response = vpcService.createShare(createShareOptionsModel).execute(); + // Invoke createNetworkAcl() with a valid options model and verify the result + Response response = vpcService.createNetworkAcl(createNetworkAclOptionsModel).execute(); assertNotNull(response); - Share responseObj = response.getResult(); + NetworkACL responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18137,53 +19289,51 @@ public void testCreateShareWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSharePath); + assertEquals(parsedPath, createNetworkAclPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createShare operation with and without retries enabled + // Test the createNetworkAcl operation with and without retries enabled @Test - public void testCreateShareWRetries() throws Throwable { + public void testCreateNetworkAclWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateShareWOptions(); + testCreateNetworkAclWOptions(); vpcService.disableRetries(); - testCreateShareWOptions(); + testCreateNetworkAclWOptions(); } - // Test the createShare operation with a null options model (negative test) + // Test the createNetworkAcl operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateShareNoOptions() throws Throwable { + public void testCreateNetworkAclNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createShare(null).execute(); + vpcService.createNetworkAcl(null).execute(); } - // Test the deleteShare operation with a valid options model parameter + // Test the deleteNetworkAcl operation with a valid options model parameter @Test - public void testDeleteShareWOptions() throws Throwable { + public void testDeleteNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_transit_encryption_modes\": [\"none\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String deleteSharePath = "/shares/testString"; + String mockResponseBody = ""; + String deleteNetworkAclPath = "/network_acls/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteShareOptions model - DeleteShareOptions deleteShareOptionsModel = new DeleteShareOptions.Builder() + // Construct an instance of the DeleteNetworkAclOptions model + DeleteNetworkAclOptions deleteNetworkAclOptionsModel = new DeleteNetworkAclOptions.Builder() .id("testString") - .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") .build(); - // Invoke deleteShare() with a valid options model and verify the result - Response response = vpcService.deleteShare(deleteShareOptionsModel).execute(); + // Invoke deleteNetworkAcl() with a valid options model and verify the result + Response response = vpcService.deleteNetworkAcl(deleteNetworkAclOptionsModel).execute(); assertNotNull(response); - Share responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -18191,51 +19341,51 @@ public void testDeleteShareWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSharePath); + assertEquals(parsedPath, deleteNetworkAclPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteShare operation with and without retries enabled + // Test the deleteNetworkAcl operation with and without retries enabled @Test - public void testDeleteShareWRetries() throws Throwable { + public void testDeleteNetworkAclWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteShareWOptions(); + testDeleteNetworkAclWOptions(); vpcService.disableRetries(); - testDeleteShareWOptions(); + testDeleteNetworkAclWOptions(); } - // Test the deleteShare operation with a null options model (negative test) + // Test the deleteNetworkAcl operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteShareNoOptions() throws Throwable { + public void testDeleteNetworkAclNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteShare(null).execute(); + vpcService.deleteNetworkAcl(null).execute(); } - // Test the getShare operation with a valid options model parameter + // Test the getNetworkAcl operation with a valid options model parameter @Test - public void testGetShareWOptions() throws Throwable { + public void testGetNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_transit_encryption_modes\": [\"none\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getSharePath = "/shares/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getNetworkAclPath = "/network_acls/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetShareOptions model - GetShareOptions getShareOptionsModel = new GetShareOptions.Builder() + // Construct an instance of the GetNetworkAclOptions model + GetNetworkAclOptions getNetworkAclOptionsModel = new GetNetworkAclOptions.Builder() .id("testString") .build(); - // Invoke getShare() with a valid options model and verify the result - Response response = vpcService.getShare(getShareOptionsModel).execute(); + // Invoke getNetworkAcl() with a valid options model and verify the result + Response response = vpcService.getNetworkAcl(getNetworkAclOptionsModel).execute(); assertNotNull(response); - Share responseObj = response.getResult(); + NetworkACL responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18244,71 +19394,58 @@ public void testGetShareWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSharePath); + assertEquals(parsedPath, getNetworkAclPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getShare operation with and without retries enabled + // Test the getNetworkAcl operation with and without retries enabled @Test - public void testGetShareWRetries() throws Throwable { + public void testGetNetworkAclWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetShareWOptions(); + testGetNetworkAclWOptions(); vpcService.disableRetries(); - testGetShareWOptions(); + testGetNetworkAclWOptions(); } - // Test the getShare operation with a null options model (negative test) + // Test the getNetworkAcl operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetShareNoOptions() throws Throwable { + public void testGetNetworkAclNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getShare(null).execute(); + vpcService.getNetworkAcl(null).execute(); } - // Test the updateShare operation with a valid options model parameter + // Test the updateNetworkAcl operation with a valid options model parameter @Test - public void testUpdateShareWOptions() throws Throwable { + public void testUpdateNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_transit_encryption_modes\": [\"none\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateSharePath = "/shares/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String updateNetworkAclPath = "/network_acls/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ShareProfileIdentityByName model - ShareProfileIdentityByName shareProfileIdentityModel = new ShareProfileIdentityByName.Builder() - .name("tier-3iops") - .build(); - - // Construct an instance of the SharePatch model - SharePatch sharePatchModel = new SharePatch.Builder() - .accessControlMode("security_group") - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) - .iops(Long.valueOf("100")) - .name("my-share") - .profile(shareProfileIdentityModel) - .replicationCronSpec("0 */5 * * *") - .size(Long.valueOf("8000")) - .userTags(java.util.Arrays.asList("testString")) + // Construct an instance of the NetworkACLPatch model + NetworkACLPatch networkAclPatchModel = new NetworkACLPatch.Builder() + .name("my-network-acl-updated") .build(); - Map sharePatchModelAsPatch = sharePatchModel.asPatch(); + Map networkAclPatchModelAsPatch = networkAclPatchModel.asPatch(); - // Construct an instance of the UpdateShareOptions model - UpdateShareOptions updateShareOptionsModel = new UpdateShareOptions.Builder() + // Construct an instance of the UpdateNetworkAclOptions model + UpdateNetworkAclOptions updateNetworkAclOptionsModel = new UpdateNetworkAclOptions.Builder() .id("testString") - .sharePatch(sharePatchModelAsPatch) - .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") + .networkAclPatch(networkAclPatchModelAsPatch) .build(); - // Invoke updateShare() with a valid options model and verify the result - Response response = vpcService.updateShare(updateShareOptionsModel).execute(); + // Invoke updateNetworkAcl() with a valid options model and verify the result + Response response = vpcService.updateNetworkAcl(updateNetworkAclOptionsModel).execute(); assertNotNull(response); - Share responseObj = response.getResult(); + NetworkACL responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18317,53 +19454,54 @@ public void testUpdateShareWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateSharePath); + assertEquals(parsedPath, updateNetworkAclPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateShare operation with and without retries enabled + // Test the updateNetworkAcl operation with and without retries enabled @Test - public void testUpdateShareWRetries() throws Throwable { + public void testUpdateNetworkAclWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateShareWOptions(); + testUpdateNetworkAclWOptions(); vpcService.disableRetries(); - testUpdateShareWOptions(); + testUpdateNetworkAclWOptions(); } - // Test the updateShare operation with a null options model (negative test) + // Test the updateNetworkAcl operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateShareNoOptions() throws Throwable { + public void testUpdateNetworkAclNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateShare(null).execute(); + vpcService.updateNetworkAcl(null).execute(); } - // Test the listShareAccessorBindings operation with a valid options model parameter + // Test the listNetworkAclRules operation with a valid options model parameter @Test - public void testListShareAccessorBindingsWOptions() throws Throwable { + public void testListNetworkAclRulesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accessor_bindings\": [{\"accessor\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"lifecycle_state\": \"stable\", \"resource_type\": \"share_accessor_binding\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listShareAccessorBindingsPath = "/shares/testString/accessor_bindings"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}], \"total_count\": 132}"; + String listNetworkAclRulesPath = "/network_acls/testString/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListShareAccessorBindingsOptions model - ListShareAccessorBindingsOptions listShareAccessorBindingsOptionsModel = new ListShareAccessorBindingsOptions.Builder() - .id("testString") + // Construct an instance of the ListNetworkAclRulesOptions model + ListNetworkAclRulesOptions listNetworkAclRulesOptionsModel = new ListNetworkAclRulesOptions.Builder() + .networkAclId("testString") .start("testString") .limit(Long.valueOf("10")) + .direction("inbound") .build(); - // Invoke listShareAccessorBindings() with a valid options model and verify the result - Response response = vpcService.listShareAccessorBindings(listShareAccessorBindingsOptionsModel).execute(); + // Invoke listNetworkAclRules() with a valid options model and verify the result + Response response = vpcService.listNetworkAclRules(listNetworkAclRulesOptionsModel).execute(); assertNotNull(response); - ShareAccessorBindingCollection responseObj = response.getResult(); + NetworkACLRuleCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18372,39 +19510,40 @@ public void testListShareAccessorBindingsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listShareAccessorBindingsPath); + assertEquals(parsedPath, listNetworkAclRulesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("direction"), "inbound"); } - // Test the listShareAccessorBindings operation with and without retries enabled + // Test the listNetworkAclRules operation with and without retries enabled @Test - public void testListShareAccessorBindingsWRetries() throws Throwable { + public void testListNetworkAclRulesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListShareAccessorBindingsWOptions(); + testListNetworkAclRulesWOptions(); vpcService.disableRetries(); - testListShareAccessorBindingsWOptions(); + testListNetworkAclRulesWOptions(); } - // Test the listShareAccessorBindings operation with a null options model (negative test) + // Test the listNetworkAclRules operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListShareAccessorBindingsNoOptions() throws Throwable { + public void testListNetworkAclRulesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listShareAccessorBindings(null).execute(); + vpcService.listNetworkAclRules(null).execute(); } - // Test the listShareAccessorBindings operation using the ShareAccessorBindingsPager.getNext() method + // Test the listNetworkAclRules operation using the NetworkAclRulesPager.getNext() method @Test - public void testListShareAccessorBindingsWithPagerGetNext() throws Throwable { + public void testListNetworkAclRulesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"accessor_bindings\":[{\"accessor\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"lifecycle_state\":\"stable\",\"resource_type\":\"share_accessor_binding\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"accessor_bindings\":[{\"accessor\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"lifecycle_state\":\"stable\",\"resource_type\":\"share_accessor_binding\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"any\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"any\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -18418,27 +19557,28 @@ public void testListShareAccessorBindingsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListShareAccessorBindingsOptions listShareAccessorBindingsOptions = new ListShareAccessorBindingsOptions.Builder() - .id("testString") + ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() + .networkAclId("testString") .limit(Long.valueOf("10")) + .direction("inbound") .build(); - List allResults = new ArrayList<>(); - ShareAccessorBindingsPager pager = new ShareAccessorBindingsPager(vpcService, listShareAccessorBindingsOptions); + List allResults = new ArrayList<>(); + NetworkAclRulesPager pager = new NetworkAclRulesPager(vpcService, listNetworkAclRulesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listShareAccessorBindings operation using the ShareAccessorBindingsPager.getAll() method + // Test the listNetworkAclRules operation using the NetworkAclRulesPager.getAll() method @Test - public void testListShareAccessorBindingsWithPagerGetAll() throws Throwable { + public void testListNetworkAclRulesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"accessor_bindings\":[{\"accessor\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"lifecycle_state\":\"stable\",\"resource_type\":\"share_accessor_binding\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"accessor_bindings\":[{\"accessor\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"lifecycle_state\":\"stable\",\"resource_type\":\"share_accessor_binding\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"any\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"any\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -18452,35 +19592,107 @@ public void testListShareAccessorBindingsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListShareAccessorBindingsOptions listShareAccessorBindingsOptions = new ListShareAccessorBindingsOptions.Builder() - .id("testString") + ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() + .networkAclId("testString") .limit(Long.valueOf("10")) + .direction("inbound") .build(); - ShareAccessorBindingsPager pager = new ShareAccessorBindingsPager(vpcService, listShareAccessorBindingsOptions); - List allResults = pager.getAll(); + NetworkAclRulesPager pager = new NetworkAclRulesPager(vpcService, listNetworkAclRulesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the deleteShareAccessorBinding operation with a valid options model parameter + // Test the createNetworkAclRule operation with a valid options model parameter @Test - public void testDeleteShareAccessorBindingWOptions() throws Throwable { + public void testCreateNetworkAclRuleWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}"; + String createNetworkAclRulePath = "/network_acls/testString/rules"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() + .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); + + // Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype model + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("any") + .build(); + + // Construct an instance of the CreateNetworkAclRuleOptions model + CreateNetworkAclRuleOptions createNetworkAclRuleOptionsModel = new CreateNetworkAclRuleOptions.Builder() + .networkAclId("testString") + .networkAclRulePrototype(networkAclRulePrototypeModel) + .build(); + + // Invoke createNetworkAclRule() with a valid options model and verify the result + Response response = vpcService.createNetworkAclRule(createNetworkAclRuleOptionsModel).execute(); + assertNotNull(response); + NetworkACLRule responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createNetworkAclRulePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createNetworkAclRule operation with and without retries enabled + @Test + public void testCreateNetworkAclRuleWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateNetworkAclRuleWOptions(); + + vpcService.disableRetries(); + testCreateNetworkAclRuleWOptions(); + } + + // Test the createNetworkAclRule operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateNetworkAclRuleNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createNetworkAclRule(null).execute(); + } + + // Test the deleteNetworkAclRule operation with a valid options model parameter + @Test + public void testDeleteNetworkAclRuleWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteShareAccessorBindingPath = "/shares/testString/accessor_bindings/testString"; + String deleteNetworkAclRulePath = "/network_acls/testString/rules/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteShareAccessorBindingOptions model - DeleteShareAccessorBindingOptions deleteShareAccessorBindingOptionsModel = new DeleteShareAccessorBindingOptions.Builder() - .shareId("testString") + // Construct an instance of the DeleteNetworkAclRuleOptions model + DeleteNetworkAclRuleOptions deleteNetworkAclRuleOptionsModel = new DeleteNetworkAclRuleOptions.Builder() + .networkAclId("testString") .id("testString") .build(); - // Invoke deleteShareAccessorBinding() with a valid options model and verify the result - Response response = vpcService.deleteShareAccessorBinding(deleteShareAccessorBindingOptionsModel).execute(); + // Invoke deleteNetworkAclRule() with a valid options model and verify the result + Response response = vpcService.deleteNetworkAclRule(deleteNetworkAclRuleOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -18491,52 +19703,52 @@ public void testDeleteShareAccessorBindingWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteShareAccessorBindingPath); + assertEquals(parsedPath, deleteNetworkAclRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteShareAccessorBinding operation with and without retries enabled + // Test the deleteNetworkAclRule operation with and without retries enabled @Test - public void testDeleteShareAccessorBindingWRetries() throws Throwable { + public void testDeleteNetworkAclRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteShareAccessorBindingWOptions(); + testDeleteNetworkAclRuleWOptions(); vpcService.disableRetries(); - testDeleteShareAccessorBindingWOptions(); + testDeleteNetworkAclRuleWOptions(); } - // Test the deleteShareAccessorBinding operation with a null options model (negative test) + // Test the deleteNetworkAclRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteShareAccessorBindingNoOptions() throws Throwable { + public void testDeleteNetworkAclRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteShareAccessorBinding(null).execute(); + vpcService.deleteNetworkAclRule(null).execute(); } - // Test the getShareAccessorBinding operation with a valid options model parameter + // Test the getNetworkAclRule operation with a valid options model parameter @Test - public void testGetShareAccessorBindingWOptions() throws Throwable { + public void testGetNetworkAclRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accessor\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"lifecycle_state\": \"stable\", \"resource_type\": \"share_accessor_binding\"}"; - String getShareAccessorBindingPath = "/shares/testString/accessor_bindings/testString"; + String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}"; + String getNetworkAclRulePath = "/network_acls/testString/rules/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetShareAccessorBindingOptions model - GetShareAccessorBindingOptions getShareAccessorBindingOptionsModel = new GetShareAccessorBindingOptions.Builder() - .shareId("testString") + // Construct an instance of the GetNetworkAclRuleOptions model + GetNetworkAclRuleOptions getNetworkAclRuleOptionsModel = new GetNetworkAclRuleOptions.Builder() + .networkAclId("testString") .id("testString") .build(); - // Invoke getShareAccessorBinding() with a valid options model and verify the result - Response response = vpcService.getShareAccessorBinding(getShareAccessorBindingOptionsModel).execute(); + // Invoke getNetworkAclRule() with a valid options model and verify the result + Response response = vpcService.getNetworkAclRule(getNetworkAclRuleOptionsModel).execute(); assertNotNull(response); - ShareAccessorBinding responseObj = response.getResult(); + NetworkACLRule responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18545,108 +19757,129 @@ public void testGetShareAccessorBindingWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getShareAccessorBindingPath); + assertEquals(parsedPath, getNetworkAclRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getShareAccessorBinding operation with and without retries enabled + // Test the getNetworkAclRule operation with and without retries enabled @Test - public void testGetShareAccessorBindingWRetries() throws Throwable { + public void testGetNetworkAclRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetShareAccessorBindingWOptions(); + testGetNetworkAclRuleWOptions(); vpcService.disableRetries(); - testGetShareAccessorBindingWOptions(); + testGetNetworkAclRuleWOptions(); } - // Test the getShareAccessorBinding operation with a null options model (negative test) + // Test the getNetworkAclRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetShareAccessorBindingNoOptions() throws Throwable { + public void testGetNetworkAclRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getShareAccessorBinding(null).execute(); + vpcService.getNetworkAclRule(null).execute(); } - // Test the failoverShare operation with a valid options model parameter + // Test the updateNetworkAclRule operation with a valid options model parameter @Test - public void testFailoverShareWOptions() throws Throwable { + public void testUpdateNetworkAclRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String failoverSharePath = "/shares/testString/failover"; + String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}"; + String updateNetworkAclRulePath = "/network_acls/testString/rules/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the FailoverShareOptions model - FailoverShareOptions failoverShareOptionsModel = new FailoverShareOptions.Builder() - .shareId("testString") - .fallbackPolicy("fail") - .timeout(Long.valueOf("600")) + // Construct an instance of the NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model + NetworkACLRuleBeforePatchNetworkACLRuleIdentityById networkAclRuleBeforePatchModel = new NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.Builder() + .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") .build(); - // Invoke failoverShare() with a valid options model and verify the result - Response response = vpcService.failoverShare(failoverShareOptionsModel).execute(); + // Construct an instance of the NetworkACLRulePatch model + NetworkACLRulePatch networkAclRulePatchModel = new NetworkACLRulePatch.Builder() + .action("allow") + .before(networkAclRuleBeforePatchModel) + .code(Long.valueOf("0")) + .destination("192.168.3.2/32") + .destinationPortMax(Long.valueOf("22")) + .destinationPortMin(Long.valueOf("22")) + .direction("inbound") + .name("my-network-acl-rule") + .source("10.0.0.0/0") + .sourcePortMax(Long.valueOf("65535")) + .sourcePortMin(Long.valueOf("49152")) + .type(Long.valueOf("8")) + .build(); + Map networkAclRulePatchModelAsPatch = networkAclRulePatchModel.asPatch(); + + // Construct an instance of the UpdateNetworkAclRuleOptions model + UpdateNetworkAclRuleOptions updateNetworkAclRuleOptionsModel = new UpdateNetworkAclRuleOptions.Builder() + .networkAclId("testString") + .id("testString") + .networkAclRulePatch(networkAclRulePatchModelAsPatch) + .build(); + + // Invoke updateNetworkAclRule() with a valid options model and verify the result + Response response = vpcService.updateNetworkAclRule(updateNetworkAclRuleOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + NetworkACLRule responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, failoverSharePath); + assertEquals(parsedPath, updateNetworkAclRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the failoverShare operation with and without retries enabled + // Test the updateNetworkAclRule operation with and without retries enabled @Test - public void testFailoverShareWRetries() throws Throwable { + public void testUpdateNetworkAclRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testFailoverShareWOptions(); + testUpdateNetworkAclRuleWOptions(); vpcService.disableRetries(); - testFailoverShareWOptions(); + testUpdateNetworkAclRuleWOptions(); } - // Test the failoverShare operation with a null options model (negative test) + // Test the updateNetworkAclRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testFailoverShareNoOptions() throws Throwable { + public void testUpdateNetworkAclRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.failoverShare(null).execute(); + vpcService.updateNetworkAclRule(null).execute(); } - // Test the listShareMountTargets operation with a valid options model parameter + // Test the listPlacementGroups operation with a valid options model parameter @Test - public void testListShareMountTargetsWOptions() throws Throwable { + public void testListPlacementGroupsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"mount_targets\": [{\"access_control_mode\": \"security_group\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listShareMountTargetsPath = "/shares/testString/mount_targets"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"placement_groups\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"id\": \"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"lifecycle_state\": \"stable\", \"name\": \"my-placement-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"placement_group\", \"strategy\": \"host_spread\"}], \"total_count\": 132}"; + String listPlacementGroupsPath = "/placement_groups"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListShareMountTargetsOptions model - ListShareMountTargetsOptions listShareMountTargetsOptionsModel = new ListShareMountTargetsOptions.Builder() - .shareId("testString") - .name("my-name") + // Construct an instance of the ListPlacementGroupsOptions model + ListPlacementGroupsOptions listPlacementGroupsOptionsModel = new ListPlacementGroupsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .build(); - // Invoke listShareMountTargets() with a valid options model and verify the result - Response response = vpcService.listShareMountTargets(listShareMountTargetsOptionsModel).execute(); + // Invoke listPlacementGroups() with a valid options model and verify the result + Response response = vpcService.listPlacementGroups(listPlacementGroupsOptionsModel).execute(); assertNotNull(response); - ShareMountTargetCollection responseObj = response.getResult(); + PlacementGroupCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18655,40 +19888,32 @@ public void testListShareMountTargetsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listShareMountTargetsPath); + assertEquals(parsedPath, listPlacementGroupsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("name"), "my-name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listShareMountTargets operation with and without retries enabled + // Test the listPlacementGroups operation with and without retries enabled @Test - public void testListShareMountTargetsWRetries() throws Throwable { + public void testListPlacementGroupsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListShareMountTargetsWOptions(); + testListPlacementGroupsWOptions(); vpcService.disableRetries(); - testListShareMountTargetsWOptions(); - } - - // Test the listShareMountTargets operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListShareMountTargetsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listShareMountTargets(null).execute(); + testListPlacementGroupsWOptions(); } - // Test the listShareMountTargets operation using the ShareMountTargetsPager.getNext() method + // Test the listPlacementGroups operation using the PlacementGroupsPager.getNext() method @Test - public void testListShareMountTargetsWithPagerGetNext() throws Throwable { + public void testListPlacementGroupsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"mount_targets\":[{\"access_control_mode\":\"security_group\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"lifecycle_state\":\"stable\",\"mount_path\":\"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\",\"name\":\"my-share-mount-target\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"share_mount_target\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"transit_encryption\":\"none\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"mount_targets\":[{\"access_control_mode\":\"security_group\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"lifecycle_state\":\"stable\",\"mount_path\":\"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\",\"name\":\"my-share-mount-target\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"share_mount_target\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"transit_encryption\":\"none\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -18702,28 +19927,26 @@ public void testListShareMountTargetsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListShareMountTargetsOptions listShareMountTargetsOptions = new ListShareMountTargetsOptions.Builder() - .shareId("testString") - .name("my-name") + ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() .limit(Long.valueOf("10")) .build(); - List allResults = new ArrayList<>(); - ShareMountTargetsPager pager = new ShareMountTargetsPager(vpcService, listShareMountTargetsOptions); + List allResults = new ArrayList<>(); + PlacementGroupsPager pager = new PlacementGroupsPager(vpcService, listPlacementGroupsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listShareMountTargets operation using the ShareMountTargetsPager.getAll() method + // Test the listPlacementGroups operation using the PlacementGroupsPager.getAll() method @Test - public void testListShareMountTargetsWithPagerGetAll() throws Throwable { + public void testListPlacementGroupsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"mount_targets\":[{\"access_control_mode\":\"security_group\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"lifecycle_state\":\"stable\",\"mount_path\":\"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\",\"name\":\"my-share-mount-target\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"share_mount_target\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"transit_encryption\":\"none\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"mount_targets\":[{\"access_control_mode\":\"security_group\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"lifecycle_state\":\"stable\",\"mount_path\":\"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\",\"name\":\"my-share-mount-target\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"share_mount_target\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"transit_encryption\":\"none\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"placement_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"id\":\"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\",\"lifecycle_state\":\"stable\",\"name\":\"my-placement-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"placement_group\",\"strategy\":\"host_spread\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -18737,89 +19960,43 @@ public void testListShareMountTargetsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListShareMountTargetsOptions listShareMountTargetsOptions = new ListShareMountTargetsOptions.Builder() - .shareId("testString") - .name("my-name") + ListPlacementGroupsOptions listPlacementGroupsOptions = new ListPlacementGroupsOptions.Builder() .limit(Long.valueOf("10")) .build(); - ShareMountTargetsPager pager = new ShareMountTargetsPager(vpcService, listShareMountTargetsOptions); - List allResults = pager.getAll(); + PlacementGroupsPager pager = new PlacementGroupsPager(vpcService, listPlacementGroupsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createShareMountTarget operation with a valid options model parameter + // Test the createPlacementGroup operation with a valid options model parameter @Test - public void testCreateShareMountTargetWOptions() throws Throwable { + public void testCreatePlacementGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String createShareMountTargetPath = "/shares/testString/mount_targets"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model - VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); - - // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-reserved-ip") - .build(); + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"id\": \"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"lifecycle_state\": \"stable\", \"name\": \"my-placement-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"placement_group\", \"strategy\": \"host_spread\"}"; + String createPlacementGroupPath = "/placement_groups"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); // Construct an instance of the ResourceGroupIdentityById model ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model - ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext shareMountTargetVirtualNetworkInterfacePrototypeModel = new ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") + // Construct an instance of the CreatePlacementGroupOptions model + CreatePlacementGroupOptions createPlacementGroupOptionsModel = new CreatePlacementGroupOptions.Builder() + .strategy("host_spread") + .name("my-placement-group") .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) - .build(); - - // Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model - ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() - .name("my-share-mount-target") - .transitEncryption("none") - .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) - .build(); - - // Construct an instance of the CreateShareMountTargetOptions model - CreateShareMountTargetOptions createShareMountTargetOptionsModel = new CreateShareMountTargetOptions.Builder() - .shareId("testString") - .shareMountTargetPrototype(shareMountTargetPrototypeModel) .build(); - // Invoke createShareMountTarget() with a valid options model and verify the result - Response response = vpcService.createShareMountTarget(createShareMountTargetOptionsModel).execute(); + // Invoke createPlacementGroup() with a valid options model and verify the result + Response response = vpcService.createPlacementGroup(createPlacementGroupOptionsModel).execute(); assertNotNull(response); - ShareMountTarget responseObj = response.getResult(); + PlacementGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18828,53 +20005,51 @@ public void testCreateShareMountTargetWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createShareMountTargetPath); + assertEquals(parsedPath, createPlacementGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createShareMountTarget operation with and without retries enabled + // Test the createPlacementGroup operation with and without retries enabled @Test - public void testCreateShareMountTargetWRetries() throws Throwable { + public void testCreatePlacementGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateShareMountTargetWOptions(); + testCreatePlacementGroupWOptions(); vpcService.disableRetries(); - testCreateShareMountTargetWOptions(); + testCreatePlacementGroupWOptions(); } - // Test the createShareMountTarget operation with a null options model (negative test) + // Test the createPlacementGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateShareMountTargetNoOptions() throws Throwable { + public void testCreatePlacementGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createShareMountTarget(null).execute(); + vpcService.createPlacementGroup(null).execute(); } - // Test the deleteShareMountTarget operation with a valid options model parameter + // Test the deletePlacementGroup operation with a valid options model parameter @Test - public void testDeleteShareMountTargetWOptions() throws Throwable { + public void testDeletePlacementGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String deleteShareMountTargetPath = "/shares/testString/mount_targets/testString"; + String mockResponseBody = ""; + String deletePlacementGroupPath = "/placement_groups/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteShareMountTargetOptions model - DeleteShareMountTargetOptions deleteShareMountTargetOptionsModel = new DeleteShareMountTargetOptions.Builder() - .shareId("testString") + // Construct an instance of the DeletePlacementGroupOptions model + DeletePlacementGroupOptions deletePlacementGroupOptionsModel = new DeletePlacementGroupOptions.Builder() .id("testString") .build(); - // Invoke deleteShareMountTarget() with a valid options model and verify the result - Response response = vpcService.deleteShareMountTarget(deleteShareMountTargetOptionsModel).execute(); + // Invoke deletePlacementGroup() with a valid options model and verify the result + Response response = vpcService.deletePlacementGroup(deletePlacementGroupOptionsModel).execute(); assertNotNull(response); - ShareMountTarget responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -18882,52 +20057,51 @@ public void testDeleteShareMountTargetWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteShareMountTargetPath); + assertEquals(parsedPath, deletePlacementGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteShareMountTarget operation with and without retries enabled + // Test the deletePlacementGroup operation with and without retries enabled @Test - public void testDeleteShareMountTargetWRetries() throws Throwable { + public void testDeletePlacementGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteShareMountTargetWOptions(); + testDeletePlacementGroupWOptions(); vpcService.disableRetries(); - testDeleteShareMountTargetWOptions(); + testDeletePlacementGroupWOptions(); } - // Test the deleteShareMountTarget operation with a null options model (negative test) + // Test the deletePlacementGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteShareMountTargetNoOptions() throws Throwable { + public void testDeletePlacementGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteShareMountTarget(null).execute(); + vpcService.deletePlacementGroup(null).execute(); } - // Test the getShareMountTarget operation with a valid options model parameter + // Test the getPlacementGroup operation with a valid options model parameter @Test - public void testGetShareMountTargetWOptions() throws Throwable { + public void testGetPlacementGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getShareMountTargetPath = "/shares/testString/mount_targets/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"id\": \"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"lifecycle_state\": \"stable\", \"name\": \"my-placement-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"placement_group\", \"strategy\": \"host_spread\"}"; + String getPlacementGroupPath = "/placement_groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetShareMountTargetOptions model - GetShareMountTargetOptions getShareMountTargetOptionsModel = new GetShareMountTargetOptions.Builder() - .shareId("testString") + // Construct an instance of the GetPlacementGroupOptions model + GetPlacementGroupOptions getPlacementGroupOptionsModel = new GetPlacementGroupOptions.Builder() .id("testString") .build(); - // Invoke getShareMountTarget() with a valid options model and verify the result - Response response = vpcService.getShareMountTarget(getShareMountTargetOptionsModel).execute(); + // Invoke getPlacementGroup() with a valid options model and verify the result + Response response = vpcService.getPlacementGroup(getPlacementGroupOptionsModel).execute(); assertNotNull(response); - ShareMountTarget responseObj = response.getResult(); + PlacementGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18936,59 +20110,58 @@ public void testGetShareMountTargetWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getShareMountTargetPath); + assertEquals(parsedPath, getPlacementGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getShareMountTarget operation with and without retries enabled + // Test the getPlacementGroup operation with and without retries enabled @Test - public void testGetShareMountTargetWRetries() throws Throwable { + public void testGetPlacementGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetShareMountTargetWOptions(); + testGetPlacementGroupWOptions(); vpcService.disableRetries(); - testGetShareMountTargetWOptions(); + testGetPlacementGroupWOptions(); } - // Test the getShareMountTarget operation with a null options model (negative test) + // Test the getPlacementGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetShareMountTargetNoOptions() throws Throwable { + public void testGetPlacementGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getShareMountTarget(null).execute(); + vpcService.getPlacementGroup(null).execute(); } - // Test the updateShareMountTarget operation with a valid options model parameter + // Test the updatePlacementGroup operation with a valid options model parameter @Test - public void testUpdateShareMountTargetWOptions() throws Throwable { + public void testUpdatePlacementGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String updateShareMountTargetPath = "/shares/testString/mount_targets/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"id\": \"r006-418fe842-a3e9-47b9-a938-1aa5bd632871\", \"lifecycle_state\": \"stable\", \"name\": \"my-placement-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"placement_group\", \"strategy\": \"host_spread\"}"; + String updatePlacementGroupPath = "/placement_groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ShareMountTargetPatch model - ShareMountTargetPatch shareMountTargetPatchModel = new ShareMountTargetPatch.Builder() - .name("my-share-mount-target") + // Construct an instance of the PlacementGroupPatch model + PlacementGroupPatch placementGroupPatchModel = new PlacementGroupPatch.Builder() + .name("my-placement-group-updated") .build(); - Map shareMountTargetPatchModelAsPatch = shareMountTargetPatchModel.asPatch(); + Map placementGroupPatchModelAsPatch = placementGroupPatchModel.asPatch(); - // Construct an instance of the UpdateShareMountTargetOptions model - UpdateShareMountTargetOptions updateShareMountTargetOptionsModel = new UpdateShareMountTargetOptions.Builder() - .shareId("testString") + // Construct an instance of the UpdatePlacementGroupOptions model + UpdatePlacementGroupOptions updatePlacementGroupOptionsModel = new UpdatePlacementGroupOptions.Builder() .id("testString") - .shareMountTargetPatch(shareMountTargetPatchModelAsPatch) + .placementGroupPatch(placementGroupPatchModelAsPatch) .build(); - // Invoke updateShareMountTarget() with a valid options model and verify the result - Response response = vpcService.updateShareMountTarget(updateShareMountTargetOptionsModel).execute(); + // Invoke updatePlacementGroup() with a valid options model and verify the result + Response response = vpcService.updatePlacementGroup(updatePlacementGroupOptionsModel).execute(); assertNotNull(response); - ShareMountTarget responseObj = response.getResult(); + PlacementGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -18997,56 +20170,53 @@ public void testUpdateShareMountTargetWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateShareMountTargetPath); + assertEquals(parsedPath, updatePlacementGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateShareMountTarget operation with and without retries enabled + // Test the updatePlacementGroup operation with and without retries enabled @Test - public void testUpdateShareMountTargetWRetries() throws Throwable { + public void testUpdatePlacementGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateShareMountTargetWOptions(); + testUpdatePlacementGroupWOptions(); vpcService.disableRetries(); - testUpdateShareMountTargetWOptions(); + testUpdatePlacementGroupWOptions(); } - // Test the updateShareMountTarget operation with a null options model (negative test) + // Test the updatePlacementGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateShareMountTargetNoOptions() throws Throwable { + public void testUpdatePlacementGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateShareMountTarget(null).execute(); + vpcService.updatePlacementGroup(null).execute(); } - // Test the listShareSnapshots operation with a valid options model parameter + // Test the listPrivatePathServiceGateways operation with a valid options model parameter @Test - public void testListShareSnapshotsWOptions() throws Throwable { + public void testListPrivatePathServiceGatewaysWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"snapshots\": [{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; - String listShareSnapshotsPath = "/shares/testString/snapshots"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"private_path_service_gateways\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"default_access_policy\": \"deny\", \"endpoint_gateway_binding_auto_delete\": true, \"endpoint_gateway_binding_auto_delete_timeout\": 1, \"endpoint_gateway_count\": 0, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"lifecycle_state\": \"stable\", \"load_balancer\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"name\": \"my-load-balancer\", \"resource_type\": \"load_balancer\"}, \"name\": \"my-private-path-service-gateway\", \"published\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"private_path_service_gateway\", \"service_endpoints\": [\"*.example.com\"], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zonal_affinity\": false}], \"total_count\": 132}"; + String listPrivatePathServiceGatewaysPath = "/private_path_service_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListShareSnapshotsOptions model - ListShareSnapshotsOptions listShareSnapshotsOptionsModel = new ListShareSnapshotsOptions.Builder() - .shareId("testString") - .backupPolicyPlanId("testString") - .name("my-name") + // Construct an instance of the ListPrivatePathServiceGatewaysOptions model + ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptionsModel = new ListPrivatePathServiceGatewaysOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .sort("name") + .resourceGroupId("testString") .build(); - // Invoke listShareSnapshots() with a valid options model and verify the result - Response response = vpcService.listShareSnapshots(listShareSnapshotsOptionsModel).execute(); + // Invoke listPrivatePathServiceGateways() with a valid options model and verify the result + Response response = vpcService.listPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptionsModel).execute(); assertNotNull(response); - ShareSnapshotCollection responseObj = response.getResult(); + PrivatePathServiceGatewayCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -19055,42 +20225,33 @@ public void testListShareSnapshotsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listShareSnapshotsPath); + assertEquals(parsedPath, listPrivatePathServiceGatewaysPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("backup_policy_plan.id"), "testString"); - assertEquals(query.get("name"), "my-name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("sort"), "name"); + assertEquals(query.get("resource_group.id"), "testString"); } - // Test the listShareSnapshots operation with and without retries enabled + // Test the listPrivatePathServiceGateways operation with and without retries enabled @Test - public void testListShareSnapshotsWRetries() throws Throwable { + public void testListPrivatePathServiceGatewaysWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListShareSnapshotsWOptions(); + testListPrivatePathServiceGatewaysWOptions(); vpcService.disableRetries(); - testListShareSnapshotsWOptions(); - } - - // Test the listShareSnapshots operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListShareSnapshotsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listShareSnapshots(null).execute(); + testListPrivatePathServiceGatewaysWOptions(); } - // Test the listShareSnapshots operation using the ShareSnapshotsPager.getNext() method + // Test the listPrivatePathServiceGateways operation using the PrivatePathServiceGatewaysPager.getNext() method @Test - public void testListShareSnapshotsWithPagerGetNext() throws Throwable { + public void testListPrivatePathServiceGatewaysWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"fingerprint\":\"7abc3aef-c2bc-4f65-a296-2928e534d498\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"minimum_size\":10,\"name\":\"my-share-snapshot\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share_snapshot\",\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"fingerprint\":\"7abc3aef-c2bc-4f65-a296-2928e534d498\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"minimum_size\":10,\"name\":\"my-share-snapshot\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share_snapshot\",\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"private_path_service_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"default_access_policy\":\"deny\",\"endpoint_gateway_binding_auto_delete\":true,\"endpoint_gateway_binding_auto_delete_timeout\":1,\"endpoint_gateway_count\":0,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"lifecycle_state\":\"stable\",\"load_balancer\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"name\":\"my-load-balancer\",\"resource_type\":\"load_balancer\"},\"name\":\"my-private-path-service-gateway\",\"published\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"private_path_service_gateway\",\"service_endpoints\":[\"*.example.com\"],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zonal_affinity\":false}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"private_path_service_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"default_access_policy\":\"deny\",\"endpoint_gateway_binding_auto_delete\":true,\"endpoint_gateway_binding_auto_delete_timeout\":1,\"endpoint_gateway_count\":0,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"lifecycle_state\":\"stable\",\"load_balancer\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"name\":\"my-load-balancer\",\"resource_type\":\"load_balancer\"},\"name\":\"my-private-path-service-gateway\",\"published\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"private_path_service_gateway\",\"service_endpoints\":[\"*.example.com\"],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zonal_affinity\":false}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -19104,30 +20265,27 @@ public void testListShareSnapshotsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListShareSnapshotsOptions listShareSnapshotsOptions = new ListShareSnapshotsOptions.Builder() - .shareId("testString") - .backupPolicyPlanId("testString") - .name("my-name") + ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptions = new ListPrivatePathServiceGatewaysOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") + .resourceGroupId("testString") .build(); - List allResults = new ArrayList<>(); - ShareSnapshotsPager pager = new ShareSnapshotsPager(vpcService, listShareSnapshotsOptions); + List allResults = new ArrayList<>(); + PrivatePathServiceGatewaysPager pager = new PrivatePathServiceGatewaysPager(vpcService, listPrivatePathServiceGatewaysOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listShareSnapshots operation using the ShareSnapshotsPager.getAll() method + // Test the listPrivatePathServiceGateways operation using the PrivatePathServiceGatewaysPager.getAll() method @Test - public void testListShareSnapshotsWithPagerGetAll() throws Throwable { + public void testListPrivatePathServiceGatewaysWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"fingerprint\":\"7abc3aef-c2bc-4f65-a296-2928e534d498\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"minimum_size\":10,\"name\":\"my-share-snapshot\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share_snapshot\",\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"fingerprint\":\"7abc3aef-c2bc-4f65-a296-2928e534d498\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"minimum_size\":10,\"name\":\"my-share-snapshot\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share_snapshot\",\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"private_path_service_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"default_access_policy\":\"deny\",\"endpoint_gateway_binding_auto_delete\":true,\"endpoint_gateway_binding_auto_delete_timeout\":1,\"endpoint_gateway_count\":0,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"lifecycle_state\":\"stable\",\"load_balancer\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"name\":\"my-load-balancer\",\"resource_type\":\"load_balancer\"},\"name\":\"my-private-path-service-gateway\",\"published\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"private_path_service_gateway\",\"service_endpoints\":[\"*.example.com\"],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zonal_affinity\":false}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"private_path_service_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"default_access_policy\":\"deny\",\"endpoint_gateway_binding_auto_delete\":true,\"endpoint_gateway_binding_auto_delete_timeout\":1,\"endpoint_gateway_count\":0,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"lifecycle_state\":\"stable\",\"load_balancer\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"name\":\"my-load-balancer\",\"resource_type\":\"load_balancer\"},\"name\":\"my-private-path-service-gateway\",\"published\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"private_path_service_gateway\",\"service_endpoints\":[\"*.example.com\"],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zonal_affinity\":false}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -19141,42 +20299,52 @@ public void testListShareSnapshotsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListShareSnapshotsOptions listShareSnapshotsOptions = new ListShareSnapshotsOptions.Builder() - .shareId("testString") - .backupPolicyPlanId("testString") - .name("my-name") + ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptions = new ListPrivatePathServiceGatewaysOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") + .resourceGroupId("testString") .build(); - ShareSnapshotsPager pager = new ShareSnapshotsPager(vpcService, listShareSnapshotsOptions); - List allResults = pager.getAll(); + PrivatePathServiceGatewaysPager pager = new PrivatePathServiceGatewaysPager(vpcService, listPrivatePathServiceGatewaysOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createShareSnapshot operation with a valid options model parameter + // Test the createPrivatePathServiceGateway operation with a valid options model parameter @Test - public void testCreateShareSnapshotWOptions() throws Throwable { + public void testCreatePrivatePathServiceGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createShareSnapshotPath = "/shares/testString/snapshots"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"default_access_policy\": \"deny\", \"endpoint_gateway_binding_auto_delete\": true, \"endpoint_gateway_binding_auto_delete_timeout\": 1, \"endpoint_gateway_count\": 0, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"lifecycle_state\": \"stable\", \"load_balancer\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"name\": \"my-load-balancer\", \"resource_type\": \"load_balancer\"}, \"name\": \"my-private-path-service-gateway\", \"published\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"private_path_service_gateway\", \"service_endpoints\": [\"*.example.com\"], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zonal_affinity\": false}"; + String createPrivatePathServiceGatewayPath = "/private_path_service_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the CreateShareSnapshotOptions model - CreateShareSnapshotOptions createShareSnapshotOptionsModel = new CreateShareSnapshotOptions.Builder() - .shareId("testString") - .name("my-share-snapshot") - .userTags(java.util.Arrays.asList("testString")) + // Construct an instance of the LoadBalancerIdentityById model + LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() + .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") .build(); - // Invoke createShareSnapshot() with a valid options model and verify the result - Response response = vpcService.createShareSnapshot(createShareSnapshotOptionsModel).execute(); + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the CreatePrivatePathServiceGatewayOptions model + CreatePrivatePathServiceGatewayOptions createPrivatePathServiceGatewayOptionsModel = new CreatePrivatePathServiceGatewayOptions.Builder() + .loadBalancer(loadBalancerIdentityModel) + .serviceEndpoints(java.util.Arrays.asList("*.example.com")) + .defaultAccessPolicy("deny") + .name("my-private-path-service-gateway") + .resourceGroup(resourceGroupIdentityModel) + .zonalAffinity(false) + .build(); + + // Invoke createPrivatePathServiceGateway() with a valid options model and verify the result + Response response = vpcService.createPrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModel).execute(); assertNotNull(response); - ShareSnapshot responseObj = response.getResult(); + PrivatePathServiceGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -19185,53 +20353,51 @@ public void testCreateShareSnapshotWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createShareSnapshotPath); + assertEquals(parsedPath, createPrivatePathServiceGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createShareSnapshot operation with and without retries enabled + // Test the createPrivatePathServiceGateway operation with and without retries enabled @Test - public void testCreateShareSnapshotWRetries() throws Throwable { + public void testCreatePrivatePathServiceGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateShareSnapshotWOptions(); + testCreatePrivatePathServiceGatewayWOptions(); vpcService.disableRetries(); - testCreateShareSnapshotWOptions(); + testCreatePrivatePathServiceGatewayWOptions(); } - // Test the createShareSnapshot operation with a null options model (negative test) + // Test the createPrivatePathServiceGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateShareSnapshotNoOptions() throws Throwable { + public void testCreatePrivatePathServiceGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createShareSnapshot(null).execute(); + vpcService.createPrivatePathServiceGateway(null).execute(); } - // Test the deleteShareSnapshot operation with a valid options model parameter + // Test the deletePrivatePathServiceGateway operation with a valid options model parameter @Test - public void testDeleteShareSnapshotWOptions() throws Throwable { + public void testDeletePrivatePathServiceGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String deleteShareSnapshotPath = "/shares/testString/snapshots/testString"; + String mockResponseBody = ""; + String deletePrivatePathServiceGatewayPath = "/private_path_service_gateways/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteShareSnapshotOptions model - DeleteShareSnapshotOptions deleteShareSnapshotOptionsModel = new DeleteShareSnapshotOptions.Builder() - .shareId("testString") + // Construct an instance of the DeletePrivatePathServiceGatewayOptions model + DeletePrivatePathServiceGatewayOptions deletePrivatePathServiceGatewayOptionsModel = new DeletePrivatePathServiceGatewayOptions.Builder() .id("testString") .build(); - // Invoke deleteShareSnapshot() with a valid options model and verify the result - Response response = vpcService.deleteShareSnapshot(deleteShareSnapshotOptionsModel).execute(); + // Invoke deletePrivatePathServiceGateway() with a valid options model and verify the result + Response response = vpcService.deletePrivatePathServiceGateway(deletePrivatePathServiceGatewayOptionsModel).execute(); assertNotNull(response); - ShareSnapshot responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -19239,52 +20405,51 @@ public void testDeleteShareSnapshotWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteShareSnapshotPath); + assertEquals(parsedPath, deletePrivatePathServiceGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteShareSnapshot operation with and without retries enabled + // Test the deletePrivatePathServiceGateway operation with and without retries enabled @Test - public void testDeleteShareSnapshotWRetries() throws Throwable { + public void testDeletePrivatePathServiceGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteShareSnapshotWOptions(); + testDeletePrivatePathServiceGatewayWOptions(); vpcService.disableRetries(); - testDeleteShareSnapshotWOptions(); + testDeletePrivatePathServiceGatewayWOptions(); } - // Test the deleteShareSnapshot operation with a null options model (negative test) + // Test the deletePrivatePathServiceGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteShareSnapshotNoOptions() throws Throwable { + public void testDeletePrivatePathServiceGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteShareSnapshot(null).execute(); + vpcService.deletePrivatePathServiceGateway(null).execute(); } - // Test the getShareSnapshot operation with a valid options model parameter + // Test the getPrivatePathServiceGateway operation with a valid options model parameter @Test - public void testGetShareSnapshotWOptions() throws Throwable { + public void testGetPrivatePathServiceGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getShareSnapshotPath = "/shares/testString/snapshots/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"default_access_policy\": \"deny\", \"endpoint_gateway_binding_auto_delete\": true, \"endpoint_gateway_binding_auto_delete_timeout\": 1, \"endpoint_gateway_count\": 0, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"lifecycle_state\": \"stable\", \"load_balancer\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"name\": \"my-load-balancer\", \"resource_type\": \"load_balancer\"}, \"name\": \"my-private-path-service-gateway\", \"published\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"private_path_service_gateway\", \"service_endpoints\": [\"*.example.com\"], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zonal_affinity\": false}"; + String getPrivatePathServiceGatewayPath = "/private_path_service_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetShareSnapshotOptions model - GetShareSnapshotOptions getShareSnapshotOptionsModel = new GetShareSnapshotOptions.Builder() - .shareId("testString") + // Construct an instance of the GetPrivatePathServiceGatewayOptions model + GetPrivatePathServiceGatewayOptions getPrivatePathServiceGatewayOptionsModel = new GetPrivatePathServiceGatewayOptions.Builder() .id("testString") .build(); - // Invoke getShareSnapshot() with a valid options model and verify the result - Response response = vpcService.getShareSnapshot(getShareSnapshotOptionsModel).execute(); + // Invoke getPrivatePathServiceGateway() with a valid options model and verify the result + Response response = vpcService.getPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModel).execute(); assertNotNull(response); - ShareSnapshot responseObj = response.getResult(); + PrivatePathServiceGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -19293,222 +20458,122 @@ public void testGetShareSnapshotWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getShareSnapshotPath); + assertEquals(parsedPath, getPrivatePathServiceGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getShareSnapshot operation with and without retries enabled + // Test the getPrivatePathServiceGateway operation with and without retries enabled @Test - public void testGetShareSnapshotWRetries() throws Throwable { + public void testGetPrivatePathServiceGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetShareSnapshotWOptions(); + testGetPrivatePathServiceGatewayWOptions(); vpcService.disableRetries(); - testGetShareSnapshotWOptions(); + testGetPrivatePathServiceGatewayWOptions(); } - // Test the getShareSnapshot operation with a null options model (negative test) + // Test the getPrivatePathServiceGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetShareSnapshotNoOptions() throws Throwable { + public void testGetPrivatePathServiceGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getShareSnapshot(null).execute(); + vpcService.getPrivatePathServiceGateway(null).execute(); } - // Test the updateShareSnapshot operation with a valid options model parameter + // Test the updatePrivatePathServiceGateway operation with a valid options model parameter @Test - public void testUpdateShareSnapshotWOptions() throws Throwable { + public void testUpdatePrivatePathServiceGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateShareSnapshotPath = "/shares/testString/snapshots/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"default_access_policy\": \"deny\", \"endpoint_gateway_binding_auto_delete\": true, \"endpoint_gateway_binding_auto_delete_timeout\": 1, \"endpoint_gateway_count\": 0, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"lifecycle_state\": \"stable\", \"load_balancer\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"name\": \"my-load-balancer\", \"resource_type\": \"load_balancer\"}, \"name\": \"my-private-path-service-gateway\", \"published\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"private_path_service_gateway\", \"service_endpoints\": [\"*.example.com\"], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zonal_affinity\": false}"; + String updatePrivatePathServiceGatewayPath = "/private_path_service_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ShareSnapshotPatch model - ShareSnapshotPatch shareSnapshotPatchModel = new ShareSnapshotPatch.Builder() - .userTags(java.util.Arrays.asList("testString")) - .build(); - Map shareSnapshotPatchModelAsPatch = shareSnapshotPatchModel.asPatch(); - - // Construct an instance of the UpdateShareSnapshotOptions model - UpdateShareSnapshotOptions updateShareSnapshotOptionsModel = new UpdateShareSnapshotOptions.Builder() - .shareId("testString") - .id("testString") - .shareSnapshotPatch(shareSnapshotPatchModelAsPatch) - .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") - .build(); - - // Invoke updateShareSnapshot() with a valid options model and verify the result - Response response = vpcService.updateShareSnapshot(updateShareSnapshotOptionsModel).execute(); - assertNotNull(response); - ShareSnapshot responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateShareSnapshotPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the updateShareSnapshot operation with and without retries enabled - @Test - public void testUpdateShareSnapshotWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testUpdateShareSnapshotWOptions(); - - vpcService.disableRetries(); - testUpdateShareSnapshotWOptions(); - } - - // Test the updateShareSnapshot operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateShareSnapshotNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.updateShareSnapshot(null).execute(); - } - - // Test the deleteShareSource operation with a valid options model parameter - @Test - public void testDeleteShareSourceWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteShareSourcePath = "/shares/testString/source"; - server.enqueue(new MockResponse() - .setResponseCode(202) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteShareSourceOptions model - DeleteShareSourceOptions deleteShareSourceOptionsModel = new DeleteShareSourceOptions.Builder() - .shareId("testString") + // Construct an instance of the LoadBalancerIdentityById model + LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() + .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") .build(); - // Invoke deleteShareSource() with a valid options model and verify the result - Response response = vpcService.deleteShareSource(deleteShareSourceOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteShareSourcePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the deleteShareSource operation with and without retries enabled - @Test - public void testDeleteShareSourceWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testDeleteShareSourceWOptions(); - - vpcService.disableRetries(); - testDeleteShareSourceWOptions(); - } - - // Test the deleteShareSource operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteShareSourceNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.deleteShareSource(null).execute(); - } - - // Test the getShareSource operation with a valid options model parameter - @Test - public void testGetShareSourceWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}"; - String getShareSourcePath = "/shares/testString/source"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetShareSourceOptions model - GetShareSourceOptions getShareSourceOptionsModel = new GetShareSourceOptions.Builder() - .shareId("testString") + // Construct an instance of the PrivatePathServiceGatewayPatch model + PrivatePathServiceGatewayPatch privatePathServiceGatewayPatchModel = new PrivatePathServiceGatewayPatch.Builder() + .defaultAccessPolicy("deny") + .loadBalancer(loadBalancerIdentityModel) + .name("my-private-path-service-gateway") + .zonalAffinity(true) .build(); + Map privatePathServiceGatewayPatchModelAsPatch = privatePathServiceGatewayPatchModel.asPatch(); - // Invoke getShareSource() with a valid options model and verify the result - Response response = vpcService.getShareSource(getShareSourceOptionsModel).execute(); + // Construct an instance of the UpdatePrivatePathServiceGatewayOptions model + UpdatePrivatePathServiceGatewayOptions updatePrivatePathServiceGatewayOptionsModel = new UpdatePrivatePathServiceGatewayOptions.Builder() + .id("testString") + .privatePathServiceGatewayPatch(privatePathServiceGatewayPatchModelAsPatch) + .build(); + + // Invoke updatePrivatePathServiceGateway() with a valid options model and verify the result + Response response = vpcService.updatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModel).execute(); assertNotNull(response); - ShareReference responseObj = response.getResult(); + PrivatePathServiceGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getShareSourcePath); + assertEquals(parsedPath, updatePrivatePathServiceGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getShareSource operation with and without retries enabled + // Test the updatePrivatePathServiceGateway operation with and without retries enabled @Test - public void testGetShareSourceWRetries() throws Throwable { + public void testUpdatePrivatePathServiceGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetShareSourceWOptions(); + testUpdatePrivatePathServiceGatewayWOptions(); vpcService.disableRetries(); - testGetShareSourceWOptions(); + testUpdatePrivatePathServiceGatewayWOptions(); } - // Test the getShareSource operation with a null options model (negative test) + // Test the updatePrivatePathServiceGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetShareSourceNoOptions() throws Throwable { + public void testUpdatePrivatePathServiceGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getShareSource(null).execute(); + vpcService.updatePrivatePathServiceGateway(null).execute(); } - // Test the listBackupPolicies operation with a valid options model parameter + // Test the listPrivatePathServiceGatewayAccountPolicies operation with a valid options model parameter @Test - public void testListBackupPoliciesWOptions() throws Throwable { + public void testListPrivatePathServiceGatewayAccountPoliciesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"backup_policies\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listBackupPoliciesPath = "/backup_policies"; + String mockResponseBody = "{\"account_policies\": [{\"access_policy\": \"deny\", \"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"resource_type\": \"private_path_service_gateway_account_policy\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listPrivatePathServiceGatewayAccountPoliciesPath = "/private_path_service_gateways/testString/account_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBackupPoliciesOptions model - ListBackupPoliciesOptions listBackupPoliciesOptionsModel = new ListBackupPoliciesOptions.Builder() + // Construct an instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model + ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptionsModel = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() + .privatePathServiceGatewayId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .tag("testString") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - // Invoke listBackupPolicies() with a valid options model and verify the result - Response response = vpcService.listBackupPolicies(listBackupPoliciesOptionsModel).execute(); + // Invoke listPrivatePathServiceGatewayAccountPolicies() with a valid options model and verify the result + Response response = vpcService.listPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModel).execute(); assertNotNull(response); - BackupPolicyCollection responseObj = response.getResult(); + PrivatePathServiceGatewayAccountPolicyCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -19517,35 +20582,40 @@ public void testListBackupPoliciesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBackupPoliciesPath); + assertEquals(parsedPath, listPrivatePathServiceGatewayAccountPoliciesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("tag"), "testString"); + assertEquals(query.get("account.id"), "bb1b52262f7441a586f49068482f1e60"); } - // Test the listBackupPolicies operation with and without retries enabled + // Test the listPrivatePathServiceGatewayAccountPolicies operation with and without retries enabled @Test - public void testListBackupPoliciesWRetries() throws Throwable { + public void testListPrivatePathServiceGatewayAccountPoliciesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBackupPoliciesWOptions(); + testListPrivatePathServiceGatewayAccountPoliciesWOptions(); vpcService.disableRetries(); - testListBackupPoliciesWOptions(); + testListPrivatePathServiceGatewayAccountPoliciesWOptions(); } - // Test the listBackupPolicies operation using the BackupPoliciesPager.getNext() method + // Test the listPrivatePathServiceGatewayAccountPolicies operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListPrivatePathServiceGatewayAccountPoliciesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listPrivatePathServiceGatewayAccountPolicies(null).execute(); + } + + // Test the listPrivatePathServiceGatewayAccountPolicies operation using the PrivatePathServiceGatewayAccountPoliciesPager.getNext() method @Test - public void testListBackupPoliciesWithPagerGetNext() throws Throwable { + public void testListPrivatePathServiceGatewayAccountPoliciesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"health_reasons\":[{\"code\":\"missing_service_authorization_policies\",\"message\":\"One or more accounts are missing service authorization policies\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\",\"scope\":{\"crn\":\"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\",\"id\":\"ebc2b430240943458b9e91e1432cfcce\",\"resource_type\":\"enterprise\"},\"included_content\":[\"data_volumes\"],\"match_resource_type\":\"instance\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"health_reasons\":[{\"code\":\"missing_service_authorization_policies\",\"message\":\"One or more accounts are missing service authorization policies\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\",\"scope\":{\"crn\":\"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\",\"id\":\"ebc2b430240943458b9e91e1432cfcce\",\"resource_type\":\"enterprise\"},\"included_content\":[\"data_volumes\"],\"match_resource_type\":\"instance\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"account_policies\":[{\"access_policy\":\"deny\",\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"resource_type\":\"private_path_service_gateway_account_policy\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"account_policies\":[{\"access_policy\":\"deny\",\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"resource_type\":\"private_path_service_gateway_account_policy\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -19559,29 +20629,28 @@ public void testListBackupPoliciesWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() + ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptions = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() + .privatePathServiceGatewayId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .tag("testString") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - List allResults = new ArrayList<>(); - BackupPoliciesPager pager = new BackupPoliciesPager(vpcService, listBackupPoliciesOptions); + List allResults = new ArrayList<>(); + PrivatePathServiceGatewayAccountPoliciesPager pager = new PrivatePathServiceGatewayAccountPoliciesPager(vpcService, listPrivatePathServiceGatewayAccountPoliciesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listBackupPolicies operation using the BackupPoliciesPager.getAll() method + // Test the listPrivatePathServiceGatewayAccountPolicies operation using the PrivatePathServiceGatewayAccountPoliciesPager.getAll() method @Test - public void testListBackupPoliciesWithPagerGetAll() throws Throwable { + public void testListPrivatePathServiceGatewayAccountPoliciesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"health_reasons\":[{\"code\":\"missing_service_authorization_policies\",\"message\":\"One or more accounts are missing service authorization policies\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\",\"scope\":{\"crn\":\"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\",\"id\":\"ebc2b430240943458b9e91e1432cfcce\",\"resource_type\":\"enterprise\"},\"included_content\":[\"data_volumes\"],\"match_resource_type\":\"instance\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"backup_policies\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"health_reasons\":[{\"code\":\"missing_service_authorization_policies\",\"message\":\"One or more accounts are missing service authorization policies\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"id\":\"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\",\"last_job_completed_at\":\"2019-01-01T12:00:00.000Z\",\"lifecycle_state\":\"stable\",\"match_user_tags\":[\"matchUserTags\"],\"name\":\"my-backup-policy\",\"plans\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"backup_policy\",\"scope\":{\"crn\":\"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\",\"id\":\"ebc2b430240943458b9e91e1432cfcce\",\"resource_type\":\"enterprise\"},\"included_content\":[\"data_volumes\"],\"match_resource_type\":\"instance\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"account_policies\":[{\"access_policy\":\"deny\",\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"resource_type\":\"private_path_service_gateway_account_policy\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"account_policies\":[{\"access_policy\":\"deny\",\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"resource_type\":\"private_path_service_gateway_account_policy\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -19595,166 +20664,152 @@ public void testListBackupPoliciesWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListBackupPoliciesOptions listBackupPoliciesOptions = new ListBackupPoliciesOptions.Builder() + ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptions = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() + .privatePathServiceGatewayId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .tag("testString") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - BackupPoliciesPager pager = new BackupPoliciesPager(vpcService, listBackupPoliciesOptions); - List allResults = pager.getAll(); + PrivatePathServiceGatewayAccountPoliciesPager pager = new PrivatePathServiceGatewayAccountPoliciesPager(vpcService, listPrivatePathServiceGatewayAccountPoliciesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createBackupPolicy operation with a valid options model parameter + // Test the createPrivatePathServiceGatewayAccountPolicy operation with a valid options model parameter @Test - public void testCreateBackupPolicyWOptions() throws Throwable { + public void testCreatePrivatePathServiceGatewayAccountPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}"; - String createBackupPolicyPath = "/backup_policies"; + String mockResponseBody = "{\"access_policy\": \"deny\", \"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"resource_type\": \"private_path_service_gateway_account_policy\"}"; + String createPrivatePathServiceGatewayAccountPolicyPath = "/private_path_service_gateways/testString/account_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the BackupPolicyPlanClonePolicyPrototype model - BackupPolicyPlanClonePolicyPrototype backupPolicyPlanClonePolicyPrototypeModel = new BackupPolicyPlanClonePolicyPrototype.Builder() - .maxSnapshots(Long.valueOf("5")) - .zones(java.util.Arrays.asList(zoneIdentityModel)) - .build(); - - // Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model - BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("20")) + // Construct an instance of the AccountIdentityById model + AccountIdentityById accountIdentityModel = new AccountIdentityById.Builder() + .id("bb1b52262f7441a586f49068482f1e60") .build(); - // Construct an instance of the EncryptionKeyIdentityByCRN model - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") + // Construct an instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model + CreatePrivatePathServiceGatewayAccountPolicyOptions createPrivatePathServiceGatewayAccountPolicyOptionsModel = new CreatePrivatePathServiceGatewayAccountPolicyOptions.Builder() + .privatePathServiceGatewayId("testString") + .accessPolicy("deny") + .account(accountIdentityModel) .build(); - // Construct an instance of the RegionIdentityByName model - RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() - .name("us-south") - .build(); + // Invoke createPrivatePathServiceGatewayAccountPolicy() with a valid options model and verify the result + Response response = vpcService.createPrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModel).execute(); + assertNotNull(response); + PrivatePathServiceGatewayAccountPolicy responseObj = response.getResult(); + assertNotNull(responseObj); - // Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model - BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() - .deleteOverCount(Long.valueOf("5")) - .encryptionKey(encryptionKeyIdentityModel) - .region(regionIdentityModel) - .build(); + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createPrivatePathServiceGatewayAccountPolicyPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } - // Construct an instance of the BackupPolicyPlanPrototype model - BackupPolicyPlanPrototype backupPolicyPlanPrototypeModel = new BackupPolicyPlanPrototype.Builder() - .active(true) - .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) - .clonePolicy(backupPolicyPlanClonePolicyPrototypeModel) - .copyUserTags(true) - .cronSpec("30 */2 * * 1-5") - .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) - .name("my-policy-plan") - .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) - .build(); + // Test the createPrivatePathServiceGatewayAccountPolicy operation with and without retries enabled + @Test + public void testCreatePrivatePathServiceGatewayAccountPolicyWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreatePrivatePathServiceGatewayAccountPolicyWOptions(); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); + vpcService.disableRetries(); + testCreatePrivatePathServiceGatewayAccountPolicyWOptions(); + } - // Construct an instance of the BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN model - BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN backupPolicyScopePrototypeModel = new BackupPolicyScopePrototypeEnterpriseIdentityEnterpriseIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce") - .build(); + // Test the createPrivatePathServiceGatewayAccountPolicy operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreatePrivatePathServiceGatewayAccountPolicyNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createPrivatePathServiceGatewayAccountPolicy(null).execute(); + } - // Construct an instance of the BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype model - BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype backupPolicyPrototypeModel = new BackupPolicyPrototypeBackupPolicyMatchResourceTypeVolumePrototype.Builder() - .matchUserTags(java.util.Arrays.asList("my-daily-backup-policy")) - .name("my-backup-policy") - .plans(java.util.Arrays.asList(backupPolicyPlanPrototypeModel)) - .resourceGroup(resourceGroupIdentityModel) - .scope(backupPolicyScopePrototypeModel) - .matchResourceType("volume") - .build(); + // Test the deletePrivatePathServiceGatewayAccountPolicy operation with a valid options model parameter + @Test + public void testDeletePrivatePathServiceGatewayAccountPolicyWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deletePrivatePathServiceGatewayAccountPolicyPath = "/private_path_service_gateways/testString/account_policies/testString"; + server.enqueue(new MockResponse() + .setResponseCode(204) + .setBody(mockResponseBody)); - // Construct an instance of the CreateBackupPolicyOptions model - CreateBackupPolicyOptions createBackupPolicyOptionsModel = new CreateBackupPolicyOptions.Builder() - .backupPolicyPrototype(backupPolicyPrototypeModel) + // Construct an instance of the DeletePrivatePathServiceGatewayAccountPolicyOptions model + DeletePrivatePathServiceGatewayAccountPolicyOptions deletePrivatePathServiceGatewayAccountPolicyOptionsModel = new DeletePrivatePathServiceGatewayAccountPolicyOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") .build(); - // Invoke createBackupPolicy() with a valid options model and verify the result - Response response = vpcService.createBackupPolicy(createBackupPolicyOptionsModel).execute(); + // Invoke deletePrivatePathServiceGatewayAccountPolicy() with a valid options model and verify the result + Response response = vpcService.deletePrivatePathServiceGatewayAccountPolicy(deletePrivatePathServiceGatewayAccountPolicyOptionsModel).execute(); assertNotNull(response); - BackupPolicy responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createBackupPolicyPath); + assertEquals(parsedPath, deletePrivatePathServiceGatewayAccountPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createBackupPolicy operation with and without retries enabled + // Test the deletePrivatePathServiceGatewayAccountPolicy operation with and without retries enabled @Test - public void testCreateBackupPolicyWRetries() throws Throwable { + public void testDeletePrivatePathServiceGatewayAccountPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateBackupPolicyWOptions(); + testDeletePrivatePathServiceGatewayAccountPolicyWOptions(); vpcService.disableRetries(); - testCreateBackupPolicyWOptions(); + testDeletePrivatePathServiceGatewayAccountPolicyWOptions(); } - // Test the createBackupPolicy operation with a null options model (negative test) + // Test the deletePrivatePathServiceGatewayAccountPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateBackupPolicyNoOptions() throws Throwable { + public void testDeletePrivatePathServiceGatewayAccountPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createBackupPolicy(null).execute(); + vpcService.deletePrivatePathServiceGatewayAccountPolicy(null).execute(); } - // Test the listBackupPolicyJobs operation with a valid options model parameter + // Test the getPrivatePathServiceGatewayAccountPolicy operation with a valid options model parameter @Test - public void testListBackupPolicyJobsWOptions() throws Throwable { + public void testGetPrivatePathServiceGatewayAccountPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"jobs\": [{\"auto_delete\": true, \"auto_delete_after\": 90, \"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\", \"id\": \"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\", \"job_type\": \"creation\", \"resource_type\": \"backup_policy_job\", \"source\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"failed\", \"status_reasons\": [{\"code\": \"source_volume_busy\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}], \"target_snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listBackupPolicyJobsPath = "/backup_policies/testString/jobs"; + String mockResponseBody = "{\"access_policy\": \"deny\", \"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"resource_type\": \"private_path_service_gateway_account_policy\"}"; + String getPrivatePathServiceGatewayAccountPolicyPath = "/private_path_service_gateways/testString/account_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBackupPolicyJobsOptions model - ListBackupPolicyJobsOptions listBackupPolicyJobsOptionsModel = new ListBackupPolicyJobsOptions.Builder() - .backupPolicyId("testString") - .status("failed") - .backupPolicyPlanId("testString") - .start("testString") - .limit(Long.valueOf("10")) - .sort("name") - .sourceId("testString") - .targetSnapshotsId("testString") - .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + // Construct an instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model + GetPrivatePathServiceGatewayAccountPolicyOptions getPrivatePathServiceGatewayAccountPolicyOptionsModel = new GetPrivatePathServiceGatewayAccountPolicyOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") .build(); - // Invoke listBackupPolicyJobs() with a valid options model and verify the result - Response response = vpcService.listBackupPolicyJobs(listBackupPolicyJobsOptionsModel).execute(); + // Invoke getPrivatePathServiceGatewayAccountPolicy() with a valid options model and verify the result + Response response = vpcService.getPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModel).execute(); assertNotNull(response); - BackupPolicyJobCollection responseObj = response.getResult(); + PrivatePathServiceGatewayAccountPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -19763,136 +20818,116 @@ public void testListBackupPolicyJobsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBackupPolicyJobsPath); + assertEquals(parsedPath, getPrivatePathServiceGatewayAccountPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("status"), "failed"); - assertEquals(query.get("backup_policy_plan.id"), "testString"); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("sort"), "name"); - assertEquals(query.get("source.id"), "testString"); - assertEquals(query.get("target_snapshots[].id"), "testString"); - assertEquals(query.get("target_snapshots[].crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); } - // Test the listBackupPolicyJobs operation with and without retries enabled + // Test the getPrivatePathServiceGatewayAccountPolicy operation with and without retries enabled @Test - public void testListBackupPolicyJobsWRetries() throws Throwable { + public void testGetPrivatePathServiceGatewayAccountPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBackupPolicyJobsWOptions(); + testGetPrivatePathServiceGatewayAccountPolicyWOptions(); vpcService.disableRetries(); - testListBackupPolicyJobsWOptions(); + testGetPrivatePathServiceGatewayAccountPolicyWOptions(); } - // Test the listBackupPolicyJobs operation with a null options model (negative test) + // Test the getPrivatePathServiceGatewayAccountPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListBackupPolicyJobsNoOptions() throws Throwable { + public void testGetPrivatePathServiceGatewayAccountPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listBackupPolicyJobs(null).execute(); + vpcService.getPrivatePathServiceGatewayAccountPolicy(null).execute(); } - // Test the listBackupPolicyJobs operation using the BackupPolicyJobsPager.getNext() method + // Test the updatePrivatePathServiceGatewayAccountPolicy operation with a valid options model parameter @Test - public void testListBackupPolicyJobsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"jobs\":[{\"auto_delete\":true,\"auto_delete_after\":90,\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"id\":\"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; - String mockResponsePage2 = "{\"total_count\":2,\"jobs\":[{\"auto_delete\":true,\"auto_delete_after\":90,\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"id\":\"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); + public void testUpdatePrivatePathServiceGatewayAccountPolicyWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"access_policy\": \"deny\", \"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"resource_type\": \"private_path_service_gateway_account_policy\"}"; + String updatePrivatePathServiceGatewayAccountPolicyPath = "/private_path_service_gateways/testString/account_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + .setBody(mockResponseBody)); - ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() - .backupPolicyId("testString") - .status("failed") - .backupPolicyPlanId("testString") - .limit(Long.valueOf("10")) - .sort("name") - .sourceId("testString") - .targetSnapshotsId("testString") - .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + // Construct an instance of the PrivatePathServiceGatewayAccountPolicyPatch model + PrivatePathServiceGatewayAccountPolicyPatch privatePathServiceGatewayAccountPolicyPatchModel = new PrivatePathServiceGatewayAccountPolicyPatch.Builder() + .accessPolicy("review") .build(); + Map privatePathServiceGatewayAccountPolicyPatchModelAsPatch = privatePathServiceGatewayAccountPolicyPatchModel.asPatch(); - List allResults = new ArrayList<>(); - BackupPolicyJobsPager pager = new BackupPolicyJobsPager(vpcService, listBackupPolicyJobsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Construct an instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model + UpdatePrivatePathServiceGatewayAccountPolicyOptions updatePrivatePathServiceGatewayAccountPolicyOptionsModel = new UpdatePrivatePathServiceGatewayAccountPolicyOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") + .privatePathServiceGatewayAccountPolicyPatch(privatePathServiceGatewayAccountPolicyPatchModelAsPatch) + .build(); + + // Invoke updatePrivatePathServiceGatewayAccountPolicy() with a valid options model and verify the result + Response response = vpcService.updatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModel).execute(); + assertNotNull(response); + PrivatePathServiceGatewayAccountPolicy responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updatePrivatePathServiceGatewayAccountPolicyPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - - // Test the listBackupPolicyJobs operation using the BackupPolicyJobsPager.getAll() method + + // Test the updatePrivatePathServiceGatewayAccountPolicy operation with and without retries enabled @Test - public void testListBackupPolicyJobsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"jobs\":[{\"auto_delete\":true,\"auto_delete_after\":90,\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"id\":\"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; - String mockResponsePage2 = "{\"total_count\":2,\"jobs\":[{\"auto_delete\":true,\"auto_delete_after\":90,\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"id\":\"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\",\"job_type\":\"creation\",\"resource_type\":\"backup_policy_job\",\"source\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"status\":\"failed\",\"status_reasons\":[{\"code\":\"source_volume_busy\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}],\"target_snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + public void testUpdatePrivatePathServiceGatewayAccountPolicyWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testUpdatePrivatePathServiceGatewayAccountPolicyWOptions(); - ListBackupPolicyJobsOptions listBackupPolicyJobsOptions = new ListBackupPolicyJobsOptions.Builder() - .backupPolicyId("testString") - .status("failed") - .backupPolicyPlanId("testString") - .limit(Long.valueOf("10")) - .sort("name") - .sourceId("testString") - .targetSnapshotsId("testString") - .targetSnapshotsCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") - .build(); + vpcService.disableRetries(); + testUpdatePrivatePathServiceGatewayAccountPolicyWOptions(); + } - BackupPolicyJobsPager pager = new BackupPolicyJobsPager(vpcService, listBackupPolicyJobsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); + // Test the updatePrivatePathServiceGatewayAccountPolicy operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdatePrivatePathServiceGatewayAccountPolicyNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updatePrivatePathServiceGatewayAccountPolicy(null).execute(); } - - // Test the getBackupPolicyJob operation with a valid options model parameter + + // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation with a valid options model parameter @Test - public void testGetBackupPolicyJobWOptions() throws Throwable { + public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"auto_delete\": true, \"auto_delete_after\": 90, \"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"completed_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/jobs/r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\", \"id\": \"r006-fc4b7fbc-38af-45d9-9fb6-bf0533acbf90\", \"job_type\": \"creation\", \"resource_type\": \"backup_policy_job\", \"source\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"status\": \"failed\", \"status_reasons\": [{\"code\": \"source_volume_busy\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-baas-troubleshoot\"}], \"target_snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; - String getBackupPolicyJobPath = "/backup_policies/testString/jobs/testString"; + String mockResponseBody = "{\"endpoint_gateway_bindings\": [{\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\", \"id\": \"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\", \"lifecycle_state\": \"stable\", \"resource_type\": \"private_path_service_gateway_endpoint_gateway_binding\", \"status\": \"abandoned\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listPrivatePathServiceGatewayEndpointGatewayBindingsPath = "/private_path_service_gateways/testString/endpoint_gateway_bindings"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBackupPolicyJobOptions model - GetBackupPolicyJobOptions getBackupPolicyJobOptionsModel = new GetBackupPolicyJobOptions.Builder() - .backupPolicyId("testString") - .id("testString") + // Construct an instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model + ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() + .privatePathServiceGatewayId("testString") + .start("testString") + .limit(Long.valueOf("10")) + .status("abandoned") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - // Invoke getBackupPolicyJob() with a valid options model and verify the result - Response response = vpcService.getBackupPolicyJob(getBackupPolicyJobOptionsModel).execute(); + // Invoke listPrivatePathServiceGatewayEndpointGatewayBindings() with a valid options model and verify the result + Response response = vpcService.listPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel).execute(); assertNotNull(response); - BackupPolicyJob responseObj = response.getResult(); + PrivatePathServiceGatewayEndpointGatewayBindingCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -19901,52 +20936,124 @@ public void testGetBackupPolicyJobWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBackupPolicyJobPath); + assertEquals(parsedPath, listPrivatePathServiceGatewayEndpointGatewayBindingsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("status"), "abandoned"); + assertEquals(query.get("account.id"), "bb1b52262f7441a586f49068482f1e60"); + } + + // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation with and without retries enabled + @Test + public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListPrivatePathServiceGatewayEndpointGatewayBindingsWOptions(); + + vpcService.disableRetries(); + testListPrivatePathServiceGatewayEndpointGatewayBindingsWOptions(); + } + + // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListPrivatePathServiceGatewayEndpointGatewayBindingsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listPrivatePathServiceGatewayEndpointGatewayBindings(null).execute(); + } + + // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation using the PrivatePathServiceGatewayEndpointGatewayBindingsPager.getNext() method + @Test + public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"endpoint_gateway_bindings\":[{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"id\":\"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"lifecycle_state\":\"stable\",\"resource_type\":\"private_path_service_gateway_endpoint_gateway_binding\",\"status\":\"abandoned\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"endpoint_gateway_bindings\":[{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"id\":\"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"lifecycle_state\":\"stable\",\"resource_type\":\"private_path_service_gateway_endpoint_gateway_binding\",\"status\":\"abandoned\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptions = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() + .privatePathServiceGatewayId("testString") + .limit(Long.valueOf("10")) + .status("abandoned") + .accountId("bb1b52262f7441a586f49068482f1e60") + .build(); + + List allResults = new ArrayList<>(); + PrivatePathServiceGatewayEndpointGatewayBindingsPager pager = new PrivatePathServiceGatewayEndpointGatewayBindingsPager(vpcService, listPrivatePathServiceGatewayEndpointGatewayBindingsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } - - // Test the getBackupPolicyJob operation with and without retries enabled + + // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation using the PrivatePathServiceGatewayEndpointGatewayBindingsPager.getAll() method @Test - public void testGetBackupPolicyJobWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetBackupPolicyJobWOptions(); + public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"endpoint_gateway_bindings\":[{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"id\":\"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"lifecycle_state\":\"stable\",\"resource_type\":\"private_path_service_gateway_endpoint_gateway_binding\",\"status\":\"abandoned\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"endpoint_gateway_bindings\":[{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"id\":\"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"lifecycle_state\":\"stable\",\"resource_type\":\"private_path_service_gateway_endpoint_gateway_binding\",\"status\":\"abandoned\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testGetBackupPolicyJobWOptions(); - } + ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptions = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() + .privatePathServiceGatewayId("testString") + .limit(Long.valueOf("10")) + .status("abandoned") + .accountId("bb1b52262f7441a586f49068482f1e60") + .build(); - // Test the getBackupPolicyJob operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBackupPolicyJobNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getBackupPolicyJob(null).execute(); + PrivatePathServiceGatewayEndpointGatewayBindingsPager pager = new PrivatePathServiceGatewayEndpointGatewayBindingsPager(vpcService, listPrivatePathServiceGatewayEndpointGatewayBindingsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the listBackupPolicyPlans operation with a valid options model parameter + + // Test the getPrivatePathServiceGatewayEndpointGatewayBinding operation with a valid options model parameter @Test - public void testListBackupPolicyPlansWOptions() throws Throwable { + public void testGetPrivatePathServiceGatewayEndpointGatewayBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"plans\": [{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}], \"total_count\": 132}"; - String listBackupPolicyPlansPath = "/backup_policies/testString/plans"; + String mockResponseBody = "{\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\", \"id\": \"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\", \"lifecycle_state\": \"stable\", \"resource_type\": \"private_path_service_gateway_endpoint_gateway_binding\", \"status\": \"abandoned\"}"; + String getPrivatePathServiceGatewayEndpointGatewayBindingPath = "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListBackupPolicyPlansOptions model - ListBackupPolicyPlansOptions listBackupPolicyPlansOptionsModel = new ListBackupPolicyPlansOptions.Builder() - .backupPolicyId("testString") - .name("my-name") + // Construct an instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model + GetPrivatePathServiceGatewayEndpointGatewayBindingOptions getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel = new GetPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") .build(); - // Invoke listBackupPolicyPlans() with a valid options model and verify the result - Response response = vpcService.listBackupPolicyPlans(listBackupPolicyPlansOptionsModel).execute(); + // Invoke getPrivatePathServiceGatewayEndpointGatewayBinding() with a valid options model and verify the result + Response response = vpcService.getPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).execute(); assertNotNull(response); - BackupPolicyPlanCollection responseObj = response.getResult(); + PrivatePathServiceGatewayEndpointGatewayBinding responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -19955,95 +21062,53 @@ public void testListBackupPolicyPlansWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listBackupPolicyPlansPath); + assertEquals(parsedPath, getPrivatePathServiceGatewayEndpointGatewayBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("name"), "my-name"); } - // Test the listBackupPolicyPlans operation with and without retries enabled + // Test the getPrivatePathServiceGatewayEndpointGatewayBinding operation with and without retries enabled @Test - public void testListBackupPolicyPlansWRetries() throws Throwable { + public void testGetPrivatePathServiceGatewayEndpointGatewayBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListBackupPolicyPlansWOptions(); + testGetPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); vpcService.disableRetries(); - testListBackupPolicyPlansWOptions(); + testGetPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); } - // Test the listBackupPolicyPlans operation with a null options model (negative test) + // Test the getPrivatePathServiceGatewayEndpointGatewayBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListBackupPolicyPlansNoOptions() throws Throwable { + public void testGetPrivatePathServiceGatewayEndpointGatewayBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listBackupPolicyPlans(null).execute(); + vpcService.getPrivatePathServiceGatewayEndpointGatewayBinding(null).execute(); } - // Test the createBackupPolicyPlan operation with a valid options model parameter + // Test the denyPrivatePathServiceGatewayEndpointGatewayBinding operation with a valid options model parameter @Test - public void testCreateBackupPolicyPlanWOptions() throws Throwable { + public void testDenyPrivatePathServiceGatewayEndpointGatewayBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}"; - String createBackupPolicyPlanPath = "/backup_policies/testString/plans"; + String mockResponseBody = ""; + String denyPrivatePathServiceGatewayEndpointGatewayBindingPath = "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the BackupPolicyPlanClonePolicyPrototype model - BackupPolicyPlanClonePolicyPrototype backupPolicyPlanClonePolicyPrototypeModel = new BackupPolicyPlanClonePolicyPrototype.Builder() - .maxSnapshots(Long.valueOf("5")) - .zones(java.util.Arrays.asList(zoneIdentityModel)) - .build(); - - // Construct an instance of the BackupPolicyPlanDeletionTriggerPrototype model - BackupPolicyPlanDeletionTriggerPrototype backupPolicyPlanDeletionTriggerPrototypeModel = new BackupPolicyPlanDeletionTriggerPrototype.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("20")) - .build(); - - // Construct an instance of the EncryptionKeyIdentityByCRN model - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - // Construct an instance of the RegionIdentityByName model - RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() - .name("us-south") - .build(); - - // Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model - BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() - .deleteOverCount(Long.valueOf("5")) - .encryptionKey(encryptionKeyIdentityModel) - .region(regionIdentityModel) - .build(); - - // Construct an instance of the CreateBackupPolicyPlanOptions model - CreateBackupPolicyPlanOptions createBackupPolicyPlanOptionsModel = new CreateBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .cronSpec("30 */2 * * 1-5") - .active(true) - .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) - .clonePolicy(backupPolicyPlanClonePolicyPrototypeModel) - .copyUserTags(true) - .deletionTrigger(backupPolicyPlanDeletionTriggerPrototypeModel) - .name("my-policy-plan") - .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) + // Construct an instance of the DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions model + DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel = new DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() + .privatePathServiceGatewayId("testString") + .id("testString") + .setAccountPolicy(true) .build(); - // Invoke createBackupPolicyPlan() with a valid options model and verify the result - Response response = vpcService.createBackupPolicyPlan(createBackupPolicyPlanOptionsModel).execute(); + // Invoke denyPrivatePathServiceGatewayEndpointGatewayBinding() with a valid options model and verify the result + Response response = vpcService.denyPrivatePathServiceGatewayEndpointGatewayBinding(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).execute(); assertNotNull(response); - BackupPolicyPlan responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -20051,317 +21116,269 @@ public void testCreateBackupPolicyPlanWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createBackupPolicyPlanPath); + assertEquals(parsedPath, denyPrivatePathServiceGatewayEndpointGatewayBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createBackupPolicyPlan operation with and without retries enabled + // Test the denyPrivatePathServiceGatewayEndpointGatewayBinding operation with and without retries enabled @Test - public void testCreateBackupPolicyPlanWRetries() throws Throwable { + public void testDenyPrivatePathServiceGatewayEndpointGatewayBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateBackupPolicyPlanWOptions(); + testDenyPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); vpcService.disableRetries(); - testCreateBackupPolicyPlanWOptions(); + testDenyPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); } - // Test the createBackupPolicyPlan operation with a null options model (negative test) + // Test the denyPrivatePathServiceGatewayEndpointGatewayBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateBackupPolicyPlanNoOptions() throws Throwable { + public void testDenyPrivatePathServiceGatewayEndpointGatewayBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createBackupPolicyPlan(null).execute(); + vpcService.denyPrivatePathServiceGatewayEndpointGatewayBinding(null).execute(); } - // Test the deleteBackupPolicyPlan operation with a valid options model parameter + // Test the permitPrivatePathServiceGatewayEndpointGatewayBinding operation with a valid options model parameter @Test - public void testDeleteBackupPolicyPlanWOptions() throws Throwable { + public void testPermitPrivatePathServiceGatewayEndpointGatewayBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}"; - String deleteBackupPolicyPlanPath = "/backup_policies/testString/plans/testString"; + String mockResponseBody = ""; + String permitPrivatePathServiceGatewayEndpointGatewayBindingPath = "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteBackupPolicyPlanOptions model - DeleteBackupPolicyPlanOptions deleteBackupPolicyPlanOptionsModel = new DeleteBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") + // Construct an instance of the PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions model + PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel = new PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() + .privatePathServiceGatewayId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .setAccountPolicy(true) .build(); - // Invoke deleteBackupPolicyPlan() with a valid options model and verify the result - Response response = vpcService.deleteBackupPolicyPlan(deleteBackupPolicyPlanOptionsModel).execute(); + // Invoke permitPrivatePathServiceGatewayEndpointGatewayBinding() with a valid options model and verify the result + Response response = vpcService.permitPrivatePathServiceGatewayEndpointGatewayBinding(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).execute(); assertNotNull(response); - BackupPolicyPlan responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteBackupPolicyPlanPath); + assertEquals(parsedPath, permitPrivatePathServiceGatewayEndpointGatewayBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteBackupPolicyPlan operation with and without retries enabled + // Test the permitPrivatePathServiceGatewayEndpointGatewayBinding operation with and without retries enabled @Test - public void testDeleteBackupPolicyPlanWRetries() throws Throwable { + public void testPermitPrivatePathServiceGatewayEndpointGatewayBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteBackupPolicyPlanWOptions(); + testPermitPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); vpcService.disableRetries(); - testDeleteBackupPolicyPlanWOptions(); + testPermitPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); } - // Test the deleteBackupPolicyPlan operation with a null options model (negative test) + // Test the permitPrivatePathServiceGatewayEndpointGatewayBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteBackupPolicyPlanNoOptions() throws Throwable { + public void testPermitPrivatePathServiceGatewayEndpointGatewayBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteBackupPolicyPlan(null).execute(); + vpcService.permitPrivatePathServiceGatewayEndpointGatewayBinding(null).execute(); } - // Test the getBackupPolicyPlan operation with a valid options model parameter + // Test the publishPrivatePathServiceGateway operation with a valid options model parameter @Test - public void testGetBackupPolicyPlanWOptions() throws Throwable { + public void testPublishPrivatePathServiceGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}"; - String getBackupPolicyPlanPath = "/backup_policies/testString/plans/testString"; + String mockResponseBody = ""; + String publishPrivatePathServiceGatewayPath = "/private_path_service_gateways/testString/publish"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the GetBackupPolicyPlanOptions model - GetBackupPolicyPlanOptions getBackupPolicyPlanOptionsModel = new GetBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .id("testString") + // Construct an instance of the PublishPrivatePathServiceGatewayOptions model + PublishPrivatePathServiceGatewayOptions publishPrivatePathServiceGatewayOptionsModel = new PublishPrivatePathServiceGatewayOptions.Builder() + .privatePathServiceGatewayId("testString") .build(); - // Invoke getBackupPolicyPlan() with a valid options model and verify the result - Response response = vpcService.getBackupPolicyPlan(getBackupPolicyPlanOptionsModel).execute(); + // Invoke publishPrivatePathServiceGateway() with a valid options model and verify the result + Response response = vpcService.publishPrivatePathServiceGateway(publishPrivatePathServiceGatewayOptionsModel).execute(); assertNotNull(response); - BackupPolicyPlan responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBackupPolicyPlanPath); + assertEquals(parsedPath, publishPrivatePathServiceGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getBackupPolicyPlan operation with and without retries enabled + // Test the publishPrivatePathServiceGateway operation with and without retries enabled @Test - public void testGetBackupPolicyPlanWRetries() throws Throwable { + public void testPublishPrivatePathServiceGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBackupPolicyPlanWOptions(); + testPublishPrivatePathServiceGatewayWOptions(); vpcService.disableRetries(); - testGetBackupPolicyPlanWOptions(); + testPublishPrivatePathServiceGatewayWOptions(); } - // Test the getBackupPolicyPlan operation with a null options model (negative test) + // Test the publishPrivatePathServiceGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBackupPolicyPlanNoOptions() throws Throwable { + public void testPublishPrivatePathServiceGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getBackupPolicyPlan(null).execute(); + vpcService.publishPrivatePathServiceGateway(null).execute(); } - // Test the updateBackupPolicyPlan operation with a valid options model parameter + // Test the revokeAccountForPrivatePathServiceGateway operation with a valid options model parameter @Test - public void testUpdateBackupPolicyPlanWOptions() throws Throwable { + public void testRevokeAccountForPrivatePathServiceGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"attach_user_tags\": [\"attachUserTags\"], \"clone_policy\": {\"max_snapshots\": 1, \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}, \"copy_user_tags\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"cron_spec\": \"30 */2 * * 1-5\", \"deletion_trigger\": {\"delete_after\": 20, \"delete_over_count\": 20}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"lifecycle_state\": \"stable\", \"name\": \"my-policy-plan\", \"remote_region_policies\": [{\"delete_over_count\": 1, \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}], \"resource_type\": \"backup_policy_plan\"}"; - String updateBackupPolicyPlanPath = "/backup_policies/testString/plans/testString"; + String mockResponseBody = ""; + String revokeAccountForPrivatePathServiceGatewayPath = "/private_path_service_gateways/testString/revoke_account"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") - .build(); - - // Construct an instance of the BackupPolicyPlanClonePolicyPatch model - BackupPolicyPlanClonePolicyPatch backupPolicyPlanClonePolicyPatchModel = new BackupPolicyPlanClonePolicyPatch.Builder() - .maxSnapshots(Long.valueOf("1")) - .zones(java.util.Arrays.asList(zoneIdentityModel)) - .build(); - - // Construct an instance of the BackupPolicyPlanDeletionTriggerPatch model - BackupPolicyPlanDeletionTriggerPatch backupPolicyPlanDeletionTriggerPatchModel = new BackupPolicyPlanDeletionTriggerPatch.Builder() - .deleteAfter(Long.valueOf("20")) - .deleteOverCount(Long.valueOf("1")) - .build(); - - // Construct an instance of the EncryptionKeyIdentityByCRN model - EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") - .build(); - - // Construct an instance of the RegionIdentityByName model - RegionIdentityByName regionIdentityModel = new RegionIdentityByName.Builder() - .name("us-south") - .build(); - - // Construct an instance of the BackupPolicyPlanRemoteRegionPolicyPrototype model - BackupPolicyPlanRemoteRegionPolicyPrototype backupPolicyPlanRemoteRegionPolicyPrototypeModel = new BackupPolicyPlanRemoteRegionPolicyPrototype.Builder() - .deleteOverCount(Long.valueOf("5")) - .encryptionKey(encryptionKeyIdentityModel) - .region(regionIdentityModel) - .build(); - - // Construct an instance of the BackupPolicyPlanPatch model - BackupPolicyPlanPatch backupPolicyPlanPatchModel = new BackupPolicyPlanPatch.Builder() - .active(true) - .attachUserTags(java.util.Arrays.asList("my-daily-backup-plan")) - .clonePolicy(backupPolicyPlanClonePolicyPatchModel) - .copyUserTags(false) - .cronSpec("30 */2 * * 1-5") - .deletionTrigger(backupPolicyPlanDeletionTriggerPatchModel) - .name("my-policy-plan") - .remoteRegionPolicies(java.util.Arrays.asList(backupPolicyPlanRemoteRegionPolicyPrototypeModel)) + // Construct an instance of the AccountIdentityById model + AccountIdentityById accountIdentityModel = new AccountIdentityById.Builder() + .id("bb1b52262f7441a586f49068482f1e60") .build(); - Map backupPolicyPlanPatchModelAsPatch = backupPolicyPlanPatchModel.asPatch(); - // Construct an instance of the UpdateBackupPolicyPlanOptions model - UpdateBackupPolicyPlanOptions updateBackupPolicyPlanOptionsModel = new UpdateBackupPolicyPlanOptions.Builder() - .backupPolicyId("testString") - .id("testString") - .backupPolicyPlanPatch(backupPolicyPlanPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + // Construct an instance of the RevokeAccountForPrivatePathServiceGatewayOptions model + RevokeAccountForPrivatePathServiceGatewayOptions revokeAccountForPrivatePathServiceGatewayOptionsModel = new RevokeAccountForPrivatePathServiceGatewayOptions.Builder() + .privatePathServiceGatewayId("testString") + .account(accountIdentityModel) .build(); - // Invoke updateBackupPolicyPlan() with a valid options model and verify the result - Response response = vpcService.updateBackupPolicyPlan(updateBackupPolicyPlanOptionsModel).execute(); + // Invoke revokeAccountForPrivatePathServiceGateway() with a valid options model and verify the result + Response response = vpcService.revokeAccountForPrivatePathServiceGateway(revokeAccountForPrivatePathServiceGatewayOptionsModel).execute(); assertNotNull(response); - BackupPolicyPlan responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateBackupPolicyPlanPath); + assertEquals(parsedPath, revokeAccountForPrivatePathServiceGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateBackupPolicyPlan operation with and without retries enabled + // Test the revokeAccountForPrivatePathServiceGateway operation with and without retries enabled @Test - public void testUpdateBackupPolicyPlanWRetries() throws Throwable { + public void testRevokeAccountForPrivatePathServiceGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateBackupPolicyPlanWOptions(); + testRevokeAccountForPrivatePathServiceGatewayWOptions(); vpcService.disableRetries(); - testUpdateBackupPolicyPlanWOptions(); + testRevokeAccountForPrivatePathServiceGatewayWOptions(); } - // Test the updateBackupPolicyPlan operation with a null options model (negative test) + // Test the revokeAccountForPrivatePathServiceGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateBackupPolicyPlanNoOptions() throws Throwable { + public void testRevokeAccountForPrivatePathServiceGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateBackupPolicyPlan(null).execute(); + vpcService.revokeAccountForPrivatePathServiceGateway(null).execute(); } - // Test the deleteBackupPolicy operation with a valid options model parameter + // Test the unpublishPrivatePathServiceGateway operation with a valid options model parameter @Test - public void testDeleteBackupPolicyWOptions() throws Throwable { + public void testUnpublishPrivatePathServiceGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}"; - String deleteBackupPolicyPath = "/backup_policies/testString"; + String mockResponseBody = ""; + String unpublishPrivatePathServiceGatewayPath = "/private_path_service_gateways/testString/unpublish"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteBackupPolicyOptions model - DeleteBackupPolicyOptions deleteBackupPolicyOptionsModel = new DeleteBackupPolicyOptions.Builder() - .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + // Construct an instance of the UnpublishPrivatePathServiceGatewayOptions model + UnpublishPrivatePathServiceGatewayOptions unpublishPrivatePathServiceGatewayOptionsModel = new UnpublishPrivatePathServiceGatewayOptions.Builder() + .privatePathServiceGatewayId("testString") .build(); - // Invoke deleteBackupPolicy() with a valid options model and verify the result - Response response = vpcService.deleteBackupPolicy(deleteBackupPolicyOptionsModel).execute(); + // Invoke unpublishPrivatePathServiceGateway() with a valid options model and verify the result + Response response = vpcService.unpublishPrivatePathServiceGateway(unpublishPrivatePathServiceGatewayOptionsModel).execute(); assertNotNull(response); - BackupPolicy responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteBackupPolicyPath); + assertEquals(parsedPath, unpublishPrivatePathServiceGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteBackupPolicy operation with and without retries enabled + // Test the unpublishPrivatePathServiceGateway operation with and without retries enabled @Test - public void testDeleteBackupPolicyWRetries() throws Throwable { + public void testUnpublishPrivatePathServiceGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteBackupPolicyWOptions(); + testUnpublishPrivatePathServiceGatewayWOptions(); vpcService.disableRetries(); - testDeleteBackupPolicyWOptions(); + testUnpublishPrivatePathServiceGatewayWOptions(); } - // Test the deleteBackupPolicy operation with a null options model (negative test) + // Test the unpublishPrivatePathServiceGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteBackupPolicyNoOptions() throws Throwable { + public void testUnpublishPrivatePathServiceGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteBackupPolicy(null).execute(); + vpcService.unpublishPrivatePathServiceGateway(null).execute(); } - // Test the getBackupPolicy operation with a valid options model parameter + // Test the listPublicAddressRanges operation with a valid options model parameter @Test - public void testGetBackupPolicyWOptions() throws Throwable { + public void testListPublicAddressRangesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}"; - String getBackupPolicyPath = "/backup_policies/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"public_address_ranges\": [{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}], \"total_count\": 132}"; + String listPublicAddressRangesPath = "/public_address_ranges"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetBackupPolicyOptions model - GetBackupPolicyOptions getBackupPolicyOptionsModel = new GetBackupPolicyOptions.Builder() - .id("testString") + // Construct an instance of the ListPublicAddressRangesOptions model + ListPublicAddressRangesOptions listPublicAddressRangesOptionsModel = new ListPublicAddressRangesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); - // Invoke getBackupPolicy() with a valid options model and verify the result - Response response = vpcService.getBackupPolicy(getBackupPolicyOptionsModel).execute(); + // Invoke listPublicAddressRanges() with a valid options model and verify the result + Response response = vpcService.listPublicAddressRanges(listPublicAddressRangesOptionsModel).execute(); assertNotNull(response); - BackupPolicy responseObj = response.getResult(); + PublicAddressRangeCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -20370,211 +21387,241 @@ public void testGetBackupPolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getBackupPolicyPath); + assertEquals(parsedPath, listPublicAddressRangesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); } - // Test the getBackupPolicy operation with and without retries enabled + // Test the listPublicAddressRanges operation with and without retries enabled @Test - public void testGetBackupPolicyWRetries() throws Throwable { + public void testListPublicAddressRangesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetBackupPolicyWOptions(); + testListPublicAddressRangesWOptions(); vpcService.disableRetries(); - testGetBackupPolicyWOptions(); - } - - // Test the getBackupPolicy operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetBackupPolicyNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getBackupPolicy(null).execute(); + testListPublicAddressRangesWOptions(); } - // Test the updateBackupPolicy operation with a valid options model parameter + // Test the listPublicAddressRanges operation using the PublicAddressRangesPager.getNext() method @Test - public void testUpdateBackupPolicyWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::backup-policy:r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"health_reasons\": [{\"code\": \"missing_service_authorization_policies\", \"message\": \"One or more accounts are missing service authorization policies\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-backup-service-about&interface=ui\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"id\": \"r006-076191ba-49c2-4763-94fd-c70de73ee2e6\", \"last_job_completed_at\": \"2019-01-01T12:00:00.000Z\", \"lifecycle_state\": \"stable\", \"match_user_tags\": [\"matchUserTags\"], \"name\": \"my-backup-policy\", \"plans\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"backup_policy\", \"scope\": {\"crn\": \"crn:v1:bluemix:public:enterprise::a/aa2432b1fa4d4ace891e9b80fc104e34::enterprise:ebc2b430240943458b9e91e1432cfcce\", \"id\": \"ebc2b430240943458b9e91e1432cfcce\", \"resource_type\": \"enterprise\"}, \"included_content\": [\"data_volumes\"], \"match_resource_type\": \"instance\"}"; - String updateBackupPolicyPath = "/backup_policies/testString"; + public void testListPublicAddressRangesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_address_ranges\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"ipv4_address_count\":8,\"lifecycle_state\":\"stable\",\"name\":\"my-public-address-range\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_address_range\",\"target\":{\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_address_ranges\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"ipv4_address_count\":8,\"lifecycle_state\":\"stable\",\"name\":\"my-public-address-range\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_address_range\",\"target\":{\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the BackupPolicyPatch model - BackupPolicyPatch backupPolicyPatchModel = new BackupPolicyPatch.Builder() - .includedContent(java.util.Arrays.asList("data_volumes")) - .matchUserTags(java.util.Arrays.asList("my-tag-1", "my-tag-2", "my-tag-3")) - .name("my-backup-policy") - .build(); - Map backupPolicyPatchModelAsPatch = backupPolicyPatchModel.asPatch(); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the UpdateBackupPolicyOptions model - UpdateBackupPolicyOptions updateBackupPolicyOptionsModel = new UpdateBackupPolicyOptions.Builder() - .id("testString") - .backupPolicyPatch(backupPolicyPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + ListPublicAddressRangesOptions listPublicAddressRangesOptions = new ListPublicAddressRangesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); - // Invoke updateBackupPolicy() with a valid options model and verify the result - Response response = vpcService.updateBackupPolicy(updateBackupPolicyOptionsModel).execute(); - assertNotNull(response); - BackupPolicy responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateBackupPolicyPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + List allResults = new ArrayList<>(); + PublicAddressRangesPager pager = new PublicAddressRangesPager(vpcService, listPublicAddressRangesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } - - // Test the updateBackupPolicy operation with and without retries enabled + + // Test the listPublicAddressRanges operation using the PublicAddressRangesPager.getAll() method @Test - public void testUpdateBackupPolicyWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testUpdateBackupPolicyWOptions(); + public void testListPublicAddressRangesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_address_ranges\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"ipv4_address_count\":8,\"lifecycle_state\":\"stable\",\"name\":\"my-public-address-range\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_address_range\",\"target\":{\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_address_ranges\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"ipv4_address_count\":8,\"lifecycle_state\":\"stable\",\"name\":\"my-public-address-range\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_address_range\",\"target\":{\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testUpdateBackupPolicyWOptions(); - } + ListPublicAddressRangesOptions listPublicAddressRangesOptions = new ListPublicAddressRangesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .build(); - // Test the updateBackupPolicy operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateBackupPolicyNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.updateBackupPolicy(null).execute(); + PublicAddressRangesPager pager = new PublicAddressRangesPager(vpcService, listPublicAddressRangesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the listRegions operation with a valid options model parameter + + // Test the createPublicAddressRange operation with a valid options model parameter @Test - public void testListRegionsWOptions() throws Throwable { + public void testCreatePublicAddressRangeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"regions\": [{\"endpoint\": \"https://us-south.iaas.cloud.ibm.com\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\", \"status\": \"available\"}]}"; - String listRegionsPath = "/regions"; + String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}"; + String createPublicAddressRangePath = "/public_address_ranges"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the ListRegionsOptions model - ListRegionsOptions listRegionsOptionsModel = new ListRegionsOptions(); + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); - // Invoke listRegions() with a valid options model and verify the result - Response response = vpcService.listRegions(listRegionsOptionsModel).execute(); + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + // Construct an instance of the PublicAddressRangeTargetPrototype model + PublicAddressRangeTargetPrototype publicAddressRangeTargetPrototypeModel = new PublicAddressRangeTargetPrototype.Builder() + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .build(); + + // Construct an instance of the CreatePublicAddressRangeOptions model + CreatePublicAddressRangeOptions createPublicAddressRangeOptionsModel = new CreatePublicAddressRangeOptions.Builder() + .ipv4AddressCount(Long.valueOf("8")) + .name("my-public-address-range") + .resourceGroup(resourceGroupIdentityModel) + .target(publicAddressRangeTargetPrototypeModel) + .build(); + + // Invoke createPublicAddressRange() with a valid options model and verify the result + Response response = vpcService.createPublicAddressRange(createPublicAddressRangeOptionsModel).execute(); assertNotNull(response); - RegionCollection responseObj = response.getResult(); + PublicAddressRange responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listRegionsPath); + assertEquals(parsedPath, createPublicAddressRangePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listRegions operation with and without retries enabled + // Test the createPublicAddressRange operation with and without retries enabled @Test - public void testListRegionsWRetries() throws Throwable { + public void testCreatePublicAddressRangeWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListRegionsWOptions(); + testCreatePublicAddressRangeWOptions(); vpcService.disableRetries(); - testListRegionsWOptions(); + testCreatePublicAddressRangeWOptions(); } - // Test the getRegion operation with a valid options model parameter + // Test the createPublicAddressRange operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreatePublicAddressRangeNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createPublicAddressRange(null).execute(); + } + + // Test the deletePublicAddressRange operation with a valid options model parameter @Test - public void testGetRegionWOptions() throws Throwable { + public void testDeletePublicAddressRangeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"endpoint\": \"https://us-south.iaas.cloud.ibm.com\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\", \"status\": \"available\"}"; - String getRegionPath = "/regions/us-south"; + String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}"; + String deletePublicAddressRangePath = "/public_address_ranges/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the GetRegionOptions model - GetRegionOptions getRegionOptionsModel = new GetRegionOptions.Builder() - .name("us-south") + // Construct an instance of the DeletePublicAddressRangeOptions model + DeletePublicAddressRangeOptions deletePublicAddressRangeOptionsModel = new DeletePublicAddressRangeOptions.Builder() + .id("testString") .build(); - // Invoke getRegion() with a valid options model and verify the result - Response response = vpcService.getRegion(getRegionOptionsModel).execute(); + // Invoke deletePublicAddressRange() with a valid options model and verify the result + Response response = vpcService.deletePublicAddressRange(deletePublicAddressRangeOptionsModel).execute(); assertNotNull(response); - Region responseObj = response.getResult(); + PublicAddressRange responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getRegionPath); + assertEquals(parsedPath, deletePublicAddressRangePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getRegion operation with and without retries enabled + // Test the deletePublicAddressRange operation with and without retries enabled @Test - public void testGetRegionWRetries() throws Throwable { + public void testDeletePublicAddressRangeWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetRegionWOptions(); + testDeletePublicAddressRangeWOptions(); vpcService.disableRetries(); - testGetRegionWOptions(); + testDeletePublicAddressRangeWOptions(); } - // Test the getRegion operation with a null options model (negative test) + // Test the deletePublicAddressRange operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetRegionNoOptions() throws Throwable { + public void testDeletePublicAddressRangeNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getRegion(null).execute(); + vpcService.deletePublicAddressRange(null).execute(); } - // Test the listRegionZones operation with a valid options model parameter + // Test the getPublicAddressRange operation with a valid options model parameter @Test - public void testListRegionZonesWOptions() throws Throwable { + public void testGetPublicAddressRangeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"zones\": [{\"data_center\": \"DAL12\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\", \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}, \"status\": \"available\", \"universal_name\": \"us-south-dal10-a\"}]}"; - String listRegionZonesPath = "/regions/us-south/zones"; + String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}"; + String getPublicAddressRangePath = "/public_address_ranges/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListRegionZonesOptions model - ListRegionZonesOptions listRegionZonesOptionsModel = new ListRegionZonesOptions.Builder() - .regionName("us-south") + // Construct an instance of the GetPublicAddressRangeOptions model + GetPublicAddressRangeOptions getPublicAddressRangeOptionsModel = new GetPublicAddressRangeOptions.Builder() + .id("testString") .build(); - // Invoke listRegionZones() with a valid options model and verify the result - Response response = vpcService.listRegionZones(listRegionZonesOptionsModel).execute(); + // Invoke getPublicAddressRange() with a valid options model and verify the result + Response response = vpcService.getPublicAddressRange(getPublicAddressRangeOptionsModel).execute(); assertNotNull(response); - ZoneCollection responseObj = response.getResult(); + PublicAddressRange responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -20583,107 +21630,130 @@ public void testListRegionZonesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listRegionZonesPath); + assertEquals(parsedPath, getPublicAddressRangePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listRegionZones operation with and without retries enabled + // Test the getPublicAddressRange operation with and without retries enabled @Test - public void testListRegionZonesWRetries() throws Throwable { + public void testGetPublicAddressRangeWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListRegionZonesWOptions(); + testGetPublicAddressRangeWOptions(); vpcService.disableRetries(); - testListRegionZonesWOptions(); + testGetPublicAddressRangeWOptions(); } - // Test the listRegionZones operation with a null options model (negative test) + // Test the getPublicAddressRange operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListRegionZonesNoOptions() throws Throwable { + public void testGetPublicAddressRangeNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listRegionZones(null).execute(); + vpcService.getPublicAddressRange(null).execute(); } - // Test the getRegionZone operation with a valid options model parameter + // Test the updatePublicAddressRange operation with a valid options model parameter @Test - public void testGetRegionZoneWOptions() throws Throwable { + public void testUpdatePublicAddressRangeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"data_center\": \"DAL12\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\", \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}, \"status\": \"available\", \"universal_name\": \"us-south-dal10-a\"}"; - String getRegionZonePath = "/regions/us-south/zones/us-south-1"; + String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}"; + String updatePublicAddressRangePath = "/public_address_ranges/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetRegionZoneOptions model - GetRegionZoneOptions getRegionZoneOptionsModel = new GetRegionZoneOptions.Builder() - .regionName("us-south") + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); - // Invoke getRegionZone() with a valid options model and verify the result - Response response = vpcService.getRegionZone(getRegionZoneOptionsModel).execute(); + // Construct an instance of the PublicAddressRangeTargetPatch model + PublicAddressRangeTargetPatch publicAddressRangeTargetPatchModel = new PublicAddressRangeTargetPatch.Builder() + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .build(); + + // Construct an instance of the PublicAddressRangePatch model + PublicAddressRangePatch publicAddressRangePatchModel = new PublicAddressRangePatch.Builder() + .name("my-public-address-range-updated") + .target(publicAddressRangeTargetPatchModel) + .build(); + Map publicAddressRangePatchModelAsPatch = publicAddressRangePatchModel.asPatch(); + + // Construct an instance of the UpdatePublicAddressRangeOptions model + UpdatePublicAddressRangeOptions updatePublicAddressRangeOptionsModel = new UpdatePublicAddressRangeOptions.Builder() + .id("testString") + .publicAddressRangePatch(publicAddressRangePatchModelAsPatch) + .build(); + + // Invoke updatePublicAddressRange() with a valid options model and verify the result + Response response = vpcService.updatePublicAddressRange(updatePublicAddressRangeOptionsModel).execute(); assertNotNull(response); - Zone responseObj = response.getResult(); + PublicAddressRange responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getRegionZonePath); + assertEquals(parsedPath, updatePublicAddressRangePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getRegionZone operation with and without retries enabled + // Test the updatePublicAddressRange operation with and without retries enabled @Test - public void testGetRegionZoneWRetries() throws Throwable { + public void testUpdatePublicAddressRangeWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetRegionZoneWOptions(); + testUpdatePublicAddressRangeWOptions(); vpcService.disableRetries(); - testGetRegionZoneWOptions(); + testUpdatePublicAddressRangeWOptions(); } - // Test the getRegionZone operation with a null options model (negative test) + // Test the updatePublicAddressRange operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetRegionZoneNoOptions() throws Throwable { + public void testUpdatePublicAddressRangeNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getRegionZone(null).execute(); + vpcService.updatePublicAddressRange(null).execute(); } - // Test the listVirtualNetworkInterfaces operation with a valid options model parameter + // Test the listPublicGateways operation with a valid options model parameter @Test - public void testListVirtualNetworkInterfacesWOptions() throws Throwable { + public void testListPublicGatewaysWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"virtual_network_interfaces\": [{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; - String listVirtualNetworkInterfacesPath = "/virtual_network_interfaces"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"public_gateways\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String listPublicGatewaysPath = "/public_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVirtualNetworkInterfacesOptions model - ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptionsModel = new ListVirtualNetworkInterfacesOptions.Builder() + // Construct an instance of the ListPublicGatewaysOptions model + ListPublicGatewaysOptions listPublicGatewaysOptionsModel = new ListPublicGatewaysOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") .build(); - // Invoke listVirtualNetworkInterfaces() with a valid options model and verify the result - Response response = vpcService.listVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptionsModel).execute(); + // Invoke listPublicGateways() with a valid options model and verify the result + Response response = vpcService.listPublicGateways(listPublicGatewaysOptionsModel).execute(); assertNotNull(response); - VirtualNetworkInterfaceCollection responseObj = response.getResult(); + PublicGatewayCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -20692,33 +21762,33 @@ public void testListVirtualNetworkInterfacesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVirtualNetworkInterfacesPath); + assertEquals(parsedPath, listPublicGatewaysPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); } - // Test the listVirtualNetworkInterfaces operation with and without retries enabled + // Test the listPublicGateways operation with and without retries enabled @Test - public void testListVirtualNetworkInterfacesWRetries() throws Throwable { + public void testListPublicGatewaysWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVirtualNetworkInterfacesWOptions(); + testListPublicGatewaysWOptions(); vpcService.disableRetries(); - testListVirtualNetworkInterfacesWOptions(); + testListPublicGatewaysWOptions(); } - // Test the listVirtualNetworkInterfaces operation using the VirtualNetworkInterfacesPager.getNext() method + // Test the listPublicGateways operation using the PublicGatewaysPager.getNext() method @Test - public void testListVirtualNetworkInterfacesWithPagerGetNext() throws Throwable { + public void testListPublicGatewaysWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"virtual_network_interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"enable_infrastructure_nat\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-virtual-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"protocol_state_filtering_mode\":\"auto\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"virtual_network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"virtual_network_interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"enable_infrastructure_nat\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-virtual-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"protocol_state_filtering_mode\":\"auto\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"virtual_network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -20732,27 +21802,27 @@ public void testListVirtualNetworkInterfacesWithPagerGetNext() throws Throwable .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptions = new ListVirtualNetworkInterfacesOptions.Builder() + ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") .build(); - List allResults = new ArrayList<>(); - VirtualNetworkInterfacesPager pager = new VirtualNetworkInterfacesPager(vpcService, listVirtualNetworkInterfacesOptions); + List allResults = new ArrayList<>(); + PublicGatewaysPager pager = new PublicGatewaysPager(vpcService, listPublicGatewaysOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listVirtualNetworkInterfaces operation using the VirtualNetworkInterfacesPager.getAll() method + // Test the listPublicGateways operation using the PublicGatewaysPager.getAll() method @Test - public void testListVirtualNetworkInterfacesWithPagerGetAll() throws Throwable { + public void testListPublicGatewaysWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"virtual_network_interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"enable_infrastructure_nat\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-virtual-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"protocol_state_filtering_mode\":\"auto\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"virtual_network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"virtual_network_interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"enable_infrastructure_nat\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-virtual-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"protocol_state_filtering_mode\":\"auto\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"virtual_network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -20766,36 +21836,41 @@ public void testListVirtualNetworkInterfacesWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptions = new ListVirtualNetworkInterfacesOptions.Builder() + ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") .build(); - VirtualNetworkInterfacesPager pager = new VirtualNetworkInterfacesPager(vpcService, listVirtualNetworkInterfacesOptions); - List allResults = pager.getAll(); + PublicGatewaysPager pager = new PublicGatewaysPager(vpcService, listPublicGatewaysOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createVirtualNetworkInterface operation with a valid options model parameter + // Test the createPublicGateway operation with a valid options model parameter @Test - public void testCreateVirtualNetworkInterfaceWOptions() throws Throwable { + public void testCreatePublicGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createVirtualNetworkInterfacePath = "/virtual_network_interfaces"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createPublicGatewayPath = "/public_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById model - VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.Builder() - .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById model - VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById.Builder() - .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + // Construct an instance of the PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model + PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById publicGatewayFloatingIpPrototypeModel = new PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.Builder() + .id("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd") .build(); // Construct an instance of the ResourceGroupIdentityById model @@ -20803,34 +21878,19 @@ public void testCreateVirtualNetworkInterfaceWOptions() throws Throwable { .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793") - .build(); - - // Construct an instance of the CreateVirtualNetworkInterfaceOptions model - CreateVirtualNetworkInterfaceOptions createVirtualNetworkInterfaceOptionsModel = new CreateVirtualNetworkInterfaceOptions.Builder() - .allowIpSpoofing(false) - .autoDelete(false) - .enableInfrastructureNat(true) - .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) - .name("my-virtual-network-interface") - .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) - .protocolStateFilteringMode("auto") + // Construct an instance of the CreatePublicGatewayOptions model + CreatePublicGatewayOptions createPublicGatewayOptionsModel = new CreatePublicGatewayOptions.Builder() + .vpc(vpcIdentityModel) + .zone(zoneIdentityModel) + .floatingIp(publicGatewayFloatingIpPrototypeModel) + .name("my-public-gateway") .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) - .subnet(subnetIdentityModel) .build(); - // Invoke createVirtualNetworkInterface() with a valid options model and verify the result - Response response = vpcService.createVirtualNetworkInterface(createVirtualNetworkInterfaceOptionsModel).execute(); + // Invoke createPublicGateway() with a valid options model and verify the result + Response response = vpcService.createPublicGateway(createPublicGatewayOptionsModel).execute(); assertNotNull(response); - VirtualNetworkInterface responseObj = response.getResult(); + PublicGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -20839,45 +21899,51 @@ public void testCreateVirtualNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVirtualNetworkInterfacePath); + assertEquals(parsedPath, createPublicGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVirtualNetworkInterface operation with and without retries enabled + // Test the createPublicGateway operation with and without retries enabled @Test - public void testCreateVirtualNetworkInterfaceWRetries() throws Throwable { + public void testCreatePublicGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVirtualNetworkInterfaceWOptions(); + testCreatePublicGatewayWOptions(); vpcService.disableRetries(); - testCreateVirtualNetworkInterfaceWOptions(); + testCreatePublicGatewayWOptions(); } - // Test the deleteVirtualNetworkInterfaces operation with a valid options model parameter + // Test the createPublicGateway operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreatePublicGatewayNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createPublicGateway(null).execute(); + } + + // Test the deletePublicGateway operation with a valid options model parameter @Test - public void testDeleteVirtualNetworkInterfacesWOptions() throws Throwable { + public void testDeletePublicGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String deleteVirtualNetworkInterfacesPath = "/virtual_network_interfaces/testString"; + String mockResponseBody = ""; + String deletePublicGatewayPath = "/public_gateways/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVirtualNetworkInterfacesOptions model - DeleteVirtualNetworkInterfacesOptions deleteVirtualNetworkInterfacesOptionsModel = new DeleteVirtualNetworkInterfacesOptions.Builder() + // Construct an instance of the DeletePublicGatewayOptions model + DeletePublicGatewayOptions deletePublicGatewayOptionsModel = new DeletePublicGatewayOptions.Builder() .id("testString") .build(); - // Invoke deleteVirtualNetworkInterfaces() with a valid options model and verify the result - Response response = vpcService.deleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModel).execute(); + // Invoke deletePublicGateway() with a valid options model and verify the result + Response response = vpcService.deletePublicGateway(deletePublicGatewayOptionsModel).execute(); assertNotNull(response); - VirtualNetworkInterface responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -20885,51 +21951,51 @@ public void testDeleteVirtualNetworkInterfacesWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVirtualNetworkInterfacesPath); + assertEquals(parsedPath, deletePublicGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVirtualNetworkInterfaces operation with and without retries enabled + // Test the deletePublicGateway operation with and without retries enabled @Test - public void testDeleteVirtualNetworkInterfacesWRetries() throws Throwable { + public void testDeletePublicGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVirtualNetworkInterfacesWOptions(); + testDeletePublicGatewayWOptions(); vpcService.disableRetries(); - testDeleteVirtualNetworkInterfacesWOptions(); + testDeletePublicGatewayWOptions(); } - // Test the deleteVirtualNetworkInterfaces operation with a null options model (negative test) + // Test the deletePublicGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVirtualNetworkInterfacesNoOptions() throws Throwable { + public void testDeletePublicGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVirtualNetworkInterfaces(null).execute(); + vpcService.deletePublicGateway(null).execute(); } - // Test the getVirtualNetworkInterface operation with a valid options model parameter + // Test the getPublicGateway operation with a valid options model parameter @Test - public void testGetVirtualNetworkInterfaceWOptions() throws Throwable { + public void testGetPublicGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getVirtualNetworkInterfacePath = "/virtual_network_interfaces/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getPublicGatewayPath = "/public_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVirtualNetworkInterfaceOptions model - GetVirtualNetworkInterfaceOptions getVirtualNetworkInterfaceOptionsModel = new GetVirtualNetworkInterfaceOptions.Builder() + // Construct an instance of the GetPublicGatewayOptions model + GetPublicGatewayOptions getPublicGatewayOptionsModel = new GetPublicGatewayOptions.Builder() .id("testString") .build(); - // Invoke getVirtualNetworkInterface() with a valid options model and verify the result - Response response = vpcService.getVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModel).execute(); + // Invoke getPublicGateway() with a valid options model and verify the result + Response response = vpcService.getPublicGateway(getPublicGatewayOptionsModel).execute(); assertNotNull(response); - VirtualNetworkInterface responseObj = response.getResult(); + PublicGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -20938,62 +22004,58 @@ public void testGetVirtualNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVirtualNetworkInterfacePath); + assertEquals(parsedPath, getPublicGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVirtualNetworkInterface operation with and without retries enabled + // Test the getPublicGateway operation with and without retries enabled @Test - public void testGetVirtualNetworkInterfaceWRetries() throws Throwable { + public void testGetPublicGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVirtualNetworkInterfaceWOptions(); + testGetPublicGatewayWOptions(); vpcService.disableRetries(); - testGetVirtualNetworkInterfaceWOptions(); + testGetPublicGatewayWOptions(); } - // Test the getVirtualNetworkInterface operation with a null options model (negative test) + // Test the getPublicGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVirtualNetworkInterfaceNoOptions() throws Throwable { + public void testGetPublicGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVirtualNetworkInterface(null).execute(); + vpcService.getPublicGateway(null).execute(); } - // Test the updateVirtualNetworkInterface operation with a valid options model parameter + // Test the updatePublicGateway operation with a valid options model parameter @Test - public void testUpdateVirtualNetworkInterfaceWOptions() throws Throwable { + public void testUpdatePublicGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateVirtualNetworkInterfacePath = "/virtual_network_interfaces/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updatePublicGatewayPath = "/public_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VirtualNetworkInterfacePatch model - VirtualNetworkInterfacePatch virtualNetworkInterfacePatchModel = new VirtualNetworkInterfacePatch.Builder() - .allowIpSpoofing(true) - .autoDelete(false) - .enableInfrastructureNat(true) - .name("my-virtual-network-interface") - .protocolStateFilteringMode("auto") + // Construct an instance of the PublicGatewayPatch model + PublicGatewayPatch publicGatewayPatchModel = new PublicGatewayPatch.Builder() + .name("my-public-gateway-updated") .build(); - Map virtualNetworkInterfacePatchModelAsPatch = virtualNetworkInterfacePatchModel.asPatch(); + Map publicGatewayPatchModelAsPatch = publicGatewayPatchModel.asPatch(); - // Construct an instance of the UpdateVirtualNetworkInterfaceOptions model - UpdateVirtualNetworkInterfaceOptions updateVirtualNetworkInterfaceOptionsModel = new UpdateVirtualNetworkInterfaceOptions.Builder() + // Construct an instance of the UpdatePublicGatewayOptions model + UpdatePublicGatewayOptions updatePublicGatewayOptionsModel = new UpdatePublicGatewayOptions.Builder() .id("testString") - .virtualNetworkInterfacePatch(virtualNetworkInterfacePatchModelAsPatch) + .publicGatewayPatch(publicGatewayPatchModelAsPatch) .build(); - // Invoke updateVirtualNetworkInterface() with a valid options model and verify the result - Response response = vpcService.updateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModel).execute(); + // Invoke updatePublicGateway() with a valid options model and verify the result + Response response = vpcService.updatePublicGateway(updatePublicGatewayOptionsModel).execute(); assertNotNull(response); - VirtualNetworkInterface responseObj = response.getResult(); + PublicGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -21002,54 +22064,57 @@ public void testUpdateVirtualNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVirtualNetworkInterfacePath); + assertEquals(parsedPath, updatePublicGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVirtualNetworkInterface operation with and without retries enabled + // Test the updatePublicGateway operation with and without retries enabled @Test - public void testUpdateVirtualNetworkInterfaceWRetries() throws Throwable { + public void testUpdatePublicGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVirtualNetworkInterfaceWOptions(); + testUpdatePublicGatewayWOptions(); vpcService.disableRetries(); - testUpdateVirtualNetworkInterfaceWOptions(); + testUpdatePublicGatewayWOptions(); } - // Test the updateVirtualNetworkInterface operation with a null options model (negative test) + // Test the updatePublicGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVirtualNetworkInterfaceNoOptions() throws Throwable { + public void testUpdatePublicGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVirtualNetworkInterface(null).execute(); + vpcService.updatePublicGateway(null).execute(); } - // Test the listNetworkInterfaceFloatingIps operation with a valid options model parameter + // Test the listReservations operation with a valid options model parameter @Test - public void testListNetworkInterfaceFloatingIpsWOptions() throws Throwable { + public void testListReservationsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listNetworkInterfaceFloatingIpsPath = "/virtual_network_interfaces/testString/floating_ips"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"reservations\": [{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String listReservationsPath = "/reservations"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListNetworkInterfaceFloatingIpsOptions model - ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptionsModel = new ListNetworkInterfaceFloatingIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + // Construct an instance of the ListReservationsOptions model + ListReservationsOptions listReservationsOptionsModel = new ListReservationsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .sort("name") + .name("my-name") + .profileResourceType("testString") + .affinityPolicy("automatic") + .resourceGroupId("testString") + .zoneName("us-south-1") .build(); - // Invoke listNetworkInterfaceFloatingIps() with a valid options model and verify the result - Response response = vpcService.listNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModel).execute(); + // Invoke listReservations() with a valid options model and verify the result + Response response = vpcService.listReservations(listReservationsOptionsModel).execute(); assertNotNull(response); - FloatingIPCollectionVirtualNetworkInterfaceContext responseObj = response.getResult(); + ReservationCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -21058,40 +22123,37 @@ public void testListNetworkInterfaceFloatingIpsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listNetworkInterfaceFloatingIpsPath); + assertEquals(parsedPath, listReservationsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("sort"), "name"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("profile.resource_type"), "testString"); + assertEquals(query.get("affinity_policy"), "automatic"); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); } - // Test the listNetworkInterfaceFloatingIps operation with and without retries enabled + // Test the listReservations operation with and without retries enabled @Test - public void testListNetworkInterfaceFloatingIpsWRetries() throws Throwable { + public void testListReservationsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListNetworkInterfaceFloatingIpsWOptions(); + testListReservationsWOptions(); vpcService.disableRetries(); - testListNetworkInterfaceFloatingIpsWOptions(); - } - - // Test the listNetworkInterfaceFloatingIps operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListNetworkInterfaceFloatingIpsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listNetworkInterfaceFloatingIps(null).execute(); + testListReservationsWOptions(); } - // Test the listNetworkInterfaceFloatingIps operation using the NetworkInterfaceFloatingIpsPager.getNext() method + // Test the listReservations operation using the ReservationsPager.getNext() method @Test - public void testListNetworkInterfaceFloatingIpsWithPagerGetNext() throws Throwable { + public void testListReservationsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reservations\":[{\"affinity_policy\":\"automatic\",\"capacity\":{\"allocated\":10,\"available\":8,\"status\":\"allocated\",\"total\":10,\"used\":2},\"committed_use\":{\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_policy\":\"release\",\"term\":\"term\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"lifecycle_state\":\"stable\",\"name\":\"my-reservation\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"reservation\",\"status\":\"activating\",\"status_reasons\":[{\"code\":\"cannot_activate_no_capacity_available\",\"message\":\"The reservation cannot be activated because capacity is unavailable\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reservations\":[{\"affinity_policy\":\"automatic\",\"capacity\":{\"allocated\":10,\"available\":8,\"status\":\"allocated\",\"total\":10,\"used\":2},\"committed_use\":{\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_policy\":\"release\",\"term\":\"term\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"lifecycle_state\":\"stable\",\"name\":\"my-reservation\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"reservation\",\"status\":\"activating\",\"status_reasons\":[{\"code\":\"cannot_activate_no_capacity_available\",\"message\":\"The reservation cannot be activated because capacity is unavailable\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -21105,28 +22167,31 @@ public void testListNetworkInterfaceFloatingIpsWithPagerGetNext() throws Throwab .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptions = new ListNetworkInterfaceFloatingIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + ListReservationsOptions listReservationsOptions = new ListReservationsOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") + .name("my-name") + .profileResourceType("testString") + .affinityPolicy("automatic") + .resourceGroupId("testString") + .zoneName("us-south-1") .build(); - List allResults = new ArrayList<>(); - NetworkInterfaceFloatingIpsPager pager = new NetworkInterfaceFloatingIpsPager(vpcService, listNetworkInterfaceFloatingIpsOptions); + List allResults = new ArrayList<>(); + ReservationsPager pager = new ReservationsPager(vpcService, listReservationsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listNetworkInterfaceFloatingIps operation using the NetworkInterfaceFloatingIpsPager.getAll() method + // Test the listReservations operation using the ReservationsPager.getAll() method @Test - public void testListNetworkInterfaceFloatingIpsWithPagerGetAll() throws Throwable { + public void testListReservationsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reservations\":[{\"affinity_policy\":\"automatic\",\"capacity\":{\"allocated\":10,\"available\":8,\"status\":\"allocated\",\"total\":10,\"used\":2},\"committed_use\":{\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_policy\":\"release\",\"term\":\"term\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"lifecycle_state\":\"stable\",\"name\":\"my-reservation\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"reservation\",\"status\":\"activating\",\"status_reasons\":[{\"code\":\"cannot_activate_no_capacity_available\",\"message\":\"The reservation cannot be activated because capacity is unavailable\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reservations\":[{\"affinity_policy\":\"automatic\",\"capacity\":{\"allocated\":10,\"available\":8,\"status\":\"allocated\",\"total\":10,\"used\":2},\"committed_use\":{\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_policy\":\"release\",\"term\":\"term\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"id\":\"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\",\"lifecycle_state\":\"stable\",\"name\":\"my-reservation\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"reservation\",\"status\":\"activating\",\"status_reasons\":[{\"code\":\"cannot_activate_no_capacity_available\",\"message\":\"The reservation cannot be activated because capacity is unavailable\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -21140,39 +22205,128 @@ public void testListNetworkInterfaceFloatingIpsWithPagerGetAll() throws Throwabl .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptions = new ListNetworkInterfaceFloatingIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + ListReservationsOptions listReservationsOptions = new ListReservationsOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") + .name("my-name") + .profileResourceType("testString") + .affinityPolicy("automatic") + .resourceGroupId("testString") + .zoneName("us-south-1") .build(); - NetworkInterfaceFloatingIpsPager pager = new NetworkInterfaceFloatingIpsPager(vpcService, listNetworkInterfaceFloatingIpsOptions); - List allResults = pager.getAll(); + ReservationsPager pager = new ReservationsPager(vpcService, listReservationsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the removeNetworkInterfaceFloatingIp operation with a valid options model parameter + // Test the createReservation operation with a valid options model parameter @Test - public void testRemoveNetworkInterfaceFloatingIpWOptions() throws Throwable { + public void testCreateReservationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String removeNetworkInterfaceFloatingIpPath = "/virtual_network_interfaces/testString/floating_ips/testString"; + String mockResponseBody = "{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createReservationPath = "/reservations"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the RemoveNetworkInterfaceFloatingIpOptions model - RemoveNetworkInterfaceFloatingIpOptions removeNetworkInterfaceFloatingIpOptionsModel = new RemoveNetworkInterfaceFloatingIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + // Construct an instance of the ReservationCapacityPrototype model + ReservationCapacityPrototype reservationCapacityPrototypeModel = new ReservationCapacityPrototype.Builder() + .total(Long.valueOf("10")) + .build(); + + // Construct an instance of the ReservationCommittedUsePrototype model + ReservationCommittedUsePrototype reservationCommittedUsePrototypeModel = new ReservationCommittedUsePrototype.Builder() + .expirationPolicy("release") + .term("testString") + .build(); + + // Construct an instance of the ReservationProfilePrototype model + ReservationProfilePrototype reservationProfilePrototypeModel = new ReservationProfilePrototype.Builder() + .name("bx2-4x16") + .resourceType("bare_metal_server_profile") + .build(); + + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the CreateReservationOptions model + CreateReservationOptions createReservationOptionsModel = new CreateReservationOptions.Builder() + .capacity(reservationCapacityPrototypeModel) + .committedUse(reservationCommittedUsePrototypeModel) + .profile(reservationProfilePrototypeModel) + .zone(zoneIdentityModel) + .affinityPolicy("automatic") + .name("my-reservation") + .resourceGroup(resourceGroupIdentityModel) + .build(); + + // Invoke createReservation() with a valid options model and verify the result + Response response = vpcService.createReservation(createReservationOptionsModel).execute(); + assertNotNull(response); + Reservation responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createReservationPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createReservation operation with and without retries enabled + @Test + public void testCreateReservationWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateReservationWOptions(); + + vpcService.disableRetries(); + testCreateReservationWOptions(); + } + + // Test the createReservation operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateReservationNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createReservation(null).execute(); + } + + // Test the deleteReservation operation with a valid options model parameter + @Test + public void testDeleteReservationWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String deleteReservationPath = "/reservations/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteReservationOptions model + DeleteReservationOptions deleteReservationOptionsModel = new DeleteReservationOptions.Builder() .id("testString") .build(); - // Invoke removeNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.removeNetworkInterfaceFloatingIp(removeNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke deleteReservation() with a valid options model and verify the result + Response response = vpcService.deleteReservation(deleteReservationOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + Reservation responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -21180,52 +22334,51 @@ public void testRemoveNetworkInterfaceFloatingIpWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, removeNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, deleteReservationPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the removeNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the deleteReservation operation with and without retries enabled @Test - public void testRemoveNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testDeleteReservationWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testRemoveNetworkInterfaceFloatingIpWOptions(); + testDeleteReservationWOptions(); vpcService.disableRetries(); - testRemoveNetworkInterfaceFloatingIpWOptions(); + testDeleteReservationWOptions(); } - // Test the removeNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the deleteReservation operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testRemoveNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testDeleteReservationNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.removeNetworkInterfaceFloatingIp(null).execute(); + vpcService.deleteReservation(null).execute(); } - // Test the getNetworkInterfaceFloatingIp operation with a valid options model parameter + // Test the getReservation operation with a valid options model parameter @Test - public void testGetNetworkInterfaceFloatingIpWOptions() throws Throwable { + public void testGetReservationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}"; - String getNetworkInterfaceFloatingIpPath = "/virtual_network_interfaces/testString/floating_ips/testString"; + String mockResponseBody = "{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getReservationPath = "/reservations/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetNetworkInterfaceFloatingIpOptions model - GetNetworkInterfaceFloatingIpOptions getNetworkInterfaceFloatingIpOptionsModel = new GetNetworkInterfaceFloatingIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + // Construct an instance of the GetReservationOptions model + GetReservationOptions getReservationOptionsModel = new GetReservationOptions.Builder() .id("testString") .build(); - // Invoke getNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.getNetworkInterfaceFloatingIp(getNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke getReservation() with a valid options model and verify the result + Response response = vpcService.getReservation(getReservationOptionsModel).execute(); assertNotNull(response); - FloatingIPReference responseObj = response.getResult(); + Reservation responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -21234,108 +22387,189 @@ public void testGetNetworkInterfaceFloatingIpWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, getReservationPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the getReservation operation with and without retries enabled @Test - public void testGetNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testGetReservationWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetNetworkInterfaceFloatingIpWOptions(); + testGetReservationWOptions(); vpcService.disableRetries(); - testGetNetworkInterfaceFloatingIpWOptions(); + testGetReservationWOptions(); } - // Test the getNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the getReservation operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testGetReservationNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getNetworkInterfaceFloatingIp(null).execute(); + vpcService.getReservation(null).execute(); } - // Test the addNetworkInterfaceFloatingIp operation with a valid options model parameter + // Test the updateReservation operation with a valid options model parameter @Test - public void testAddNetworkInterfaceFloatingIpWOptions() throws Throwable { + public void testUpdateReservationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}"; - String addNetworkInterfaceFloatingIpPath = "/virtual_network_interfaces/testString/floating_ips/testString"; + String mockResponseBody = "{\"affinity_policy\": \"automatic\", \"capacity\": {\"allocated\": 10, \"available\": 8, \"status\": \"allocated\", \"total\": 10, \"used\": 2}, \"committed_use\": {\"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_policy\": \"release\", \"term\": \"term\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::reservation:0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/reservations/0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"id\": \"0717-ba49df72-37b8-43ac-98da-f8e029de0e63\", \"lifecycle_state\": \"stable\", \"name\": \"my-reservation\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"reservation\", \"status\": \"activating\", \"status_reasons\": [{\"code\": \"cannot_activate_no_capacity_available\", \"message\": \"The reservation cannot be activated because capacity is unavailable\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-reserved-capacity-status-reasons\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateReservationPath = "/reservations/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the AddNetworkInterfaceFloatingIpOptions model - AddNetworkInterfaceFloatingIpOptions addNetworkInterfaceFloatingIpOptionsModel = new AddNetworkInterfaceFloatingIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + // Construct an instance of the ReservationCapacityPatch model + ReservationCapacityPatch reservationCapacityPatchModel = new ReservationCapacityPatch.Builder() + .total(Long.valueOf("10")) + .build(); + + // Construct an instance of the ReservationCommittedUsePatch model + ReservationCommittedUsePatch reservationCommittedUsePatchModel = new ReservationCommittedUsePatch.Builder() + .expirationPolicy("release") + .term("testString") + .build(); + + // Construct an instance of the ReservationProfilePatch model + ReservationProfilePatch reservationProfilePatchModel = new ReservationProfilePatch.Builder() + .name("bx2-4x16") + .resourceType("bare_metal_server_profile") + .build(); + + // Construct an instance of the ReservationPatch model + ReservationPatch reservationPatchModel = new ReservationPatch.Builder() + .affinityPolicy("automatic") + .capacity(reservationCapacityPatchModel) + .committedUse(reservationCommittedUsePatchModel) + .name("my-reservation") + .profile(reservationProfilePatchModel) + .build(); + Map reservationPatchModelAsPatch = reservationPatchModel.asPatch(); + + // Construct an instance of the UpdateReservationOptions model + UpdateReservationOptions updateReservationOptionsModel = new UpdateReservationOptions.Builder() .id("testString") + .reservationPatch(reservationPatchModelAsPatch) .build(); - // Invoke addNetworkInterfaceFloatingIp() with a valid options model and verify the result - Response response = vpcService.addNetworkInterfaceFloatingIp(addNetworkInterfaceFloatingIpOptionsModel).execute(); + // Invoke updateReservation() with a valid options model and verify the result + Response response = vpcService.updateReservation(updateReservationOptionsModel).execute(); assertNotNull(response); - FloatingIPReference responseObj = response.getResult(); + Reservation responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addNetworkInterfaceFloatingIpPath); + assertEquals(parsedPath, updateReservationPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the addNetworkInterfaceFloatingIp operation with and without retries enabled + // Test the updateReservation operation with and without retries enabled @Test - public void testAddNetworkInterfaceFloatingIpWRetries() throws Throwable { + public void testUpdateReservationWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testAddNetworkInterfaceFloatingIpWOptions(); + testUpdateReservationWOptions(); vpcService.disableRetries(); - testAddNetworkInterfaceFloatingIpWOptions(); + testUpdateReservationWOptions(); } - // Test the addNetworkInterfaceFloatingIp operation with a null options model (negative test) + // Test the updateReservation operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddNetworkInterfaceFloatingIpNoOptions() throws Throwable { + public void testUpdateReservationNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.addNetworkInterfaceFloatingIp(null).execute(); + vpcService.updateReservation(null).execute(); } - // Test the listVirtualNetworkInterfaceIps operation with a valid options model parameter + // Test the activateReservation operation with a valid options model parameter @Test - public void testListVirtualNetworkInterfaceIpsWOptions() throws Throwable { + public void testActivateReservationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listVirtualNetworkInterfaceIpsPath = "/virtual_network_interfaces/testString/ips"; + String mockResponseBody = ""; + String activateReservationPath = "/reservations/testString/activate"; + server.enqueue(new MockResponse() + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the ActivateReservationOptions model + ActivateReservationOptions activateReservationOptionsModel = new ActivateReservationOptions.Builder() + .id("testString") + .build(); + + // Invoke activateReservation() with a valid options model and verify the result + Response response = vpcService.activateReservation(activateReservationOptionsModel).execute(); + assertNotNull(response); + Void responseObj = response.getResult(); + assertNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, activateReservationPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the activateReservation operation with and without retries enabled + @Test + public void testActivateReservationWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testActivateReservationWOptions(); + + vpcService.disableRetries(); + testActivateReservationWOptions(); + } + + // Test the activateReservation operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testActivateReservationNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.activateReservation(null).execute(); + } + + // Test the listSecurityGroups operation with a valid options model parameter + @Test + public void testListSecurityGroupsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"security_groups\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"total_count\": 132}"; + String listSecurityGroupsPath = "/security_groups"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVirtualNetworkInterfaceIpsOptions model - ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptionsModel = new ListVirtualNetworkInterfaceIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + // Construct an instance of the ListSecurityGroupsOptions model + ListSecurityGroupsOptions listSecurityGroupsOptionsModel = new ListSecurityGroupsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .sort("name") + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); - // Invoke listVirtualNetworkInterfaceIps() with a valid options model and verify the result - Response response = vpcService.listVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModel).execute(); + // Invoke listSecurityGroups() with a valid options model and verify the result + Response response = vpcService.listSecurityGroups(listSecurityGroupsOptionsModel).execute(); assertNotNull(response); - ReservedIPCollectionVirtualNetworkInterfaceContext responseObj = response.getResult(); + SecurityGroupCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -21344,40 +22578,36 @@ public void testListVirtualNetworkInterfaceIpsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVirtualNetworkInterfaceIpsPath); + assertEquals(parsedPath, listSecurityGroupsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("sort"), "name"); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("vpc.id"), "testString"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); } - // Test the listVirtualNetworkInterfaceIps operation with and without retries enabled + // Test the listSecurityGroups operation with and without retries enabled @Test - public void testListVirtualNetworkInterfaceIpsWRetries() throws Throwable { + public void testListSecurityGroupsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVirtualNetworkInterfaceIpsWOptions(); + testListSecurityGroupsWOptions(); vpcService.disableRetries(); - testListVirtualNetworkInterfaceIpsWOptions(); - } - - // Test the listVirtualNetworkInterfaceIps operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVirtualNetworkInterfaceIpsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listVirtualNetworkInterfaceIps(null).execute(); + testListSecurityGroupsWOptions(); } - // Test the listVirtualNetworkInterfaceIps operation using the VirtualNetworkInterfaceIpsPager.getNext() method + // Test the listSecurityGroups operation using the SecurityGroupsPager.getNext() method @Test - public void testListVirtualNetworkInterfaceIpsWithPagerGetNext() throws Throwable { + public void testListSecurityGroupsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"local\":{\"address\":\"192.168.3.4\"},\"name\":\"my-security-group-rule\",\"remote\":{\"address\":\"192.168.3.4\"},\"resource_type\":\"security_group_rule\",\"protocol\":\"any\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"local\":{\"address\":\"192.168.3.4\"},\"name\":\"my-security-group-rule\",\"remote\":{\"address\":\"192.168.3.4\"},\"resource_type\":\"security_group_rule\",\"protocol\":\"any\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -21391,28 +22621,30 @@ public void testListVirtualNetworkInterfaceIpsWithPagerGetNext() throws Throwabl .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptions = new ListVirtualNetworkInterfaceIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); - List allResults = new ArrayList<>(); - VirtualNetworkInterfaceIpsPager pager = new VirtualNetworkInterfaceIpsPager(vpcService, listVirtualNetworkInterfaceIpsOptions); + List allResults = new ArrayList<>(); + SecurityGroupsPager pager = new SecurityGroupsPager(vpcService, listSecurityGroupsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listVirtualNetworkInterfaceIps operation using the VirtualNetworkInterfaceIpsPager.getAll() method + // Test the listSecurityGroups operation using the SecurityGroupsPager.getAll() method @Test - public void testListVirtualNetworkInterfaceIpsWithPagerGetAll() throws Throwable { + public void testListSecurityGroupsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"local\":{\"address\":\"192.168.3.4\"},\"name\":\"my-security-group-rule\",\"remote\":{\"address\":\"192.168.3.4\"},\"resource_type\":\"security_group_rule\",\"protocol\":\"any\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"local\":{\"address\":\"192.168.3.4\"},\"name\":\"my-security-group-rule\",\"remote\":{\"address\":\"192.168.3.4\"},\"resource_type\":\"security_group_rule\",\"protocol\":\"any\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -21426,36 +22658,123 @@ public void testListVirtualNetworkInterfaceIpsWithPagerGetAll() throws Throwable .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptions = new ListVirtualNetworkInterfaceIpsOptions.Builder() - .virtualNetworkInterfaceId("testString") + ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() .limit(Long.valueOf("10")) - .sort("name") + .resourceGroupId("testString") + .vpcId("testString") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") .build(); - VirtualNetworkInterfaceIpsPager pager = new VirtualNetworkInterfaceIpsPager(vpcService, listVirtualNetworkInterfaceIpsOptions); - List allResults = pager.getAll(); + SecurityGroupsPager pager = new SecurityGroupsPager(vpcService, listSecurityGroupsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the removeVirtualNetworkInterfaceIp operation with a valid options model parameter + // Test the createSecurityGroup operation with a valid options model parameter @Test - public void testRemoveVirtualNetworkInterfaceIpWOptions() throws Throwable { + public void testCreateSecurityGroupWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String createSecurityGroupPath = "/security_groups"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the SecurityGroupRuleLocalPrototypeIP model + SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() + .address("192.168.3.4") + .build(); + + // Construct an instance of the SecurityGroupRuleRemotePrototypeIP model + SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() + .address("192.168.3.4") + .build(); + + // Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype model + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Builder() + .direction("inbound") + .ipVersion("ipv4") + .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") + .remote(securityGroupRuleRemotePrototypeModel) + .protocol("any") + .build(); + + // Construct an instance of the CreateSecurityGroupOptions model + CreateSecurityGroupOptions createSecurityGroupOptionsModel = new CreateSecurityGroupOptions.Builder() + .vpc(vpcIdentityModel) + .name("my-security-group") + .resourceGroup(resourceGroupIdentityModel) + .rules(java.util.Arrays.asList(securityGroupRulePrototypeModel)) + .build(); + + // Invoke createSecurityGroup() with a valid options model and verify the result + Response response = vpcService.createSecurityGroup(createSecurityGroupOptionsModel).execute(); + assertNotNull(response); + SecurityGroup responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createSecurityGroupPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createSecurityGroup operation with and without retries enabled + @Test + public void testCreateSecurityGroupWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateSecurityGroupWOptions(); + + vpcService.disableRetries(); + testCreateSecurityGroupWOptions(); + } + + // Test the createSecurityGroup operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateSecurityGroupNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createSecurityGroup(null).execute(); + } + + // Test the deleteSecurityGroup operation with a valid options model parameter + @Test + public void testDeleteSecurityGroupWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String removeVirtualNetworkInterfaceIpPath = "/virtual_network_interfaces/testString/ips/testString"; + String deleteSecurityGroupPath = "/security_groups/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the RemoveVirtualNetworkInterfaceIpOptions model - RemoveVirtualNetworkInterfaceIpOptions removeVirtualNetworkInterfaceIpOptionsModel = new RemoveVirtualNetworkInterfaceIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + // Construct an instance of the DeleteSecurityGroupOptions model + DeleteSecurityGroupOptions deleteSecurityGroupOptionsModel = new DeleteSecurityGroupOptions.Builder() .id("testString") .build(); - // Invoke removeVirtualNetworkInterfaceIp() with a valid options model and verify the result - Response response = vpcService.removeVirtualNetworkInterfaceIp(removeVirtualNetworkInterfaceIpOptionsModel).execute(); + // Invoke deleteSecurityGroup() with a valid options model and verify the result + Response response = vpcService.deleteSecurityGroup(deleteSecurityGroupOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -21466,52 +22785,51 @@ public void testRemoveVirtualNetworkInterfaceIpWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, removeVirtualNetworkInterfaceIpPath); + assertEquals(parsedPath, deleteSecurityGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the removeVirtualNetworkInterfaceIp operation with and without retries enabled + // Test the deleteSecurityGroup operation with and without retries enabled @Test - public void testRemoveVirtualNetworkInterfaceIpWRetries() throws Throwable { + public void testDeleteSecurityGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testRemoveVirtualNetworkInterfaceIpWOptions(); + testDeleteSecurityGroupWOptions(); vpcService.disableRetries(); - testRemoveVirtualNetworkInterfaceIpWOptions(); + testDeleteSecurityGroupWOptions(); } - // Test the removeVirtualNetworkInterfaceIp operation with a null options model (negative test) + // Test the deleteSecurityGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testRemoveVirtualNetworkInterfaceIpNoOptions() throws Throwable { + public void testDeleteSecurityGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.removeVirtualNetworkInterfaceIp(null).execute(); + vpcService.deleteSecurityGroup(null).execute(); } - // Test the getVirtualNetworkInterfaceIp operation with a valid options model parameter + // Test the getSecurityGroup operation with a valid options model parameter @Test - public void testGetVirtualNetworkInterfaceIpWOptions() throws Throwable { + public void testGetSecurityGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}"; - String getVirtualNetworkInterfaceIpPath = "/virtual_network_interfaces/testString/ips/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getSecurityGroupPath = "/security_groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVirtualNetworkInterfaceIpOptions model - GetVirtualNetworkInterfaceIpOptions getVirtualNetworkInterfaceIpOptionsModel = new GetVirtualNetworkInterfaceIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + // Construct an instance of the GetSecurityGroupOptions model + GetSecurityGroupOptions getSecurityGroupOptionsModel = new GetSecurityGroupOptions.Builder() .id("testString") .build(); - // Invoke getVirtualNetworkInterfaceIp() with a valid options model and verify the result - Response response = vpcService.getVirtualNetworkInterfaceIp(getVirtualNetworkInterfaceIpOptionsModel).execute(); + // Invoke getSecurityGroup() with a valid options model and verify the result + Response response = vpcService.getSecurityGroup(getSecurityGroupOptionsModel).execute(); assertNotNull(response); - ReservedIPReference responseObj = response.getResult(); + SecurityGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -21520,106 +22838,111 @@ public void testGetVirtualNetworkInterfaceIpWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVirtualNetworkInterfaceIpPath); + assertEquals(parsedPath, getSecurityGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVirtualNetworkInterfaceIp operation with and without retries enabled + // Test the getSecurityGroup operation with and without retries enabled @Test - public void testGetVirtualNetworkInterfaceIpWRetries() throws Throwable { + public void testGetSecurityGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVirtualNetworkInterfaceIpWOptions(); + testGetSecurityGroupWOptions(); vpcService.disableRetries(); - testGetVirtualNetworkInterfaceIpWOptions(); + testGetSecurityGroupWOptions(); } - // Test the getVirtualNetworkInterfaceIp operation with a null options model (negative test) + // Test the getSecurityGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVirtualNetworkInterfaceIpNoOptions() throws Throwable { + public void testGetSecurityGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVirtualNetworkInterfaceIp(null).execute(); + vpcService.getSecurityGroup(null).execute(); } - // Test the addVirtualNetworkInterfaceIp operation with a valid options model parameter + // Test the updateSecurityGroup operation with a valid options model parameter @Test - public void testAddVirtualNetworkInterfaceIpWOptions() throws Throwable { + public void testUpdateSecurityGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}"; - String addVirtualNetworkInterfaceIpPath = "/virtual_network_interfaces/testString/ips/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String updateSecurityGroupPath = "/security_groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the AddVirtualNetworkInterfaceIpOptions model - AddVirtualNetworkInterfaceIpOptions addVirtualNetworkInterfaceIpOptionsModel = new AddVirtualNetworkInterfaceIpOptions.Builder() - .virtualNetworkInterfaceId("testString") + // Construct an instance of the SecurityGroupPatch model + SecurityGroupPatch securityGroupPatchModel = new SecurityGroupPatch.Builder() + .name("my-security-group") + .build(); + Map securityGroupPatchModelAsPatch = securityGroupPatchModel.asPatch(); + + // Construct an instance of the UpdateSecurityGroupOptions model + UpdateSecurityGroupOptions updateSecurityGroupOptionsModel = new UpdateSecurityGroupOptions.Builder() .id("testString") + .securityGroupPatch(securityGroupPatchModelAsPatch) .build(); - // Invoke addVirtualNetworkInterfaceIp() with a valid options model and verify the result - Response response = vpcService.addVirtualNetworkInterfaceIp(addVirtualNetworkInterfaceIpOptionsModel).execute(); + // Invoke updateSecurityGroup() with a valid options model and verify the result + Response response = vpcService.updateSecurityGroup(updateSecurityGroupOptionsModel).execute(); assertNotNull(response); - ReservedIPReference responseObj = response.getResult(); + SecurityGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addVirtualNetworkInterfaceIpPath); + assertEquals(parsedPath, updateSecurityGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the addVirtualNetworkInterfaceIp operation with and without retries enabled + // Test the updateSecurityGroup operation with and without retries enabled @Test - public void testAddVirtualNetworkInterfaceIpWRetries() throws Throwable { + public void testUpdateSecurityGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testAddVirtualNetworkInterfaceIpWOptions(); + testUpdateSecurityGroupWOptions(); vpcService.disableRetries(); - testAddVirtualNetworkInterfaceIpWOptions(); + testUpdateSecurityGroupWOptions(); } - // Test the addVirtualNetworkInterfaceIp operation with a null options model (negative test) + // Test the updateSecurityGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddVirtualNetworkInterfaceIpNoOptions() throws Throwable { + public void testUpdateSecurityGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.addVirtualNetworkInterfaceIp(null).execute(); + vpcService.updateSecurityGroup(null).execute(); } - // Test the listClusterNetworkProfiles operation with a valid options model parameter + // Test the listSecurityGroupRules operation with a valid options model parameter @Test - public void testListClusterNetworkProfilesWOptions() throws Throwable { + public void testListSecurityGroupRulesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"family\": \"vela\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}], \"total_count\": 132}"; - String listClusterNetworkProfilesPath = "/cluster_network/profiles"; + String mockResponseBody = "{\"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}]}"; + String listSecurityGroupRulesPath = "/security_groups/testString/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListClusterNetworkProfilesOptions model - ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptionsModel = new ListClusterNetworkProfilesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) + // Construct an instance of the ListSecurityGroupRulesOptions model + ListSecurityGroupRulesOptions listSecurityGroupRulesOptionsModel = new ListSecurityGroupRulesOptions.Builder() + .securityGroupId("testString") .build(); - // Invoke listClusterNetworkProfiles() with a valid options model and verify the result - Response response = vpcService.listClusterNetworkProfiles(listClusterNetworkProfilesOptionsModel).execute(); + // Invoke listSecurityGroupRules() with a valid options model and verify the result + Response response = vpcService.listSecurityGroupRules(listSecurityGroupRulesOptionsModel).execute(); assertNotNull(response); - ClusterNetworkProfileCollection responseObj = response.getResult(); + SecurityGroupRuleCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -21628,383 +22951,313 @@ public void testListClusterNetworkProfilesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listClusterNetworkProfilesPath); + assertEquals(parsedPath, listSecurityGroupRulesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listClusterNetworkProfiles operation with and without retries enabled + // Test the listSecurityGroupRules operation with and without retries enabled @Test - public void testListClusterNetworkProfilesWRetries() throws Throwable { + public void testListSecurityGroupRulesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListClusterNetworkProfilesWOptions(); + testListSecurityGroupRulesWOptions(); vpcService.disableRetries(); - testListClusterNetworkProfilesWOptions(); + testListSecurityGroupRulesWOptions(); } - // Test the listClusterNetworkProfiles operation using the ClusterNetworkProfilesPager.getNext() method + // Test the listSecurityGroupRules operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListSecurityGroupRulesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listSecurityGroupRules(null).execute(); + } + + // Test the createSecurityGroupRule operation with a valid options model parameter @Test - public void testListClusterNetworkProfilesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"vela\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zones\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}]}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"vela\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zones\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}]}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); + public void testCreateSecurityGroupRuleWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}"; + String createSecurityGroupRulePath = "/security_groups/testString/rules"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + .setResponseCode(201) + .setBody(mockResponseBody)); - ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptions = new ListClusterNetworkProfilesOptions.Builder() - .limit(Long.valueOf("10")) + // Construct an instance of the SecurityGroupRuleLocalPrototypeIP model + SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() + .address("192.168.3.4") .build(); - List allResults = new ArrayList<>(); - ClusterNetworkProfilesPager pager = new ClusterNetworkProfilesPager(vpcService, listClusterNetworkProfilesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); - } - - // Test the listClusterNetworkProfiles operation using the ClusterNetworkProfilesPager.getAll() method - @Test - public void testListClusterNetworkProfilesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"vela\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zones\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}]}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"family\":\"vela\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\",\"supported_instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"zones\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}]}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListClusterNetworkProfilesOptions listClusterNetworkProfilesOptions = new ListClusterNetworkProfilesOptions.Builder() - .limit(Long.valueOf("10")) + // Construct an instance of the SecurityGroupRuleRemotePrototypeIP model + SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() + .address("192.168.3.4") .build(); - ClusterNetworkProfilesPager pager = new ClusterNetworkProfilesPager(vpcService, listClusterNetworkProfilesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the getClusterNetworkProfile operation with a valid options model parameter - @Test - public void testGetClusterNetworkProfileWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"family\": \"vela\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\", \"supported_instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"zones\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}]}"; - String getClusterNetworkProfilePath = "/cluster_network/profiles/h100"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); + // Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype model + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Builder() + .direction("inbound") + .ipVersion("ipv4") + .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") + .remote(securityGroupRuleRemotePrototypeModel) + .protocol("any") + .build(); - // Construct an instance of the GetClusterNetworkProfileOptions model - GetClusterNetworkProfileOptions getClusterNetworkProfileOptionsModel = new GetClusterNetworkProfileOptions.Builder() - .name("h100") + // Construct an instance of the CreateSecurityGroupRuleOptions model + CreateSecurityGroupRuleOptions createSecurityGroupRuleOptionsModel = new CreateSecurityGroupRuleOptions.Builder() + .securityGroupId("testString") + .securityGroupRulePrototype(securityGroupRulePrototypeModel) .build(); - // Invoke getClusterNetworkProfile() with a valid options model and verify the result - Response response = vpcService.getClusterNetworkProfile(getClusterNetworkProfileOptionsModel).execute(); + // Invoke createSecurityGroupRule() with a valid options model and verify the result + Response response = vpcService.createSecurityGroupRule(createSecurityGroupRuleOptionsModel).execute(); assertNotNull(response); - ClusterNetworkProfile responseObj = response.getResult(); + SecurityGroupRule responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getClusterNetworkProfilePath); + assertEquals(parsedPath, createSecurityGroupRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getClusterNetworkProfile operation with and without retries enabled + // Test the createSecurityGroupRule operation with and without retries enabled @Test - public void testGetClusterNetworkProfileWRetries() throws Throwable { + public void testCreateSecurityGroupRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetClusterNetworkProfileWOptions(); + testCreateSecurityGroupRuleWOptions(); vpcService.disableRetries(); - testGetClusterNetworkProfileWOptions(); + testCreateSecurityGroupRuleWOptions(); } - // Test the getClusterNetworkProfile operation with a null options model (negative test) + // Test the createSecurityGroupRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetClusterNetworkProfileNoOptions() throws Throwable { + public void testCreateSecurityGroupRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getClusterNetworkProfile(null).execute(); + vpcService.createSecurityGroupRule(null).execute(); } - // Test the listClusterNetworks operation with a valid options model parameter + // Test the deleteSecurityGroupRule operation with a valid options model parameter @Test - public void testListClusterNetworksWOptions() throws Throwable { + public void testDeleteSecurityGroupRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cluster_networks\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listClusterNetworksPath = "/cluster_networks"; + String mockResponseBody = ""; + String deleteSecurityGroupRulePath = "/security_groups/testString/rules/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ListClusterNetworksOptions model - ListClusterNetworksOptions listClusterNetworksOptionsModel = new ListClusterNetworksOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") + // Construct an instance of the DeleteSecurityGroupRuleOptions model + DeleteSecurityGroupRuleOptions deleteSecurityGroupRuleOptionsModel = new DeleteSecurityGroupRuleOptions.Builder() + .securityGroupId("testString") + .id("testString") .build(); - // Invoke listClusterNetworks() with a valid options model and verify the result - Response response = vpcService.listClusterNetworks(listClusterNetworksOptionsModel).execute(); + // Invoke deleteSecurityGroupRule() with a valid options model and verify the result + Response response = vpcService.deleteSecurityGroupRule(deleteSecurityGroupRuleOptionsModel).execute(); assertNotNull(response); - ClusterNetworkCollection responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listClusterNetworksPath); + assertEquals(parsedPath, deleteSecurityGroupRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("sort"), "name"); - assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); - assertEquals(query.get("vpc.name"), "my-vpc"); } - // Test the listClusterNetworks operation with and without retries enabled + // Test the deleteSecurityGroupRule operation with and without retries enabled @Test - public void testListClusterNetworksWRetries() throws Throwable { + public void testDeleteSecurityGroupRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListClusterNetworksWOptions(); + testDeleteSecurityGroupRuleWOptions(); vpcService.disableRetries(); - testListClusterNetworksWOptions(); + testDeleteSecurityGroupRuleWOptions(); } - // Test the listClusterNetworks operation using the ClusterNetworksPager.getNext() method + // Test the deleteSecurityGroupRule operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteSecurityGroupRuleNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.deleteSecurityGroupRule(null).execute(); + } + + // Test the getSecurityGroupRule operation with a valid options model parameter @Test - public void testListClusterNetworksWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"cluster_networks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"cluster_network\",\"subnet_prefixes\":[{\"allocation_policy\":\"auto\",\"cidr\":\"10.0.0.0/24\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"cluster_networks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"cluster_network\",\"subnet_prefixes\":[{\"allocation_policy\":\"auto\",\"cidr\":\"10.0.0.0/24\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); + public void testGetSecurityGroupRuleWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}"; + String getSecurityGroupRulePath = "/security_groups/testString/rules/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + .setBody(mockResponseBody)); - ListClusterNetworksOptions listClusterNetworksOptions = new ListClusterNetworksOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") + // Construct an instance of the GetSecurityGroupRuleOptions model + GetSecurityGroupRuleOptions getSecurityGroupRuleOptionsModel = new GetSecurityGroupRuleOptions.Builder() + .securityGroupId("testString") + .id("testString") .build(); - List allResults = new ArrayList<>(); - ClusterNetworksPager pager = new ClusterNetworksPager(vpcService, listClusterNetworksOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Invoke getSecurityGroupRule() with a valid options model and verify the result + Response response = vpcService.getSecurityGroupRule(getSecurityGroupRuleOptionsModel).execute(); + assertNotNull(response); + SecurityGroupRule responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getSecurityGroupRulePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - - // Test the listClusterNetworks operation using the ClusterNetworksPager.getAll() method + + // Test the getSecurityGroupRule operation with and without retries enabled @Test - public void testListClusterNetworksWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"cluster_networks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"cluster_network\",\"subnet_prefixes\":[{\"allocation_policy\":\"auto\",\"cidr\":\"10.0.0.0/24\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"cluster_networks\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"id\":\"0717-da0df18c-7598-4633-a648-fdaac28a5573\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network\",\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\",\"name\":\"h100\",\"resource_type\":\"cluster_network_profile\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"cluster_network\",\"subnet_prefixes\":[{\"allocation_policy\":\"auto\",\"cidr\":\"10.0.0.0/24\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + public void testGetSecurityGroupRuleWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetSecurityGroupRuleWOptions(); - ListClusterNetworksOptions listClusterNetworksOptions = new ListClusterNetworksOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .sort("name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .build(); + vpcService.disableRetries(); + testGetSecurityGroupRuleWOptions(); + } - ClusterNetworksPager pager = new ClusterNetworksPager(vpcService, listClusterNetworksOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); + // Test the getSecurityGroupRule operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetSecurityGroupRuleNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getSecurityGroupRule(null).execute(); } - - // Test the createClusterNetwork operation with a valid options model parameter + + // Test the updateSecurityGroupRule operation with a valid options model parameter @Test - public void testCreateClusterNetworkWOptions() throws Throwable { + public void testUpdateSecurityGroupRuleWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createClusterNetworkPath = "/cluster_networks"; + String mockResponseBody = "{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}"; + String updateSecurityGroupRulePath = "/security_groups/testString/rules/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ClusterNetworkProfileIdentityByName model - ClusterNetworkProfileIdentityByName clusterNetworkProfileIdentityModel = new ClusterNetworkProfileIdentityByName.Builder() - .name("h100") - .build(); - - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the SecurityGroupRuleLocalPatchIP model + SecurityGroupRuleLocalPatchIP securityGroupRuleLocalPatchModel = new SecurityGroupRuleLocalPatchIP.Builder() + .address("192.168.3.4") .build(); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + // Construct an instance of the SecurityGroupRuleRemotePatchCIDR model + SecurityGroupRuleRemotePatchCIDR securityGroupRuleRemotePatchModel = new SecurityGroupRuleRemotePatchCIDR.Builder() + .cidrBlock("10.0.0.0/8") .build(); - // Construct an instance of the ClusterNetworkSubnetPrefixPrototype model - ClusterNetworkSubnetPrefixPrototype clusterNetworkSubnetPrefixPrototypeModel = new ClusterNetworkSubnetPrefixPrototype.Builder() - .cidr("10.0.0.0/24") + // Construct an instance of the SecurityGroupRulePatch model + SecurityGroupRulePatch securityGroupRulePatchModel = new SecurityGroupRulePatch.Builder() + .code(Long.valueOf("0")) + .direction("inbound") + .ipVersion("ipv4") + .local(securityGroupRuleLocalPatchModel) + .name("my-security-group-rule") + .portMax(Long.valueOf("22")) + .portMin(Long.valueOf("22")) + .remote(securityGroupRuleRemotePatchModel) + .type(Long.valueOf("8")) .build(); + Map securityGroupRulePatchModelAsPatch = securityGroupRulePatchModel.asPatch(); - // Construct an instance of the CreateClusterNetworkOptions model - CreateClusterNetworkOptions createClusterNetworkOptionsModel = new CreateClusterNetworkOptions.Builder() - .profile(clusterNetworkProfileIdentityModel) - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) - .name("my-cluster-network") - .resourceGroup(resourceGroupIdentityModel) - .subnetPrefixes(java.util.Arrays.asList(clusterNetworkSubnetPrefixPrototypeModel)) + // Construct an instance of the UpdateSecurityGroupRuleOptions model + UpdateSecurityGroupRuleOptions updateSecurityGroupRuleOptionsModel = new UpdateSecurityGroupRuleOptions.Builder() + .securityGroupId("testString") + .id("testString") + .securityGroupRulePatch(securityGroupRulePatchModelAsPatch) .build(); - // Invoke createClusterNetwork() with a valid options model and verify the result - Response response = vpcService.createClusterNetwork(createClusterNetworkOptionsModel).execute(); + // Invoke updateSecurityGroupRule() with a valid options model and verify the result + Response response = vpcService.updateSecurityGroupRule(updateSecurityGroupRuleOptionsModel).execute(); assertNotNull(response); - ClusterNetwork responseObj = response.getResult(); + SecurityGroupRule responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createClusterNetworkPath); + assertEquals(parsedPath, updateSecurityGroupRulePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createClusterNetwork operation with and without retries enabled + // Test the updateSecurityGroupRule operation with and without retries enabled @Test - public void testCreateClusterNetworkWRetries() throws Throwable { + public void testUpdateSecurityGroupRuleWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateClusterNetworkWOptions(); + testUpdateSecurityGroupRuleWOptions(); vpcService.disableRetries(); - testCreateClusterNetworkWOptions(); + testUpdateSecurityGroupRuleWOptions(); } - // Test the createClusterNetwork operation with a null options model (negative test) + // Test the updateSecurityGroupRule operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateClusterNetworkNoOptions() throws Throwable { + public void testUpdateSecurityGroupRuleNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createClusterNetwork(null).execute(); + vpcService.updateSecurityGroupRule(null).execute(); } - // Test the listClusterNetworkInterfaces operation with a valid options model parameter + // Test the listSecurityGroupTargets operation with a valid options model parameter @Test - public void testListClusterNetworkInterfacesWOptions() throws Throwable { + public void testListSecurityGroupTargetsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"interfaces\": [{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listClusterNetworkInterfacesPath = "/cluster_networks/testString/interfaces"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"total_count\": 132}"; + String listSecurityGroupTargetsPath = "/security_groups/testString/targets"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListClusterNetworkInterfacesOptions model - ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptionsModel = new ListClusterNetworkInterfacesOptions.Builder() - .clusterNetworkId("testString") + // Construct an instance of the ListSecurityGroupTargetsOptions model + ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptionsModel = new ListSecurityGroupTargetsOptions.Builder() + .securityGroupId("testString") .start("testString") .limit(Long.valueOf("10")) - .name("my-name") - .sort("name") .build(); - // Invoke listClusterNetworkInterfaces() with a valid options model and verify the result - Response response = vpcService.listClusterNetworkInterfaces(listClusterNetworkInterfacesOptionsModel).execute(); + // Invoke listSecurityGroupTargets() with a valid options model and verify the result + Response response = vpcService.listSecurityGroupTargets(listSecurityGroupTargetsOptionsModel).execute(); assertNotNull(response); - ClusterNetworkInterfaceCollection responseObj = response.getResult(); + SecurityGroupTargetCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -22013,41 +23266,39 @@ public void testListClusterNetworkInterfacesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listClusterNetworkInterfacesPath); + assertEquals(parsedPath, listSecurityGroupTargetsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("sort"), "name"); } - // Test the listClusterNetworkInterfaces operation with and without retries enabled + // Test the listSecurityGroupTargets operation with and without retries enabled @Test - public void testListClusterNetworkInterfacesWRetries() throws Throwable { + public void testListSecurityGroupTargetsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListClusterNetworkInterfacesWOptions(); + testListSecurityGroupTargetsWOptions(); vpcService.disableRetries(); - testListClusterNetworkInterfacesWOptions(); + testListSecurityGroupTargetsWOptions(); } - // Test the listClusterNetworkInterfaces operation with a null options model (negative test) + // Test the listSecurityGroupTargets operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListClusterNetworkInterfacesNoOptions() throws Throwable { + public void testListSecurityGroupTargetsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listClusterNetworkInterfaces(null).execute(); + vpcService.listSecurityGroupTargets(null).execute(); } - // Test the listClusterNetworkInterfaces operation using the ClusterNetworkInterfacesPager.getNext() method + // Test the listSecurityGroupTargets operation using the SecurityGroupTargetsPager.getNext() method @Test - public void testListClusterNetworkInterfacesWithPagerGetNext() throws Throwable { + public void testListSecurityGroupTargetsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"},\"target\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"},\"target\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -22061,29 +23312,27 @@ public void testListClusterNetworkInterfacesWithPagerGetNext() throws Throwable .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptions = new ListClusterNetworkInterfacesOptions.Builder() - .clusterNetworkId("testString") + ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() + .securityGroupId("testString") .limit(Long.valueOf("10")) - .name("my-name") - .sort("name") .build(); - List allResults = new ArrayList<>(); - ClusterNetworkInterfacesPager pager = new ClusterNetworkInterfacesPager(vpcService, listClusterNetworkInterfacesOptions); + List allResults = new ArrayList<>(); + SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(vpcService, listSecurityGroupTargetsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listClusterNetworkInterfaces operation using the ClusterNetworkInterfacesPager.getAll() method + // Test the listSecurityGroupTargets operation using the SecurityGroupTargetsPager.getAll() method @Test - public void testListClusterNetworkInterfacesWithPagerGetAll() throws Throwable { + public void testListSecurityGroupTargetsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"},\"target\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"enable_infrastructure_nat\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-cluster-network-interface\",\"primary_ip\":{\"address\":\"10.1.0.6\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"resource_type\":\"cluster_network_subnet_reserved_ip\"},\"resource_type\":\"cluster_network_interface\",\"subnet\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\"},\"target\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\",\"id\":\"0717-fb880975-db45-4459-8548-64e3995ac213\",\"name\":\"my-instance-network-attachment\",\"resource_type\":\"instance_cluster_network_attachment\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -22097,110 +23346,38 @@ public void testListClusterNetworkInterfacesWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListClusterNetworkInterfacesOptions listClusterNetworkInterfacesOptions = new ListClusterNetworkInterfacesOptions.Builder() - .clusterNetworkId("testString") + ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() + .securityGroupId("testString") .limit(Long.valueOf("10")) - .name("my-name") - .sort("name") .build(); - ClusterNetworkInterfacesPager pager = new ClusterNetworkInterfacesPager(vpcService, listClusterNetworkInterfacesOptions); - List allResults = pager.getAll(); + SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(vpcService, listSecurityGroupTargetsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createClusterNetworkInterface operation with a valid options model parameter - @Test - public void testCreateClusterNetworkInterfaceWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createClusterNetworkInterfacePath = "/cluster_networks/testString/interfaces"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext model - ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext clusterNetworkInterfacePrimaryIpPrototypeModel = new ClusterNetworkInterfacePrimaryIPPrototypeClusterNetworkSubnetReservedIPPrototypeClusterNetworkInterfacePrimaryIPContext.Builder() - .address("10.0.0.5") - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") - .build(); - - // Construct an instance of the ClusterNetworkSubnetIdentityById model - ClusterNetworkSubnetIdentityById clusterNetworkSubnetIdentityModel = new ClusterNetworkSubnetIdentityById.Builder() - .id("0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930") - .build(); - - // Construct an instance of the CreateClusterNetworkInterfaceOptions model - CreateClusterNetworkInterfaceOptions createClusterNetworkInterfaceOptionsModel = new CreateClusterNetworkInterfaceOptions.Builder() - .clusterNetworkId("testString") - .name("my-cluster-network-interface") - .primaryIp(clusterNetworkInterfacePrimaryIpPrototypeModel) - .subnet(clusterNetworkSubnetIdentityModel) - .build(); - - // Invoke createClusterNetworkInterface() with a valid options model and verify the result - Response response = vpcService.createClusterNetworkInterface(createClusterNetworkInterfaceOptionsModel).execute(); - assertNotNull(response); - ClusterNetworkInterface responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createClusterNetworkInterfacePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the createClusterNetworkInterface operation with and without retries enabled - @Test - public void testCreateClusterNetworkInterfaceWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testCreateClusterNetworkInterfaceWOptions(); - - vpcService.disableRetries(); - testCreateClusterNetworkInterfaceWOptions(); - } - - // Test the createClusterNetworkInterface operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateClusterNetworkInterfaceNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createClusterNetworkInterface(null).execute(); - } - - // Test the deleteClusterNetworkInterface operation with a valid options model parameter + // Test the deleteSecurityGroupTargetBinding operation with a valid options model parameter @Test - public void testDeleteClusterNetworkInterfaceWOptions() throws Throwable { + public void testDeleteSecurityGroupTargetBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String deleteClusterNetworkInterfacePath = "/cluster_networks/testString/interfaces/testString"; + String mockResponseBody = ""; + String deleteSecurityGroupTargetBindingPath = "/security_groups/testString/targets/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteClusterNetworkInterfaceOptions model - DeleteClusterNetworkInterfaceOptions deleteClusterNetworkInterfaceOptionsModel = new DeleteClusterNetworkInterfaceOptions.Builder() - .clusterNetworkId("testString") + // Construct an instance of the DeleteSecurityGroupTargetBindingOptions model + DeleteSecurityGroupTargetBindingOptions deleteSecurityGroupTargetBindingOptionsModel = new DeleteSecurityGroupTargetBindingOptions.Builder() + .securityGroupId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteClusterNetworkInterface() with a valid options model and verify the result - Response response = vpcService.deleteClusterNetworkInterface(deleteClusterNetworkInterfaceOptionsModel).execute(); + // Invoke deleteSecurityGroupTargetBinding() with a valid options model and verify the result + Response response = vpcService.deleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptionsModel).execute(); assertNotNull(response); - ClusterNetworkInterface responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -22208,52 +23385,52 @@ public void testDeleteClusterNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteClusterNetworkInterfacePath); + assertEquals(parsedPath, deleteSecurityGroupTargetBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteClusterNetworkInterface operation with and without retries enabled + // Test the deleteSecurityGroupTargetBinding operation with and without retries enabled @Test - public void testDeleteClusterNetworkInterfaceWRetries() throws Throwable { + public void testDeleteSecurityGroupTargetBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteClusterNetworkInterfaceWOptions(); + testDeleteSecurityGroupTargetBindingWOptions(); vpcService.disableRetries(); - testDeleteClusterNetworkInterfaceWOptions(); + testDeleteSecurityGroupTargetBindingWOptions(); } - // Test the deleteClusterNetworkInterface operation with a null options model (negative test) + // Test the deleteSecurityGroupTargetBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteClusterNetworkInterfaceNoOptions() throws Throwable { + public void testDeleteSecurityGroupTargetBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteClusterNetworkInterface(null).execute(); + vpcService.deleteSecurityGroupTargetBinding(null).execute(); } - // Test the getClusterNetworkInterface operation with a valid options model parameter + // Test the getSecurityGroupTarget operation with a valid options model parameter @Test - public void testGetClusterNetworkInterfaceWOptions() throws Throwable { + public void testGetSecurityGroupTargetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getClusterNetworkInterfacePath = "/cluster_networks/testString/interfaces/testString"; + String mockResponseBody = "{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}"; + String getSecurityGroupTargetPath = "/security_groups/testString/targets/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetClusterNetworkInterfaceOptions model - GetClusterNetworkInterfaceOptions getClusterNetworkInterfaceOptionsModel = new GetClusterNetworkInterfaceOptions.Builder() - .clusterNetworkId("testString") + // Construct an instance of the GetSecurityGroupTargetOptions model + GetSecurityGroupTargetOptions getSecurityGroupTargetOptionsModel = new GetSecurityGroupTargetOptions.Builder() + .securityGroupId("testString") .id("testString") .build(); - // Invoke getClusterNetworkInterface() with a valid options model and verify the result - Response response = vpcService.getClusterNetworkInterface(getClusterNetworkInterfaceOptionsModel).execute(); + // Invoke getSecurityGroupTarget() with a valid options model and verify the result + Response response = vpcService.getSecurityGroupTarget(getSecurityGroupTargetOptionsModel).execute(); assertNotNull(response); - ClusterNetworkInterface responseObj = response.getResult(); + SecurityGroupTargetReference responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -22262,118 +23439,107 @@ public void testGetClusterNetworkInterfaceWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getClusterNetworkInterfacePath); + assertEquals(parsedPath, getSecurityGroupTargetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getClusterNetworkInterface operation with and without retries enabled + // Test the getSecurityGroupTarget operation with and without retries enabled @Test - public void testGetClusterNetworkInterfaceWRetries() throws Throwable { + public void testGetSecurityGroupTargetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetClusterNetworkInterfaceWOptions(); + testGetSecurityGroupTargetWOptions(); vpcService.disableRetries(); - testGetClusterNetworkInterfaceWOptions(); + testGetSecurityGroupTargetWOptions(); } - // Test the getClusterNetworkInterface operation with a null options model (negative test) + // Test the getSecurityGroupTarget operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetClusterNetworkInterfaceNoOptions() throws Throwable { + public void testGetSecurityGroupTargetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getClusterNetworkInterface(null).execute(); + vpcService.getSecurityGroupTarget(null).execute(); } - // Test the updateClusterNetworkInterface operation with a valid options model parameter + // Test the createSecurityGroupTargetBinding operation with a valid options model parameter @Test - public void testUpdateClusterNetworkInterfaceWOptions() throws Throwable { + public void testCreateSecurityGroupTargetBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"enable_infrastructure_nat\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-cluster-network-interface\", \"primary_ip\": {\"address\": \"10.1.0.6\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"resource_type\": \"cluster_network_subnet_reserved_ip\"}, \"resource_type\": \"cluster_network_interface\", \"subnet\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\"}, \"target\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/cluster_network_attachments/0717-fb880975-db45-4459-8548-64e3995ac213\", \"id\": \"0717-fb880975-db45-4459-8548-64e3995ac213\", \"name\": \"my-instance-network-attachment\", \"resource_type\": \"instance_cluster_network_attachment\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateClusterNetworkInterfacePath = "/cluster_networks/testString/interfaces/testString"; + String mockResponseBody = "{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}"; + String createSecurityGroupTargetBindingPath = "/security_groups/testString/targets/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ClusterNetworkInterfacePatch model - ClusterNetworkInterfacePatch clusterNetworkInterfacePatchModel = new ClusterNetworkInterfacePatch.Builder() - .autoDelete(false) - .name("my-cluster-network-interface") - .build(); - Map clusterNetworkInterfacePatchModelAsPatch = clusterNetworkInterfacePatchModel.asPatch(); - - // Construct an instance of the UpdateClusterNetworkInterfaceOptions model - UpdateClusterNetworkInterfaceOptions updateClusterNetworkInterfaceOptionsModel = new UpdateClusterNetworkInterfaceOptions.Builder() - .clusterNetworkId("testString") + // Construct an instance of the CreateSecurityGroupTargetBindingOptions model + CreateSecurityGroupTargetBindingOptions createSecurityGroupTargetBindingOptionsModel = new CreateSecurityGroupTargetBindingOptions.Builder() + .securityGroupId("testString") .id("testString") - .clusterNetworkInterfacePatch(clusterNetworkInterfacePatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateClusterNetworkInterface() with a valid options model and verify the result - Response response = vpcService.updateClusterNetworkInterface(updateClusterNetworkInterfaceOptionsModel).execute(); + // Invoke createSecurityGroupTargetBinding() with a valid options model and verify the result + Response response = vpcService.createSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModel).execute(); assertNotNull(response); - ClusterNetworkInterface responseObj = response.getResult(); + SecurityGroupTargetReference responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateClusterNetworkInterfacePath); + assertEquals(parsedPath, createSecurityGroupTargetBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateClusterNetworkInterface operation with and without retries enabled + // Test the createSecurityGroupTargetBinding operation with and without retries enabled @Test - public void testUpdateClusterNetworkInterfaceWRetries() throws Throwable { + public void testCreateSecurityGroupTargetBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateClusterNetworkInterfaceWOptions(); + testCreateSecurityGroupTargetBindingWOptions(); vpcService.disableRetries(); - testUpdateClusterNetworkInterfaceWOptions(); + testCreateSecurityGroupTargetBindingWOptions(); } - // Test the updateClusterNetworkInterface operation with a null options model (negative test) + // Test the createSecurityGroupTargetBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateClusterNetworkInterfaceNoOptions() throws Throwable { + public void testCreateSecurityGroupTargetBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateClusterNetworkInterface(null).execute(); + vpcService.createSecurityGroupTargetBinding(null).execute(); } - // Test the listClusterNetworkSubnets operation with a valid options model parameter + // Test the listShareProfiles operation with a valid options model parameter @Test - public void testListClusterNetworkSubnetsWOptions() throws Throwable { + public void testListShareProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"subnets\": [{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}], \"total_count\": 132}"; - String listClusterNetworkSubnetsPath = "/cluster_networks/testString/subnets"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"allowed_access_protocols\": {\"default\": [\"nfs4\"], \"type\": \"subset\", \"values\": [\"nfs4\"]}, \"allowed_transit_encryption_modes\": {\"default\": [\"ipsec\"], \"type\": \"subset\", \"values\": [\"ipsec\"]}, \"availability_modes\": {\"default\": \"zonal\", \"type\": \"enum\", \"values\": [\"zonal\"]}, \"bandwidth\": {\"default\": 100, \"max\": 1024, \"min\": 1, \"step\": 1, \"type\": \"range\", \"value\": 5}, \"capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"family\": \"defined_performance\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"iops\": {\"type\": \"fixed\", \"value\": 4000}, \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\", \"storage_generation\": {\"type\": \"fixed\", \"value\": 1}}], \"total_count\": 132}"; + String listShareProfilesPath = "/share/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListClusterNetworkSubnetsOptions model - ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptionsModel = new ListClusterNetworkSubnetsOptions.Builder() - .clusterNetworkId("testString") + // Construct an instance of the ListShareProfilesOptions model + ListShareProfilesOptions listShareProfilesOptionsModel = new ListShareProfilesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .name("my-name") .sort("name") .build(); - // Invoke listClusterNetworkSubnets() with a valid options model and verify the result - Response response = vpcService.listClusterNetworkSubnets(listClusterNetworkSubnetsOptionsModel).execute(); + // Invoke listShareProfiles() with a valid options model and verify the result + Response response = vpcService.listShareProfiles(listShareProfilesOptionsModel).execute(); assertNotNull(response); - ClusterNetworkSubnetCollection responseObj = response.getResult(); + ShareProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -22382,41 +23548,33 @@ public void testListClusterNetworkSubnetsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listClusterNetworkSubnetsPath); + assertEquals(parsedPath, listShareProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("name"), "my-name"); assertEquals(query.get("sort"), "name"); } - // Test the listClusterNetworkSubnets operation with and without retries enabled + // Test the listShareProfiles operation with and without retries enabled @Test - public void testListClusterNetworkSubnetsWRetries() throws Throwable { + public void testListShareProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListClusterNetworkSubnetsWOptions(); + testListShareProfilesWOptions(); vpcService.disableRetries(); - testListClusterNetworkSubnetsWOptions(); - } - - // Test the listClusterNetworkSubnets operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListClusterNetworkSubnetsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listClusterNetworkSubnets(null).execute(); + testListShareProfilesWOptions(); } - // Test the listClusterNetworkSubnets operation using the ClusterNetworkSubnetsPager.getNext() method + // Test the listShareProfiles operation using the ShareProfilesPager.getNext() method @Test - public void testListClusterNetworkSubnetsWithPagerGetNext() throws Throwable { + public void testListShareProfilesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\",\"total_ipv4_address_count\":256}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\",\"total_ipv4_address_count\":256}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"allowed_access_protocols\":{\"default\":[\"nfs4\"],\"type\":\"subset\",\"values\":[\"nfs4\"]},\"allowed_transit_encryption_modes\":{\"default\":[\"ipsec\"],\"type\":\"subset\",\"values\":[\"ipsec\"]},\"availability_modes\":{\"default\":\"zonal\",\"type\":\"enum\",\"values\":[\"zonal\"]},\"bandwidth\":{\"default\":100,\"max\":1024,\"min\":1,\"step\":1,\"type\":\"range\",\"value\":5},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"defined_performance\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"allowed_access_protocols\":{\"default\":[\"nfs4\"],\"type\":\"subset\",\"values\":[\"nfs4\"]},\"allowed_transit_encryption_modes\":{\"default\":[\"ipsec\"],\"type\":\"subset\",\"values\":[\"ipsec\"]},\"availability_modes\":{\"default\":\"zonal\",\"type\":\"enum\",\"values\":[\"zonal\"]},\"bandwidth\":{\"default\":100,\"max\":1024,\"min\":1,\"step\":1,\"type\":\"range\",\"value\":5},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"defined_performance\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -22430,29 +23588,27 @@ public void testListClusterNetworkSubnetsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptions = new ListClusterNetworkSubnetsOptions.Builder() - .clusterNetworkId("testString") + ListShareProfilesOptions listShareProfilesOptions = new ListShareProfilesOptions.Builder() .limit(Long.valueOf("10")) - .name("my-name") .sort("name") .build(); - List allResults = new ArrayList<>(); - ClusterNetworkSubnetsPager pager = new ClusterNetworkSubnetsPager(vpcService, listClusterNetworkSubnetsOptions); + List allResults = new ArrayList<>(); + ShareProfilesPager pager = new ShareProfilesPager(vpcService, listShareProfilesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listClusterNetworkSubnets operation using the ClusterNetworkSubnetsPager.getAll() method + // Test the listShareProfiles operation using the ShareProfilesPager.getAll() method @Test - public void testListClusterNetworkSubnetsWithPagerGetAll() throws Throwable { + public void testListShareProfilesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\",\"total_ipv4_address_count\":256}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"id\":\"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet\",\"resource_type\":\"cluster_network_subnet\",\"total_ipv4_address_count\":256}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"allowed_access_protocols\":{\"default\":[\"nfs4\"],\"type\":\"subset\",\"values\":[\"nfs4\"]},\"allowed_transit_encryption_modes\":{\"default\":[\"ipsec\"],\"type\":\"subset\",\"values\":[\"ipsec\"]},\"availability_modes\":{\"default\":\"zonal\",\"type\":\"enum\",\"values\":[\"zonal\"]},\"bandwidth\":{\"default\":100,\"max\":1024,\"min\":1,\"step\":1,\"type\":\"range\",\"value\":5},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"defined_performance\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"allowed_access_protocols\":{\"default\":[\"nfs4\"],\"type\":\"subset\",\"values\":[\"nfs4\"]},\"allowed_transit_encryption_modes\":{\"default\":[\"ipsec\"],\"type\":\"subset\",\"values\":[\"ipsec\"]},\"availability_modes\":{\"default\":\"zonal\",\"type\":\"enum\",\"values\":[\"zonal\"]},\"bandwidth\":{\"default\":100,\"max\":1024,\"min\":1,\"step\":1,\"type\":\"range\",\"value\":5},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"defined_performance\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -22466,105 +23622,95 @@ public void testListClusterNetworkSubnetsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListClusterNetworkSubnetsOptions listClusterNetworkSubnetsOptions = new ListClusterNetworkSubnetsOptions.Builder() - .clusterNetworkId("testString") + ListShareProfilesOptions listShareProfilesOptions = new ListShareProfilesOptions.Builder() .limit(Long.valueOf("10")) - .name("my-name") .sort("name") .build(); - ClusterNetworkSubnetsPager pager = new ClusterNetworkSubnetsPager(vpcService, listClusterNetworkSubnetsOptions); - List allResults = pager.getAll(); + ShareProfilesPager pager = new ShareProfilesPager(vpcService, listShareProfilesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createClusterNetworkSubnet operation with a valid options model parameter + // Test the getShareProfile operation with a valid options model parameter @Test - public void testCreateClusterNetworkSubnetWOptions() throws Throwable { + public void testGetShareProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}"; - String createClusterNetworkSubnetPath = "/cluster_networks/testString/subnets"; + String mockResponseBody = "{\"allowed_access_protocols\": {\"default\": [\"nfs4\"], \"type\": \"subset\", \"values\": [\"nfs4\"]}, \"allowed_transit_encryption_modes\": {\"default\": [\"ipsec\"], \"type\": \"subset\", \"values\": [\"ipsec\"]}, \"availability_modes\": {\"default\": \"zonal\", \"type\": \"enum\", \"values\": [\"zonal\"]}, \"bandwidth\": {\"default\": 100, \"max\": 1024, \"min\": 1, \"step\": 1, \"type\": \"range\", \"value\": 5}, \"capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"family\": \"defined_performance\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"iops\": {\"type\": \"fixed\", \"value\": 4000}, \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\", \"storage_generation\": {\"type\": \"fixed\", \"value\": 1}}"; + String getShareProfilePath = "/share/profiles/dp2"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype model - ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype clusterNetworkSubnetPrototypeModel = new ClusterNetworkSubnetPrototypeClusterNetworkSubnetByTotalCountPrototype.Builder() - .ipVersion("ipv4") - .name("my-cluster-network-subnet") - .totalIpv4AddressCount(Long.valueOf("256")) - .build(); - - // Construct an instance of the CreateClusterNetworkSubnetOptions model - CreateClusterNetworkSubnetOptions createClusterNetworkSubnetOptionsModel = new CreateClusterNetworkSubnetOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetPrototype(clusterNetworkSubnetPrototypeModel) + // Construct an instance of the GetShareProfileOptions model + GetShareProfileOptions getShareProfileOptionsModel = new GetShareProfileOptions.Builder() + .name("dp2") .build(); - // Invoke createClusterNetworkSubnet() with a valid options model and verify the result - Response response = vpcService.createClusterNetworkSubnet(createClusterNetworkSubnetOptionsModel).execute(); + // Invoke getShareProfile() with a valid options model and verify the result + Response response = vpcService.getShareProfile(getShareProfileOptionsModel).execute(); assertNotNull(response); - ClusterNetworkSubnet responseObj = response.getResult(); + ShareProfile responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createClusterNetworkSubnetPath); + assertEquals(parsedPath, getShareProfilePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createClusterNetworkSubnet operation with and without retries enabled + // Test the getShareProfile operation with and without retries enabled @Test - public void testCreateClusterNetworkSubnetWRetries() throws Throwable { + public void testGetShareProfileWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateClusterNetworkSubnetWOptions(); + testGetShareProfileWOptions(); vpcService.disableRetries(); - testCreateClusterNetworkSubnetWOptions(); + testGetShareProfileWOptions(); } - // Test the createClusterNetworkSubnet operation with a null options model (negative test) + // Test the getShareProfile operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateClusterNetworkSubnetNoOptions() throws Throwable { + public void testGetShareProfileNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createClusterNetworkSubnet(null).execute(); + vpcService.getShareProfile(null).execute(); } - // Test the listClusterNetworkSubnetReservedIps operation with a valid options model parameter + // Test the listShares operation with a valid options model parameter @Test - public void testListClusterNetworkSubnetReservedIpsWOptions() throws Throwable { + public void testListSharesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"reserved_ips\": [{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}], \"total_count\": 132}"; - String listClusterNetworkSubnetReservedIpsPath = "/cluster_networks/testString/subnets/testString/reserved_ips"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"shares\": [{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_access_protocols\": [\"nfs4\"], \"allowed_transit_encryption_modes\": [\"ipsec\"], \"availability_mode\": \"zonal\", \"bandwidth\": 1, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String listSharesPath = "/shares"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListClusterNetworkSubnetReservedIpsOptions model - ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptionsModel = new ListClusterNetworkSubnetReservedIpsOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + // Construct an instance of the ListSharesOptions model + ListSharesOptions listSharesOptionsModel = new ListSharesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .resourceGroupId("testString") .name("my-name") .sort("name") + .replicationRole("none") .build(); - // Invoke listClusterNetworkSubnetReservedIps() with a valid options model and verify the result - Response response = vpcService.listClusterNetworkSubnetReservedIps(listClusterNetworkSubnetReservedIpsOptionsModel).execute(); + // Invoke listShares() with a valid options model and verify the result + Response response = vpcService.listShares(listSharesOptionsModel).execute(); assertNotNull(response); - ClusterNetworkSubnetReservedIPCollection responseObj = response.getResult(); + ShareCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -22573,41 +23719,36 @@ public void testListClusterNetworkSubnetReservedIpsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listClusterNetworkSubnetReservedIpsPath); + assertEquals(parsedPath, listSharesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("name"), "my-name"); assertEquals(query.get("sort"), "name"); + assertEquals(query.get("replication_role"), "none"); } - // Test the listClusterNetworkSubnetReservedIps operation with and without retries enabled + // Test the listShares operation with and without retries enabled @Test - public void testListClusterNetworkSubnetReservedIpsWRetries() throws Throwable { + public void testListSharesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListClusterNetworkSubnetReservedIpsWOptions(); + testListSharesWOptions(); vpcService.disableRetries(); - testListClusterNetworkSubnetReservedIpsWOptions(); - } - - // Test the listClusterNetworkSubnetReservedIps operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListClusterNetworkSubnetReservedIpsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listClusterNetworkSubnetReservedIps(null).execute(); + testListSharesWOptions(); } - // Test the listClusterNetworkSubnetReservedIps operation using the ClusterNetworkSubnetReservedIpsPager.getNext() method + // Test the listShares operation using the SharesPager.getNext() method @Test - public void testListClusterNetworkSubnetReservedIpsWithPagerGetNext() throws Throwable { + public void testListSharesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"10.1.0.6\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"cluster_network_subnet_reserved_ip\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"resource_type\":\"cluster_network_interface\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"10.1.0.6\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"cluster_network_subnet_reserved_ip\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"resource_type\":\"cluster_network_interface\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"shares\":[{\"access_control_mode\":\"security_group\",\"accessor_binding_role\":\"accessor\",\"accessor_bindings\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"resource_type\":\"share_accessor_binding\"}],\"allowed_access_protocols\":[\"nfs4\"],\"allowed_transit_encryption_modes\":[\"ipsec\"],\"availability_mode\":\"zonal\",\"bandwidth\":1,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"initial_owner\":{\"gid\":50,\"uid\":50},\"iops\":100,\"latest_job\":{\"status\":\"cancelled\",\"status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"type\":\"replication_failover\"},\"latest_sync\":{\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"data_transferred\":0,\"started_at\":\"2019-01-01T12:00:00.000Z\"},\"lifecycle_reasons\":[{\"code\":\"cloning_in_progress\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mount_targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"}],\"name\":\"my-share\",\"origin_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"},\"replica_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"replication_cron_spec\":\"0 */5 * * *\",\"replication_role\":\"none\",\"replication_status\":\"active\",\"replication_status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share\",\"size\":200,\"snapshot_count\":0,\"snapshot_size\":0,\"source_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"name\":\"my-share-snapshot\",\"resource_type\":\"share_snapshot\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"shares\":[{\"access_control_mode\":\"security_group\",\"accessor_binding_role\":\"accessor\",\"accessor_bindings\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"resource_type\":\"share_accessor_binding\"}],\"allowed_access_protocols\":[\"nfs4\"],\"allowed_transit_encryption_modes\":[\"ipsec\"],\"availability_mode\":\"zonal\",\"bandwidth\":1,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"initial_owner\":{\"gid\":50,\"uid\":50},\"iops\":100,\"latest_job\":{\"status\":\"cancelled\",\"status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"type\":\"replication_failover\"},\"latest_sync\":{\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"data_transferred\":0,\"started_at\":\"2019-01-01T12:00:00.000Z\"},\"lifecycle_reasons\":[{\"code\":\"cloning_in_progress\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mount_targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"}],\"name\":\"my-share\",\"origin_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"},\"replica_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"replication_cron_spec\":\"0 */5 * * *\",\"replication_role\":\"none\",\"replication_status\":\"active\",\"replication_status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share\",\"size\":200,\"snapshot_count\":0,\"snapshot_size\":0,\"source_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"name\":\"my-share-snapshot\",\"resource_type\":\"share_snapshot\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -22621,30 +23762,30 @@ public void testListClusterNetworkSubnetReservedIpsWithPagerGetNext() throws Thr .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptions = new ListClusterNetworkSubnetReservedIpsOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + ListSharesOptions listSharesOptions = new ListSharesOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") .name("my-name") .sort("name") + .replicationRole("none") .build(); - List allResults = new ArrayList<>(); - ClusterNetworkSubnetReservedIpsPager pager = new ClusterNetworkSubnetReservedIpsPager(vpcService, listClusterNetworkSubnetReservedIpsOptions); + List allResults = new ArrayList<>(); + SharesPager pager = new SharesPager(vpcService, listSharesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listClusterNetworkSubnetReservedIps operation using the ClusterNetworkSubnetReservedIpsPager.getAll() method + // Test the listShares operation using the SharesPager.getAll() method @Test - public void testListClusterNetworkSubnetReservedIpsWithPagerGetAll() throws Throwable { + public void testListSharesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"10.1.0.6\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"cluster_network_subnet_reserved_ip\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"resource_type\":\"cluster_network_interface\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"10.1.0.6\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"id\":\"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-cluster-network-subnet-reserved-ip\",\"owner\":\"user\",\"resource_type\":\"cluster_network_subnet_reserved_ip\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"id\":\"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\",\"name\":\"my-cluster-network-interface\",\"resource_type\":\"cluster_network_interface\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"shares\":[{\"access_control_mode\":\"security_group\",\"accessor_binding_role\":\"accessor\",\"accessor_bindings\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"resource_type\":\"share_accessor_binding\"}],\"allowed_access_protocols\":[\"nfs4\"],\"allowed_transit_encryption_modes\":[\"ipsec\"],\"availability_mode\":\"zonal\",\"bandwidth\":1,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"initial_owner\":{\"gid\":50,\"uid\":50},\"iops\":100,\"latest_job\":{\"status\":\"cancelled\",\"status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"type\":\"replication_failover\"},\"latest_sync\":{\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"data_transferred\":0,\"started_at\":\"2019-01-01T12:00:00.000Z\"},\"lifecycle_reasons\":[{\"code\":\"cloning_in_progress\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mount_targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"}],\"name\":\"my-share\",\"origin_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"},\"replica_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"replication_cron_spec\":\"0 */5 * * *\",\"replication_role\":\"none\",\"replication_status\":\"active\",\"replication_status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share\",\"size\":200,\"snapshot_count\":0,\"snapshot_size\":0,\"source_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"name\":\"my-share-snapshot\",\"resource_type\":\"share_snapshot\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"shares\":[{\"access_control_mode\":\"security_group\",\"accessor_binding_role\":\"accessor\",\"accessor_bindings\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"resource_type\":\"share_accessor_binding\"}],\"allowed_access_protocols\":[\"nfs4\"],\"allowed_transit_encryption_modes\":[\"ipsec\"],\"availability_mode\":\"zonal\",\"bandwidth\":1,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"initial_owner\":{\"gid\":50,\"uid\":50},\"iops\":100,\"latest_job\":{\"status\":\"cancelled\",\"status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"type\":\"replication_failover\"},\"latest_sync\":{\"completed_at\":\"2019-01-01T12:00:00.000Z\",\"data_transferred\":0,\"started_at\":\"2019-01-01T12:00:00.000Z\"},\"lifecycle_reasons\":[{\"code\":\"cloning_in_progress\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"mount_targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"}],\"name\":\"my-share\",\"origin_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\",\"name\":\"tier-3iops\",\"resource_type\":\"share_profile\"},\"replica_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"replication_cron_spec\":\"0 */5 * * *\",\"replication_role\":\"none\",\"replication_status\":\"active\",\"replication_status_reasons\":[{\"code\":\"cannot_reach_source_share\",\"message\":\"The replication failover failed because the source share cannot be reached.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share\",\"size\":200,\"snapshot_count\":0,\"snapshot_size\":0,\"source_share\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"name\":\"my-share-snapshot\",\"resource_type\":\"share_snapshot\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -22658,43 +23799,144 @@ public void testListClusterNetworkSubnetReservedIpsWithPagerGetAll() throws Thro .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListClusterNetworkSubnetReservedIpsOptions listClusterNetworkSubnetReservedIpsOptions = new ListClusterNetworkSubnetReservedIpsOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") - .limit(Long.valueOf("10")) - .name("my-name") - .sort("name") + ListSharesOptions listSharesOptions = new ListSharesOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .name("my-name") + .sort("name") + .replicationRole("none") + .build(); + + SharesPager pager = new SharesPager(vpcService, listSharesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createShare operation with a valid options model parameter + @Test + public void testCreateShareWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_access_protocols\": [\"nfs4\"], \"allowed_transit_encryption_modes\": [\"ipsec\"], \"availability_mode\": \"zonal\", \"bandwidth\": 1, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createSharePath = "/shares"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + // Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model + ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext shareMountTargetVirtualNetworkInterfacePrototypeModel = new ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") + .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) + .build(); + + // Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") + .name("my-share-mount-target") + .transitEncryption("none") + .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) + .build(); + + // Construct an instance of the ShareProfileIdentityByName model + ShareProfileIdentityByName shareProfileIdentityModel = new ShareProfileIdentityByName.Builder() + .name("tier-3iops") + .build(); + + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - ClusterNetworkSubnetReservedIpsPager pager = new ClusterNetworkSubnetReservedIpsPager(vpcService, listClusterNetworkSubnetReservedIpsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createClusterNetworkSubnetReservedIp operation with a valid options model parameter - @Test - public void testCreateClusterNetworkSubnetReservedIpWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}"; - String createClusterNetworkSubnetReservedIpPath = "/cluster_networks/testString/subnets/testString/reserved_ips"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); + // Construct an instance of the SharePrototypeShareContext model + SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) + .iops(Long.valueOf("100")) + .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) + .name("my-share") + .profile(shareProfileIdentityModel) + .replicationCronSpec("0 */5 * * *") + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .zone(zoneIdentityModel) + .build(); - // Construct an instance of the CreateClusterNetworkSubnetReservedIpOptions model - CreateClusterNetworkSubnetReservedIpOptions createClusterNetworkSubnetReservedIpOptionsModel = new CreateClusterNetworkSubnetReservedIpOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") - .address("192.168.3.4") - .name("my-cluster-network-subnet-reserved-ip") + // Construct an instance of the EncryptionKeyIdentityByCRN model + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); - // Invoke createClusterNetworkSubnetReservedIp() with a valid options model and verify the result - Response response = vpcService.createClusterNetworkSubnetReservedIp(createClusterNetworkSubnetReservedIpOptionsModel).execute(); + // Construct an instance of the ShareInitialOwner model + ShareInitialOwner shareInitialOwnerModel = new ShareInitialOwner.Builder() + .gid(Long.valueOf("50")) + .uid(Long.valueOf("50")) + .build(); + + // Construct an instance of the SharePrototypeShareBySize model + SharePrototypeShareBySize sharePrototypeModel = new SharePrototypeShareBySize.Builder() + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) + .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) + .name("my-share") + .replicaShare(sharePrototypeShareContextModel) + .userTags(java.util.Arrays.asList()) + .accessControlMode("security_group") + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .bandwidth(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) + .initialOwner(shareInitialOwnerModel) + .iops(Long.valueOf("100")) + .profile(shareProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .size(Long.valueOf("200")) + .zone(zoneIdentityModel) + .build(); + + // Construct an instance of the CreateShareOptions model + CreateShareOptions createShareOptionsModel = new CreateShareOptions.Builder() + .sharePrototype(sharePrototypeModel) + .build(); + + // Invoke createShare() with a valid options model and verify the result + Response response = vpcService.createShare(createShareOptionsModel).execute(); assertNotNull(response); - ClusterNetworkSubnetReservedIP responseObj = response.getResult(); + Share responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -22703,54 +23945,52 @@ public void testCreateClusterNetworkSubnetReservedIpWOptions() throws Throwable assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createClusterNetworkSubnetReservedIpPath); + assertEquals(parsedPath, createSharePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createClusterNetworkSubnetReservedIp operation with and without retries enabled + // Test the createShare operation with and without retries enabled @Test - public void testCreateClusterNetworkSubnetReservedIpWRetries() throws Throwable { + public void testCreateShareWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateClusterNetworkSubnetReservedIpWOptions(); + testCreateShareWOptions(); vpcService.disableRetries(); - testCreateClusterNetworkSubnetReservedIpWOptions(); + testCreateShareWOptions(); } - // Test the createClusterNetworkSubnetReservedIp operation with a null options model (negative test) + // Test the createShare operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateClusterNetworkSubnetReservedIpNoOptions() throws Throwable { + public void testCreateShareNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createClusterNetworkSubnetReservedIp(null).execute(); + vpcService.createShare(null).execute(); } - // Test the deleteClusterNetworkSubnetReservedIp operation with a valid options model parameter + // Test the deleteShare operation with a valid options model parameter @Test - public void testDeleteClusterNetworkSubnetReservedIpWOptions() throws Throwable { + public void testDeleteShareWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}"; - String deleteClusterNetworkSubnetReservedIpPath = "/cluster_networks/testString/subnets/testString/reserved_ips/testString"; + String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_access_protocols\": [\"nfs4\"], \"allowed_transit_encryption_modes\": [\"ipsec\"], \"availability_mode\": \"zonal\", \"bandwidth\": 1, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String deleteSharePath = "/shares/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteClusterNetworkSubnetReservedIpOptions model - DeleteClusterNetworkSubnetReservedIpOptions deleteClusterNetworkSubnetReservedIpOptionsModel = new DeleteClusterNetworkSubnetReservedIpOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + // Construct an instance of the DeleteShareOptions model + DeleteShareOptions deleteShareOptionsModel = new DeleteShareOptions.Builder() .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") .build(); - // Invoke deleteClusterNetworkSubnetReservedIp() with a valid options model and verify the result - Response response = vpcService.deleteClusterNetworkSubnetReservedIp(deleteClusterNetworkSubnetReservedIpOptionsModel).execute(); + // Invoke deleteShare() with a valid options model and verify the result + Response response = vpcService.deleteShare(deleteShareOptionsModel).execute(); assertNotNull(response); - ClusterNetworkSubnetReservedIP responseObj = response.getResult(); + Share responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -22759,53 +23999,51 @@ public void testDeleteClusterNetworkSubnetReservedIpWOptions() throws Throwable assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteClusterNetworkSubnetReservedIpPath); + assertEquals(parsedPath, deleteSharePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteClusterNetworkSubnetReservedIp operation with and without retries enabled + // Test the deleteShare operation with and without retries enabled @Test - public void testDeleteClusterNetworkSubnetReservedIpWRetries() throws Throwable { + public void testDeleteShareWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteClusterNetworkSubnetReservedIpWOptions(); + testDeleteShareWOptions(); vpcService.disableRetries(); - testDeleteClusterNetworkSubnetReservedIpWOptions(); + testDeleteShareWOptions(); } - // Test the deleteClusterNetworkSubnetReservedIp operation with a null options model (negative test) + // Test the deleteShare operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteClusterNetworkSubnetReservedIpNoOptions() throws Throwable { + public void testDeleteShareNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteClusterNetworkSubnetReservedIp(null).execute(); + vpcService.deleteShare(null).execute(); } - // Test the getClusterNetworkSubnetReservedIp operation with a valid options model parameter + // Test the getShare operation with a valid options model parameter @Test - public void testGetClusterNetworkSubnetReservedIpWOptions() throws Throwable { + public void testGetShareWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}"; - String getClusterNetworkSubnetReservedIpPath = "/cluster_networks/testString/subnets/testString/reserved_ips/testString"; + String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_access_protocols\": [\"nfs4\"], \"allowed_transit_encryption_modes\": [\"ipsec\"], \"availability_mode\": \"zonal\", \"bandwidth\": 1, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getSharePath = "/shares/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetClusterNetworkSubnetReservedIpOptions model - GetClusterNetworkSubnetReservedIpOptions getClusterNetworkSubnetReservedIpOptionsModel = new GetClusterNetworkSubnetReservedIpOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + // Construct an instance of the GetShareOptions model + GetShareOptions getShareOptionsModel = new GetShareOptions.Builder() .id("testString") .build(); - // Invoke getClusterNetworkSubnetReservedIp() with a valid options model and verify the result - Response response = vpcService.getClusterNetworkSubnetReservedIp(getClusterNetworkSubnetReservedIpOptionsModel).execute(); + // Invoke getShare() with a valid options model and verify the result + Response response = vpcService.getShare(getShareOptionsModel).execute(); assertNotNull(response); - ClusterNetworkSubnetReservedIP responseObj = response.getResult(); + Share responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -22814,62 +24052,73 @@ public void testGetClusterNetworkSubnetReservedIpWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getClusterNetworkSubnetReservedIpPath); + assertEquals(parsedPath, getSharePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getClusterNetworkSubnetReservedIp operation with and without retries enabled + // Test the getShare operation with and without retries enabled @Test - public void testGetClusterNetworkSubnetReservedIpWRetries() throws Throwable { + public void testGetShareWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetClusterNetworkSubnetReservedIpWOptions(); + testGetShareWOptions(); vpcService.disableRetries(); - testGetClusterNetworkSubnetReservedIpWOptions(); + testGetShareWOptions(); } - // Test the getClusterNetworkSubnetReservedIp operation with a null options model (negative test) + // Test the getShare operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetClusterNetworkSubnetReservedIpNoOptions() throws Throwable { + public void testGetShareNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getClusterNetworkSubnetReservedIp(null).execute(); + vpcService.getShare(null).execute(); } - // Test the updateClusterNetworkSubnetReservedIp operation with a valid options model parameter + // Test the updateShare operation with a valid options model parameter @Test - public void testUpdateClusterNetworkSubnetReservedIpWOptions() throws Throwable { + public void testUpdateShareWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"10.1.0.6\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930/reserved_ips/0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"id\": \"0717-d4d6489a-3bf5-4104-a33a-3572faf2d117\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet-reserved-ip\", \"owner\": \"user\", \"resource_type\": \"cluster_network_subnet_reserved_ip\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/interfaces/0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"id\": \"0717-ffc092f7-5d02-4b93-ab69-26860529b9fb\", \"name\": \"my-cluster-network-interface\", \"resource_type\": \"cluster_network_interface\"}}"; - String updateClusterNetworkSubnetReservedIpPath = "/cluster_networks/testString/subnets/testString/reserved_ips/testString"; + String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"accessor_binding_role\": \"accessor\", \"accessor_bindings\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"resource_type\": \"share_accessor_binding\"}], \"allowed_access_protocols\": [\"nfs4\"], \"allowed_transit_encryption_modes\": [\"ipsec\"], \"availability_mode\": \"zonal\", \"bandwidth\": 1, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"initial_owner\": {\"gid\": 50, \"uid\": 50}, \"iops\": 100, \"latest_job\": {\"status\": \"cancelled\", \"status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"type\": \"replication_failover\"}, \"latest_sync\": {\"completed_at\": \"2019-01-01T12:00:00.000Z\", \"data_transferred\": 0, \"started_at\": \"2019-01-01T12:00:00.000Z\"}, \"lifecycle_reasons\": [{\"code\": \"cloning_in_progress\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"mount_targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}], \"name\": \"my-share\", \"origin_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-3iops\", \"name\": \"tier-3iops\", \"resource_type\": \"share_profile\"}, \"replica_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"replication_cron_spec\": \"0 */5 * * *\", \"replication_role\": \"none\", \"replication_status\": \"active\", \"replication_status_reasons\": [{\"code\": \"cannot_reach_source_share\", \"message\": \"The replication failover failed because the source share cannot be reached.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-planning\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share\", \"size\": 200, \"snapshot_count\": 0, \"snapshot_size\": 0, \"source_share\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"name\": \"my-share-snapshot\", \"resource_type\": \"share_snapshot\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateSharePath = "/shares/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ClusterNetworkSubnetReservedIPPatch model - ClusterNetworkSubnetReservedIPPatch clusterNetworkSubnetReservedIpPatchModel = new ClusterNetworkSubnetReservedIPPatch.Builder() - .autoDelete(false) - .name("my-cluster-network-subnet-reserved-ip") + // Construct an instance of the ShareProfileIdentityByName model + ShareProfileIdentityByName shareProfileIdentityModel = new ShareProfileIdentityByName.Builder() + .name("tier-3iops") .build(); - Map clusterNetworkSubnetReservedIpPatchModelAsPatch = clusterNetworkSubnetReservedIpPatchModel.asPatch(); - // Construct an instance of the UpdateClusterNetworkSubnetReservedIpOptions model - UpdateClusterNetworkSubnetReservedIpOptions updateClusterNetworkSubnetReservedIpOptionsModel = new UpdateClusterNetworkSubnetReservedIpOptions.Builder() - .clusterNetworkId("testString") - .clusterNetworkSubnetId("testString") + // Construct an instance of the SharePatch model + SharePatch sharePatchModel = new SharePatch.Builder() + .accessControlMode("security_group") + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) + .bandwidth(Long.valueOf("1")) + .iops(Long.valueOf("100")) + .name("my-share") + .profile(shareProfileIdentityModel) + .replicationCronSpec("0 */5 * * *") + .size(Long.valueOf("8000")) + .userTags(java.util.Arrays.asList("testString")) + .build(); + Map sharePatchModelAsPatch = sharePatchModel.asPatch(); + + // Construct an instance of the UpdateShareOptions model + UpdateShareOptions updateShareOptionsModel = new UpdateShareOptions.Builder() .id("testString") - .clusterNetworkSubnetReservedIpPatch(clusterNetworkSubnetReservedIpPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .sharePatch(sharePatchModelAsPatch) + .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") .build(); - // Invoke updateClusterNetworkSubnetReservedIp() with a valid options model and verify the result - Response response = vpcService.updateClusterNetworkSubnetReservedIp(updateClusterNetworkSubnetReservedIpOptionsModel).execute(); + // Invoke updateShare() with a valid options model and verify the result + Response response = vpcService.updateShare(updateShareOptionsModel).execute(); assertNotNull(response); - ClusterNetworkSubnetReservedIP responseObj = response.getResult(); + Share responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -22878,224 +24127,173 @@ public void testUpdateClusterNetworkSubnetReservedIpWOptions() throws Throwable assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateClusterNetworkSubnetReservedIpPath); + assertEquals(parsedPath, updateSharePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateClusterNetworkSubnetReservedIp operation with and without retries enabled + // Test the updateShare operation with and without retries enabled @Test - public void testUpdateClusterNetworkSubnetReservedIpWRetries() throws Throwable { + public void testUpdateShareWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateClusterNetworkSubnetReservedIpWOptions(); + testUpdateShareWOptions(); vpcService.disableRetries(); - testUpdateClusterNetworkSubnetReservedIpWOptions(); + testUpdateShareWOptions(); } - // Test the updateClusterNetworkSubnetReservedIp operation with a null options model (negative test) + // Test the updateShare operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateClusterNetworkSubnetReservedIpNoOptions() throws Throwable { + public void testUpdateShareNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateClusterNetworkSubnetReservedIp(null).execute(); + vpcService.updateShare(null).execute(); } - // Test the deleteClusterNetworkSubnet operation with a valid options model parameter + // Test the listShareAccessorBindings operation with a valid options model parameter @Test - public void testDeleteClusterNetworkSubnetWOptions() throws Throwable { + public void testListShareAccessorBindingsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}"; - String deleteClusterNetworkSubnetPath = "/cluster_networks/testString/subnets/testString"; + String mockResponseBody = "{\"accessor_bindings\": [{\"accessor\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"lifecycle_state\": \"stable\", \"resource_type\": \"share_accessor_binding\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listShareAccessorBindingsPath = "/shares/testString/accessor_bindings"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteClusterNetworkSubnetOptions model - DeleteClusterNetworkSubnetOptions deleteClusterNetworkSubnetOptionsModel = new DeleteClusterNetworkSubnetOptions.Builder() - .clusterNetworkId("testString") + // Construct an instance of the ListShareAccessorBindingsOptions model + ListShareAccessorBindingsOptions listShareAccessorBindingsOptionsModel = new ListShareAccessorBindingsOptions.Builder() .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke deleteClusterNetworkSubnet() with a valid options model and verify the result - Response response = vpcService.deleteClusterNetworkSubnet(deleteClusterNetworkSubnetOptionsModel).execute(); + // Invoke listShareAccessorBindings() with a valid options model and verify the result + Response response = vpcService.listShareAccessorBindings(listShareAccessorBindingsOptionsModel).execute(); assertNotNull(response); - ClusterNetworkSubnet responseObj = response.getResult(); + ShareAccessorBindingCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteClusterNetworkSubnetPath); + assertEquals(parsedPath, listShareAccessorBindingsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the deleteClusterNetworkSubnet operation with and without retries enabled + // Test the listShareAccessorBindings operation with and without retries enabled @Test - public void testDeleteClusterNetworkSubnetWRetries() throws Throwable { + public void testListShareAccessorBindingsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteClusterNetworkSubnetWOptions(); + testListShareAccessorBindingsWOptions(); vpcService.disableRetries(); - testDeleteClusterNetworkSubnetWOptions(); + testListShareAccessorBindingsWOptions(); } - // Test the deleteClusterNetworkSubnet operation with a null options model (negative test) + // Test the listShareAccessorBindings operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteClusterNetworkSubnetNoOptions() throws Throwable { + public void testListShareAccessorBindingsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteClusterNetworkSubnet(null).execute(); + vpcService.listShareAccessorBindings(null).execute(); } - // Test the getClusterNetworkSubnet operation with a valid options model parameter + // Test the listShareAccessorBindings operation using the ShareAccessorBindingsPager.getNext() method @Test - public void testGetClusterNetworkSubnetWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}"; - String getClusterNetworkSubnetPath = "/cluster_networks/testString/subnets/testString"; + public void testListShareAccessorBindingsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"accessor_bindings\":[{\"accessor\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"lifecycle_state\":\"stable\",\"resource_type\":\"share_accessor_binding\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"accessor_bindings\":[{\"accessor\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"lifecycle_state\":\"stable\",\"resource_type\":\"share_accessor_binding\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the GetClusterNetworkSubnetOptions model - GetClusterNetworkSubnetOptions getClusterNetworkSubnetOptionsModel = new GetClusterNetworkSubnetOptions.Builder() - .clusterNetworkId("testString") + ListShareAccessorBindingsOptions listShareAccessorBindingsOptions = new ListShareAccessorBindingsOptions.Builder() .id("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke getClusterNetworkSubnet() with a valid options model and verify the result - Response response = vpcService.getClusterNetworkSubnet(getClusterNetworkSubnetOptionsModel).execute(); - assertNotNull(response); - ClusterNetworkSubnet responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getClusterNetworkSubnetPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the getClusterNetworkSubnet operation with and without retries enabled - @Test - public void testGetClusterNetworkSubnetWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetClusterNetworkSubnetWOptions(); - - vpcService.disableRetries(); - testGetClusterNetworkSubnetWOptions(); - } - - // Test the getClusterNetworkSubnet operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetClusterNetworkSubnetNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getClusterNetworkSubnet(null).execute(); + List allResults = new ArrayList<>(); + ShareAccessorBindingsPager pager = new ShareAccessorBindingsPager(vpcService, listShareAccessorBindingsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } - - // Test the updateClusterNetworkSubnet operation with a valid options model parameter + + // Test the listShareAccessorBindings operation using the ShareAccessorBindingsPager.getAll() method @Test - public void testUpdateClusterNetworkSubnetWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573/subnets/0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"id\": \"0717-7931845c-65c4-4b0a-80cd-7d9c1a6d7930\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network-subnet\", \"resource_type\": \"cluster_network_subnet\", \"total_ipv4_address_count\": 256}"; - String updateClusterNetworkSubnetPath = "/cluster_networks/testString/subnets/testString"; + public void testListShareAccessorBindingsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"accessor_bindings\":[{\"accessor\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"lifecycle_state\":\"stable\",\"resource_type\":\"share_accessor_binding\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"accessor_bindings\":[{\"accessor\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"id\":\"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\",\"name\":\"my-share\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"share\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\",\"id\":\"r006-ce9dac18-dea0-4392-841c-142d3300674f\",\"lifecycle_state\":\"stable\",\"resource_type\":\"share_accessor_binding\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ClusterNetworkSubnetPatch model - ClusterNetworkSubnetPatch clusterNetworkSubnetPatchModel = new ClusterNetworkSubnetPatch.Builder() - .name("my-cluster-network-subnet") - .build(); - Map clusterNetworkSubnetPatchModelAsPatch = clusterNetworkSubnetPatchModel.asPatch(); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the UpdateClusterNetworkSubnetOptions model - UpdateClusterNetworkSubnetOptions updateClusterNetworkSubnetOptionsModel = new UpdateClusterNetworkSubnetOptions.Builder() - .clusterNetworkId("testString") + ListShareAccessorBindingsOptions listShareAccessorBindingsOptions = new ListShareAccessorBindingsOptions.Builder() .id("testString") - .clusterNetworkSubnetPatch(clusterNetworkSubnetPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .limit(Long.valueOf("10")) .build(); - // Invoke updateClusterNetworkSubnet() with a valid options model and verify the result - Response response = vpcService.updateClusterNetworkSubnet(updateClusterNetworkSubnetOptionsModel).execute(); - assertNotNull(response); - ClusterNetworkSubnet responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateClusterNetworkSubnetPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the updateClusterNetworkSubnet operation with and without retries enabled - @Test - public void testUpdateClusterNetworkSubnetWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testUpdateClusterNetworkSubnetWOptions(); - - vpcService.disableRetries(); - testUpdateClusterNetworkSubnetWOptions(); - } - - // Test the updateClusterNetworkSubnet operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateClusterNetworkSubnetNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.updateClusterNetworkSubnet(null).execute(); + ShareAccessorBindingsPager pager = new ShareAccessorBindingsPager(vpcService, listShareAccessorBindingsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the deleteClusterNetwork operation with a valid options model parameter + + // Test the deleteShareAccessorBinding operation with a valid options model parameter @Test - public void testDeleteClusterNetworkWOptions() throws Throwable { + public void testDeleteShareAccessorBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String deleteClusterNetworkPath = "/cluster_networks/testString"; + String mockResponseBody = ""; + String deleteShareAccessorBindingPath = "/shares/testString/accessor_bindings/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteClusterNetworkOptions model - DeleteClusterNetworkOptions deleteClusterNetworkOptionsModel = new DeleteClusterNetworkOptions.Builder() + // Construct an instance of the DeleteShareAccessorBindingOptions model + DeleteShareAccessorBindingOptions deleteShareAccessorBindingOptionsModel = new DeleteShareAccessorBindingOptions.Builder() + .shareId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteClusterNetwork() with a valid options model and verify the result - Response response = vpcService.deleteClusterNetwork(deleteClusterNetworkOptionsModel).execute(); + // Invoke deleteShareAccessorBinding() with a valid options model and verify the result + Response response = vpcService.deleteShareAccessorBinding(deleteShareAccessorBindingOptionsModel).execute(); assertNotNull(response); - ClusterNetwork responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -23103,51 +24301,52 @@ public void testDeleteClusterNetworkWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteClusterNetworkPath); + assertEquals(parsedPath, deleteShareAccessorBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteClusterNetwork operation with and without retries enabled + // Test the deleteShareAccessorBinding operation with and without retries enabled @Test - public void testDeleteClusterNetworkWRetries() throws Throwable { + public void testDeleteShareAccessorBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteClusterNetworkWOptions(); + testDeleteShareAccessorBindingWOptions(); vpcService.disableRetries(); - testDeleteClusterNetworkWOptions(); + testDeleteShareAccessorBindingWOptions(); } - // Test the deleteClusterNetwork operation with a null options model (negative test) + // Test the deleteShareAccessorBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteClusterNetworkNoOptions() throws Throwable { + public void testDeleteShareAccessorBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteClusterNetwork(null).execute(); + vpcService.deleteShareAccessorBinding(null).execute(); } - // Test the getClusterNetwork operation with a valid options model parameter + // Test the getShareAccessorBinding operation with a valid options model parameter @Test - public void testGetClusterNetworkWOptions() throws Throwable { + public void testGetShareAccessorBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getClusterNetworkPath = "/cluster_networks/testString"; + String mockResponseBody = "{\"accessor\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/accessor_bindings/r006-ae9bdc18-aed0-4392-841c-142d3300674f\", \"id\": \"r006-ce9dac18-dea0-4392-841c-142d3300674f\", \"lifecycle_state\": \"stable\", \"resource_type\": \"share_accessor_binding\"}"; + String getShareAccessorBindingPath = "/shares/testString/accessor_bindings/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetClusterNetworkOptions model - GetClusterNetworkOptions getClusterNetworkOptionsModel = new GetClusterNetworkOptions.Builder() + // Construct an instance of the GetShareAccessorBindingOptions model + GetShareAccessorBindingOptions getShareAccessorBindingOptionsModel = new GetShareAccessorBindingOptions.Builder() + .shareId("testString") .id("testString") .build(); - // Invoke getClusterNetwork() with a valid options model and verify the result - Response response = vpcService.getClusterNetwork(getClusterNetworkOptionsModel).execute(); + // Invoke getShareAccessorBinding() with a valid options model and verify the result + Response response = vpcService.getShareAccessorBinding(getShareAccessorBindingOptionsModel).execute(); assertNotNull(response); - ClusterNetwork responseObj = response.getResult(); + ShareAccessorBinding responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -23156,114 +24355,108 @@ public void testGetClusterNetworkWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getClusterNetworkPath); + assertEquals(parsedPath, getShareAccessorBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getClusterNetwork operation with and without retries enabled + // Test the getShareAccessorBinding operation with and without retries enabled @Test - public void testGetClusterNetworkWRetries() throws Throwable { + public void testGetShareAccessorBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetClusterNetworkWOptions(); + testGetShareAccessorBindingWOptions(); vpcService.disableRetries(); - testGetClusterNetworkWOptions(); + testGetShareAccessorBindingWOptions(); } - // Test the getClusterNetwork operation with a null options model (negative test) + // Test the getShareAccessorBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetClusterNetworkNoOptions() throws Throwable { + public void testGetShareAccessorBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getClusterNetwork(null).execute(); + vpcService.getShareAccessorBinding(null).execute(); } - // Test the updateClusterNetwork operation with a valid options model parameter + // Test the failoverShare operation with a valid options model parameter @Test - public void testUpdateClusterNetworkWOptions() throws Throwable { + public void testFailoverShareWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::cluster-network:0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_networks/0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"id\": \"0717-da0df18c-7598-4633-a648-fdaac28a5573\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-cluster-network\", \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/cluster_network/profiles/h100\", \"name\": \"h100\", \"resource_type\": \"cluster_network_profile\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"cluster_network\", \"subnet_prefixes\": [{\"allocation_policy\": \"auto\", \"cidr\": \"10.0.0.0/24\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateClusterNetworkPath = "/cluster_networks/testString"; + String mockResponseBody = ""; + String failoverSharePath = "/shares/testString/failover"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - - // Construct an instance of the ClusterNetworkPatch model - ClusterNetworkPatch clusterNetworkPatchModel = new ClusterNetworkPatch.Builder() - .name("my-cluster-network") - .build(); - Map clusterNetworkPatchModelAsPatch = clusterNetworkPatchModel.asPatch(); - - // Construct an instance of the UpdateClusterNetworkOptions model - UpdateClusterNetworkOptions updateClusterNetworkOptionsModel = new UpdateClusterNetworkOptions.Builder() - .id("testString") - .clusterNetworkPatch(clusterNetworkPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + + // Construct an instance of the FailoverShareOptions model + FailoverShareOptions failoverShareOptionsModel = new FailoverShareOptions.Builder() + .shareId("testString") + .fallbackPolicy("fail") + .timeout(Long.valueOf("600")) .build(); - // Invoke updateClusterNetwork() with a valid options model and verify the result - Response response = vpcService.updateClusterNetwork(updateClusterNetworkOptionsModel).execute(); + // Invoke failoverShare() with a valid options model and verify the result + Response response = vpcService.failoverShare(failoverShareOptionsModel).execute(); assertNotNull(response); - ClusterNetwork responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateClusterNetworkPath); + assertEquals(parsedPath, failoverSharePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateClusterNetwork operation with and without retries enabled + // Test the failoverShare operation with and without retries enabled @Test - public void testUpdateClusterNetworkWRetries() throws Throwable { + public void testFailoverShareWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateClusterNetworkWOptions(); + testFailoverShareWOptions(); vpcService.disableRetries(); - testUpdateClusterNetworkWOptions(); + testFailoverShareWOptions(); } - // Test the updateClusterNetwork operation with a null options model (negative test) + // Test the failoverShare operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateClusterNetworkNoOptions() throws Throwable { + public void testFailoverShareNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateClusterNetwork(null).execute(); + vpcService.failoverShare(null).execute(); } - // Test the listPublicGateways operation with a valid options model parameter + // Test the listShareMountTargets operation with a valid options model parameter @Test - public void testListPublicGatewaysWOptions() throws Throwable { + public void testListShareMountTargetsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"public_gateways\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; - String listPublicGatewaysPath = "/public_gateways"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"mount_targets\": [{\"access_control_mode\": \"security_group\", \"access_protocol\": \"nfs4\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listShareMountTargetsPath = "/shares/testString/mount_targets"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListPublicGatewaysOptions model - ListPublicGatewaysOptions listPublicGatewaysOptionsModel = new ListPublicGatewaysOptions.Builder() + // Construct an instance of the ListShareMountTargetsOptions model + ListShareMountTargetsOptions listShareMountTargetsOptionsModel = new ListShareMountTargetsOptions.Builder() + .shareId("testString") + .name("my-name") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .build(); - // Invoke listPublicGateways() with a valid options model and verify the result - Response response = vpcService.listPublicGateways(listPublicGatewaysOptionsModel).execute(); + // Invoke listShareMountTargets() with a valid options model and verify the result + Response response = vpcService.listShareMountTargets(listShareMountTargetsOptionsModel).execute(); assertNotNull(response); - PublicGatewayCollection responseObj = response.getResult(); + ShareMountTargetCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -23272,33 +24465,40 @@ public void testListPublicGatewaysWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listPublicGatewaysPath); + assertEquals(parsedPath, listShareMountTargetsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("name"), "my-name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); } - // Test the listPublicGateways operation with and without retries enabled + // Test the listShareMountTargets operation with and without retries enabled @Test - public void testListPublicGatewaysWRetries() throws Throwable { + public void testListShareMountTargetsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListPublicGatewaysWOptions(); + testListShareMountTargetsWOptions(); vpcService.disableRetries(); - testListPublicGatewaysWOptions(); + testListShareMountTargetsWOptions(); } - // Test the listPublicGateways operation using the PublicGatewaysPager.getNext() method + // Test the listShareMountTargets operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListShareMountTargetsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listShareMountTargets(null).execute(); + } + + // Test the listShareMountTargets operation using the ShareMountTargetsPager.getNext() method @Test - public void testListPublicGatewaysWithPagerGetNext() throws Throwable { + public void testListShareMountTargetsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"mount_targets\":[{\"access_control_mode\":\"security_group\",\"access_protocol\":\"nfs4\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"lifecycle_state\":\"stable\",\"mount_path\":\"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\",\"name\":\"my-share-mount-target\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"share_mount_target\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"transit_encryption\":\"none\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"mount_targets\":[{\"access_control_mode\":\"security_group\",\"access_protocol\":\"nfs4\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"lifecycle_state\":\"stable\",\"mount_path\":\"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\",\"name\":\"my-share-mount-target\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"share_mount_target\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"transit_encryption\":\"none\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -23312,27 +24512,28 @@ public void testListPublicGatewaysWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() + ListShareMountTargetsOptions listShareMountTargetsOptions = new ListShareMountTargetsOptions.Builder() + .shareId("testString") + .name("my-name") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .build(); - List allResults = new ArrayList<>(); - PublicGatewaysPager pager = new PublicGatewaysPager(vpcService, listPublicGatewaysOptions); + List allResults = new ArrayList<>(); + ShareMountTargetsPager pager = new ShareMountTargetsPager(vpcService, listShareMountTargetsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listPublicGateways operation using the PublicGatewaysPager.getAll() method + // Test the listShareMountTargets operation using the ShareMountTargetsPager.getAll() method @Test - public void testListPublicGatewaysWithPagerGetAll() throws Throwable { + public void testListShareMountTargetsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"floating_ip\":{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_gateway\",\"status\":\"available\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"mount_targets\":[{\"access_control_mode\":\"security_group\",\"access_protocol\":\"nfs4\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"lifecycle_state\":\"stable\",\"mount_path\":\"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\",\"name\":\"my-share-mount-target\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"share_mount_target\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"transit_encryption\":\"none\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"mount_targets\":[{\"access_control_mode\":\"security_group\",\"access_protocol\":\"nfs4\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"lifecycle_state\":\"stable\",\"mount_path\":\"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\",\"name\":\"my-share-mount-target\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"share_mount_target\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"transit_encryption\":\"none\",\"virtual_network_interface\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"name\":\"my-virtual-network-interface\",\"resource_type\":\"virtual_network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -23346,41 +24547,41 @@ public void testListPublicGatewaysWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPublicGatewaysOptions listPublicGatewaysOptions = new ListPublicGatewaysOptions.Builder() + ListShareMountTargetsOptions listShareMountTargetsOptions = new ListShareMountTargetsOptions.Builder() + .shareId("testString") + .name("my-name") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .build(); - PublicGatewaysPager pager = new PublicGatewaysPager(vpcService, listPublicGatewaysOptions); - List allResults = pager.getAll(); + ShareMountTargetsPager pager = new ShareMountTargetsPager(vpcService, listShareMountTargetsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createPublicGateway operation with a valid options model parameter + // Test the createShareMountTarget operation with a valid options model parameter @Test - public void testCreatePublicGatewayWOptions() throws Throwable { + public void testCreateShareMountTargetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createPublicGatewayPath = "/public_gateways"; + String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"access_protocol\": \"nfs4\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String createShareMountTargetPath = "/shares/testString/mount_targets"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext model + VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") .build(); - // Construct an instance of the PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model - PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById publicGatewayFloatingIpPrototypeModel = new PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById.Builder() - .id("r006-f45e0d90-12a8-4460-8210-290ff2ab75cd") + // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext model + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext.Builder() + .address("10.0.0.5") + .autoDelete(false) + .name("my-reserved-ip") .build(); // Construct an instance of the ResourceGroupIdentityById model @@ -23388,19 +24589,48 @@ public void testCreatePublicGatewayWOptions() throws Throwable { .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the CreatePublicGatewayOptions model - CreatePublicGatewayOptions createPublicGatewayOptionsModel = new CreatePublicGatewayOptions.Builder() - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) - .floatingIp(publicGatewayFloatingIpPrototypeModel) - .name("my-public-gateway") + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + // Construct an instance of the ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext model + ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext shareMountTargetVirtualNetworkInterfacePrototypeModel = new ShareMountTargetVirtualNetworkInterfacePrototypeVirtualNetworkInterfacePrototypeShareMountTargetContext.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) .build(); - // Invoke createPublicGateway() with a valid options model and verify the result - Response response = vpcService.createPublicGateway(createPublicGatewayOptionsModel).execute(); + // Construct an instance of the ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup model + ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") + .name("my-share-mount-target") + .transitEncryption("none") + .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) + .build(); + + // Construct an instance of the CreateShareMountTargetOptions model + CreateShareMountTargetOptions createShareMountTargetOptionsModel = new CreateShareMountTargetOptions.Builder() + .shareId("testString") + .shareMountTargetPrototype(shareMountTargetPrototypeModel) + .build(); + + // Invoke createShareMountTarget() with a valid options model and verify the result + Response response = vpcService.createShareMountTarget(createShareMountTargetOptionsModel).execute(); assertNotNull(response); - PublicGateway responseObj = response.getResult(); + ShareMountTarget responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -23409,51 +24639,53 @@ public void testCreatePublicGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createPublicGatewayPath); + assertEquals(parsedPath, createShareMountTargetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createPublicGateway operation with and without retries enabled + // Test the createShareMountTarget operation with and without retries enabled @Test - public void testCreatePublicGatewayWRetries() throws Throwable { + public void testCreateShareMountTargetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreatePublicGatewayWOptions(); + testCreateShareMountTargetWOptions(); vpcService.disableRetries(); - testCreatePublicGatewayWOptions(); + testCreateShareMountTargetWOptions(); } - // Test the createPublicGateway operation with a null options model (negative test) + // Test the createShareMountTarget operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreatePublicGatewayNoOptions() throws Throwable { + public void testCreateShareMountTargetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createPublicGateway(null).execute(); + vpcService.createShareMountTarget(null).execute(); } - // Test the deletePublicGateway operation with a valid options model parameter + // Test the deleteShareMountTarget operation with a valid options model parameter @Test - public void testDeletePublicGatewayWOptions() throws Throwable { + public void testDeleteShareMountTargetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deletePublicGatewayPath = "/public_gateways/testString"; + String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"access_protocol\": \"nfs4\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String deleteShareMountTargetPath = "/shares/testString/mount_targets/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeletePublicGatewayOptions model - DeletePublicGatewayOptions deletePublicGatewayOptionsModel = new DeletePublicGatewayOptions.Builder() + // Construct an instance of the DeleteShareMountTargetOptions model + DeleteShareMountTargetOptions deleteShareMountTargetOptionsModel = new DeleteShareMountTargetOptions.Builder() + .shareId("testString") .id("testString") .build(); - // Invoke deletePublicGateway() with a valid options model and verify the result - Response response = vpcService.deletePublicGateway(deletePublicGatewayOptionsModel).execute(); + // Invoke deleteShareMountTarget() with a valid options model and verify the result + Response response = vpcService.deleteShareMountTarget(deleteShareMountTargetOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ShareMountTarget responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -23461,51 +24693,52 @@ public void testDeletePublicGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deletePublicGatewayPath); + assertEquals(parsedPath, deleteShareMountTargetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deletePublicGateway operation with and without retries enabled + // Test the deleteShareMountTarget operation with and without retries enabled @Test - public void testDeletePublicGatewayWRetries() throws Throwable { + public void testDeleteShareMountTargetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeletePublicGatewayWOptions(); + testDeleteShareMountTargetWOptions(); vpcService.disableRetries(); - testDeletePublicGatewayWOptions(); + testDeleteShareMountTargetWOptions(); } - // Test the deletePublicGateway operation with a null options model (negative test) + // Test the deleteShareMountTarget operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeletePublicGatewayNoOptions() throws Throwable { + public void testDeleteShareMountTargetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deletePublicGateway(null).execute(); + vpcService.deleteShareMountTarget(null).execute(); } - // Test the getPublicGateway operation with a valid options model parameter + // Test the getShareMountTarget operation with a valid options model parameter @Test - public void testGetPublicGatewayWOptions() throws Throwable { + public void testGetShareMountTargetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getPublicGatewayPath = "/public_gateways/testString"; + String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"access_protocol\": \"nfs4\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getShareMountTargetPath = "/shares/testString/mount_targets/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetPublicGatewayOptions model - GetPublicGatewayOptions getPublicGatewayOptionsModel = new GetPublicGatewayOptions.Builder() + // Construct an instance of the GetShareMountTargetOptions model + GetShareMountTargetOptions getShareMountTargetOptionsModel = new GetShareMountTargetOptions.Builder() + .shareId("testString") .id("testString") .build(); - // Invoke getPublicGateway() with a valid options model and verify the result - Response response = vpcService.getPublicGateway(getPublicGatewayOptionsModel).execute(); + // Invoke getShareMountTarget() with a valid options model and verify the result + Response response = vpcService.getShareMountTarget(getShareMountTargetOptionsModel).execute(); assertNotNull(response); - PublicGateway responseObj = response.getResult(); + ShareMountTarget responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -23514,58 +24747,59 @@ public void testGetPublicGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getPublicGatewayPath); + assertEquals(parsedPath, getShareMountTargetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getPublicGateway operation with and without retries enabled + // Test the getShareMountTarget operation with and without retries enabled @Test - public void testGetPublicGatewayWRetries() throws Throwable { + public void testGetShareMountTargetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetPublicGatewayWOptions(); + testGetShareMountTargetWOptions(); vpcService.disableRetries(); - testGetPublicGatewayWOptions(); + testGetShareMountTargetWOptions(); } - // Test the getPublicGateway operation with a null options model (negative test) + // Test the getShareMountTarget operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetPublicGatewayNoOptions() throws Throwable { + public void testGetShareMountTargetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getPublicGateway(null).execute(); + vpcService.getShareMountTarget(null).execute(); } - // Test the updatePublicGateway operation with a valid options model parameter + // Test the updateShareMountTarget operation with a valid options model parameter @Test - public void testUpdatePublicGatewayWOptions() throws Throwable { + public void testUpdateShareMountTargetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updatePublicGatewayPath = "/public_gateways/testString"; + String mockResponseBody = "{\"access_control_mode\": \"security_group\", \"access_protocol\": \"nfs4\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"lifecycle_state\": \"stable\", \"mount_path\": \"10.240.1.23:/nxg_s_voll_mz7121_58e7e963_8f4b_4a0c_b71a_8ba8d9cd1e2e\", \"name\": \"my-share-mount-target\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"share_mount_target\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"transit_encryption\": \"none\", \"virtual_network_interface\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"name\": \"my-virtual-network-interface\", \"resource_type\": \"virtual_network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String updateShareMountTargetPath = "/shares/testString/mount_targets/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the PublicGatewayPatch model - PublicGatewayPatch publicGatewayPatchModel = new PublicGatewayPatch.Builder() - .name("my-public-gateway-updated") + // Construct an instance of the ShareMountTargetPatch model + ShareMountTargetPatch shareMountTargetPatchModel = new ShareMountTargetPatch.Builder() + .name("my-share-mount-target") .build(); - Map publicGatewayPatchModelAsPatch = publicGatewayPatchModel.asPatch(); + Map shareMountTargetPatchModelAsPatch = shareMountTargetPatchModel.asPatch(); - // Construct an instance of the UpdatePublicGatewayOptions model - UpdatePublicGatewayOptions updatePublicGatewayOptionsModel = new UpdatePublicGatewayOptions.Builder() + // Construct an instance of the UpdateShareMountTargetOptions model + UpdateShareMountTargetOptions updateShareMountTargetOptionsModel = new UpdateShareMountTargetOptions.Builder() + .shareId("testString") .id("testString") - .publicGatewayPatch(publicGatewayPatchModelAsPatch) + .shareMountTargetPatch(shareMountTargetPatchModelAsPatch) .build(); - // Invoke updatePublicGateway() with a valid options model and verify the result - Response response = vpcService.updatePublicGateway(updatePublicGatewayOptionsModel).execute(); + // Invoke updateShareMountTarget() with a valid options model and verify the result + Response response = vpcService.updateShareMountTarget(updateShareMountTargetOptionsModel).execute(); assertNotNull(response); - PublicGateway responseObj = response.getResult(); + ShareMountTarget responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -23574,58 +24808,56 @@ public void testUpdatePublicGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updatePublicGatewayPath); + assertEquals(parsedPath, updateShareMountTargetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updatePublicGateway operation with and without retries enabled + // Test the updateShareMountTarget operation with and without retries enabled @Test - public void testUpdatePublicGatewayWRetries() throws Throwable { + public void testUpdateShareMountTargetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdatePublicGatewayWOptions(); + testUpdateShareMountTargetWOptions(); vpcService.disableRetries(); - testUpdatePublicGatewayWOptions(); + testUpdateShareMountTargetWOptions(); } - // Test the updatePublicGateway operation with a null options model (negative test) + // Test the updateShareMountTarget operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdatePublicGatewayNoOptions() throws Throwable { + public void testUpdateShareMountTargetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updatePublicGateway(null).execute(); + vpcService.updateShareMountTarget(null).execute(); } - // Test the listFloatingIps operation with a valid options model parameter + // Test the listShareSnapshots operation with a valid options model parameter @Test - public void testListFloatingIpsWOptions() throws Throwable { + public void testListShareSnapshotsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listFloatingIpsPath = "/floating_ips"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"snapshots\": [{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String listShareSnapshotsPath = "/shares/testString/snapshots"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListFloatingIpsOptions model - ListFloatingIpsOptions listFloatingIpsOptionsModel = new ListFloatingIpsOptions.Builder() + // Construct an instance of the ListShareSnapshotsOptions model + ListShareSnapshotsOptions listShareSnapshotsOptionsModel = new ListShareSnapshotsOptions.Builder() + .shareId("testString") + .backupPolicyPlanId("testString") + .name("my-name") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); - // Invoke listFloatingIps() with a valid options model and verify the result - Response response = vpcService.listFloatingIps(listFloatingIpsOptionsModel).execute(); + // Invoke listShareSnapshots() with a valid options model and verify the result + Response response = vpcService.listShareSnapshots(listShareSnapshotsOptionsModel).execute(); assertNotNull(response); - FloatingIPCollection responseObj = response.getResult(); + ShareSnapshotCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -23634,38 +24866,42 @@ public void testListFloatingIpsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listFloatingIpsPath); + assertEquals(parsedPath, listShareSnapshotsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("backup_policy_plan.id"), "testString"); + assertEquals(query.get("name"), "my-name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); assertEquals(query.get("sort"), "name"); - assertEquals(query.get("target.id"), "testString"); - assertEquals(query.get("target.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"); - assertEquals(query.get("target.name"), "my-resource"); - assertEquals(query.get("target.resource_type"), "testString"); } - // Test the listFloatingIps operation with and without retries enabled + // Test the listShareSnapshots operation with and without retries enabled @Test - public void testListFloatingIpsWRetries() throws Throwable { + public void testListShareSnapshotsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListFloatingIpsWOptions(); + testListShareSnapshotsWOptions(); vpcService.disableRetries(); - testListFloatingIpsWOptions(); + testListShareSnapshotsWOptions(); } - // Test the listFloatingIps operation using the FloatingIpsPager.getNext() method + // Test the listShareSnapshots operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListShareSnapshotsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listShareSnapshots(null).execute(); + } + + // Test the listShareSnapshots operation using the ShareSnapshotsPager.getNext() method @Test - public void testListFloatingIpsWithPagerGetNext() throws Throwable { + public void testListShareSnapshotsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage1 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"fingerprint\":\"7abc3aef-c2bc-4f65-a296-2928e534d498\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"minimum_size\":10,\"name\":\"my-share-snapshot\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share_snapshot\",\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"fingerprint\":\"7abc3aef-c2bc-4f65-a296-2928e534d498\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"minimum_size\":10,\"name\":\"my-share-snapshot\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share_snapshot\",\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -23679,32 +24915,30 @@ public void testListFloatingIpsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() + ListShareSnapshotsOptions listShareSnapshotsOptions = new ListShareSnapshotsOptions.Builder() + .shareId("testString") + .backupPolicyPlanId("testString") + .name("my-name") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); - List allResults = new ArrayList<>(); - FloatingIpsPager pager = new FloatingIpsPager(vpcService, listFloatingIpsOptions); + List allResults = new ArrayList<>(); + ShareSnapshotsPager pager = new ShareSnapshotsPager(vpcService, listShareSnapshotsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listFloatingIps operation using the FloatingIpsPager.getAll() method + // Test the listShareSnapshots operation using the ShareSnapshotsPager.getAll() method @Test - public void testListFloatingIpsWithPagerGetAll() throws Throwable { + public void testListShareSnapshotsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"status\":\"available\",\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"resource_type\":\"network_interface\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage1 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"fingerprint\":\"7abc3aef-c2bc-4f65-a296-2928e534d498\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"minimum_size\":10,\"name\":\"my-share-snapshot\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share_snapshot\",\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"snapshots\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"fingerprint\":\"7abc3aef-c2bc-4f65-a296-2928e534d498\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"id\":\"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"minimum_size\":10,\"name\":\"my-share-snapshot\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"share_snapshot\",\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"user_tags\":[\"userTags\"],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -23718,285 +24952,376 @@ public void testListFloatingIpsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListFloatingIpsOptions listFloatingIpsOptions = new ListFloatingIpsOptions.Builder() + ListShareSnapshotsOptions listShareSnapshotsOptions = new ListShareSnapshotsOptions.Builder() + .shareId("testString") + .backupPolicyPlanId("testString") + .name("my-name") .limit(Long.valueOf("10")) - .resourceGroupId("testString") .sort("name") - .targetId("testString") - .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") - .targetName("my-resource") - .targetResourceType("testString") .build(); - FloatingIpsPager pager = new FloatingIpsPager(vpcService, listFloatingIpsOptions); - List allResults = pager.getAll(); + ShareSnapshotsPager pager = new ShareSnapshotsPager(vpcService, listShareSnapshotsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - - // Test the createFloatingIp operation with a valid options model parameter + + // Test the createShareSnapshot operation with a valid options model parameter + @Test + public void testCreateShareSnapshotWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createShareSnapshotPath = "/shares/testString/snapshots"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the CreateShareSnapshotOptions model + CreateShareSnapshotOptions createShareSnapshotOptionsModel = new CreateShareSnapshotOptions.Builder() + .shareId("testString") + .name("my-share-snapshot") + .userTags(java.util.Arrays.asList("testString")) + .build(); + + // Invoke createShareSnapshot() with a valid options model and verify the result + Response response = vpcService.createShareSnapshot(createShareSnapshotOptionsModel).execute(); + assertNotNull(response); + ShareSnapshot responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createShareSnapshotPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createShareSnapshot operation with and without retries enabled + @Test + public void testCreateShareSnapshotWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateShareSnapshotWOptions(); + + vpcService.disableRetries(); + testCreateShareSnapshotWOptions(); + } + + // Test the createShareSnapshot operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateShareSnapshotNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createShareSnapshot(null).execute(); + } + + // Test the deleteShareSnapshot operation with a valid options model parameter + @Test + public void testDeleteShareSnapshotWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String deleteShareSnapshotPath = "/shares/testString/snapshots/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteShareSnapshotOptions model + DeleteShareSnapshotOptions deleteShareSnapshotOptionsModel = new DeleteShareSnapshotOptions.Builder() + .shareId("testString") + .id("testString") + .build(); + + // Invoke deleteShareSnapshot() with a valid options model and verify the result + Response response = vpcService.deleteShareSnapshot(deleteShareSnapshotOptionsModel).execute(); + assertNotNull(response); + ShareSnapshot responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "DELETE"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, deleteShareSnapshotPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the deleteShareSnapshot operation with and without retries enabled + @Test + public void testDeleteShareSnapshotWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testDeleteShareSnapshotWOptions(); + + vpcService.disableRetries(); + testDeleteShareSnapshotWOptions(); + } + + // Test the deleteShareSnapshot operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteShareSnapshotNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.deleteShareSnapshot(null).execute(); + } + + // Test the getShareSnapshot operation with a valid options model parameter @Test - public void testCreateFloatingIpWOptions() throws Throwable { + public void testGetShareSnapshotWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String createFloatingIpPath = "/floating_ips"; + String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getShareSnapshotPath = "/shares/testString/snapshots/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model - FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById floatingIpTargetPrototypeModel = new FloatingIPTargetPrototypeBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.Builder() - .id("0717-54eb57ee-86f2-4796-90bb-d7874e0831ef") - .build(); - - // Construct an instance of the FloatingIPPrototypeFloatingIPByTarget model - FloatingIPPrototypeFloatingIPByTarget floatingIpPrototypeModel = new FloatingIPPrototypeFloatingIPByTarget.Builder() - .name("my-floating-ip") - .resourceGroup(resourceGroupIdentityModel) - .target(floatingIpTargetPrototypeModel) - .build(); - - // Construct an instance of the CreateFloatingIpOptions model - CreateFloatingIpOptions createFloatingIpOptionsModel = new CreateFloatingIpOptions.Builder() - .floatingIpPrototype(floatingIpPrototypeModel) + // Construct an instance of the GetShareSnapshotOptions model + GetShareSnapshotOptions getShareSnapshotOptionsModel = new GetShareSnapshotOptions.Builder() + .shareId("testString") + .id("testString") .build(); - // Invoke createFloatingIp() with a valid options model and verify the result - Response response = vpcService.createFloatingIp(createFloatingIpOptionsModel).execute(); + // Invoke getShareSnapshot() with a valid options model and verify the result + Response response = vpcService.getShareSnapshot(getShareSnapshotOptionsModel).execute(); assertNotNull(response); - FloatingIP responseObj = response.getResult(); + ShareSnapshot responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createFloatingIpPath); + assertEquals(parsedPath, getShareSnapshotPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createFloatingIp operation with and without retries enabled + // Test the getShareSnapshot operation with and without retries enabled @Test - public void testCreateFloatingIpWRetries() throws Throwable { + public void testGetShareSnapshotWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateFloatingIpWOptions(); + testGetShareSnapshotWOptions(); vpcService.disableRetries(); - testCreateFloatingIpWOptions(); + testGetShareSnapshotWOptions(); } - // Test the createFloatingIp operation with a null options model (negative test) + // Test the getShareSnapshot operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateFloatingIpNoOptions() throws Throwable { + public void testGetShareSnapshotNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createFloatingIp(null).execute(); + vpcService.getShareSnapshot(null).execute(); } - // Test the deleteFloatingIp operation with a valid options model parameter + // Test the updateShareSnapshot operation with a valid options model parameter @Test - public void testDeleteFloatingIpWOptions() throws Throwable { + public void testUpdateShareSnapshotWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteFloatingIpPath = "/floating_ips/testString"; + String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share-snapshot:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"fingerprint\": \"7abc3aef-c2bc-4f65-a296-2928e534d498\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"id\": \"r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"minimum_size\": 10, \"name\": \"my-share-snapshot\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"share_snapshot\", \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"user_tags\": [\"userTags\"], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateShareSnapshotPath = "/shares/testString/snapshots/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteFloatingIpOptions model - DeleteFloatingIpOptions deleteFloatingIpOptionsModel = new DeleteFloatingIpOptions.Builder() + // Construct an instance of the ShareSnapshotPatch model + ShareSnapshotPatch shareSnapshotPatchModel = new ShareSnapshotPatch.Builder() + .name("my-share-snapshot") + .userTags(java.util.Arrays.asList("testString")) + .build(); + Map shareSnapshotPatchModelAsPatch = shareSnapshotPatchModel.asPatch(); + + // Construct an instance of the UpdateShareSnapshotOptions model + UpdateShareSnapshotOptions updateShareSnapshotOptionsModel = new UpdateShareSnapshotOptions.Builder() + .shareId("testString") .id("testString") + .shareSnapshotPatch(shareSnapshotPatchModelAsPatch) + .ifMatch("W/96d225c4-56bd-43d9-98fc-d7148e5c5028") .build(); - // Invoke deleteFloatingIp() with a valid options model and verify the result - Response response = vpcService.deleteFloatingIp(deleteFloatingIpOptionsModel).execute(); + // Invoke updateShareSnapshot() with a valid options model and verify the result + Response response = vpcService.updateShareSnapshot(updateShareSnapshotOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ShareSnapshot responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteFloatingIpPath); + assertEquals(parsedPath, updateShareSnapshotPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteFloatingIp operation with and without retries enabled + // Test the updateShareSnapshot operation with and without retries enabled @Test - public void testDeleteFloatingIpWRetries() throws Throwable { + public void testUpdateShareSnapshotWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteFloatingIpWOptions(); + testUpdateShareSnapshotWOptions(); vpcService.disableRetries(); - testDeleteFloatingIpWOptions(); + testUpdateShareSnapshotWOptions(); } - // Test the deleteFloatingIp operation with a null options model (negative test) + // Test the updateShareSnapshot operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteFloatingIpNoOptions() throws Throwable { + public void testUpdateShareSnapshotNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteFloatingIp(null).execute(); + vpcService.updateShareSnapshot(null).execute(); } - // Test the getFloatingIp operation with a valid options model parameter + // Test the deleteShareSource operation with a valid options model parameter @Test - public void testGetFloatingIpWOptions() throws Throwable { + public void testDeleteShareSourceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String getFloatingIpPath = "/floating_ips/testString"; + String mockResponseBody = ""; + String deleteShareSourcePath = "/shares/testString/source"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the GetFloatingIpOptions model - GetFloatingIpOptions getFloatingIpOptionsModel = new GetFloatingIpOptions.Builder() - .id("testString") + // Construct an instance of the DeleteShareSourceOptions model + DeleteShareSourceOptions deleteShareSourceOptionsModel = new DeleteShareSourceOptions.Builder() + .shareId("testString") .build(); - // Invoke getFloatingIp() with a valid options model and verify the result - Response response = vpcService.getFloatingIp(getFloatingIpOptionsModel).execute(); + // Invoke deleteShareSource() with a valid options model and verify the result + Response response = vpcService.deleteShareSource(deleteShareSourceOptionsModel).execute(); assertNotNull(response); - FloatingIP responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getFloatingIpPath); + assertEquals(parsedPath, deleteShareSourcePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getFloatingIp operation with and without retries enabled + // Test the deleteShareSource operation with and without retries enabled @Test - public void testGetFloatingIpWRetries() throws Throwable { + public void testDeleteShareSourceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetFloatingIpWOptions(); + testDeleteShareSourceWOptions(); vpcService.disableRetries(); - testGetFloatingIpWOptions(); + testDeleteShareSourceWOptions(); } - // Test the getFloatingIp operation with a null options model (negative test) + // Test the deleteShareSource operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetFloatingIpNoOptions() throws Throwable { + public void testDeleteShareSourceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getFloatingIp(null).execute(); + vpcService.deleteShareSource(null).execute(); } - // Test the updateFloatingIp operation with a valid options model parameter + // Test the getShareSource operation with a valid options model parameter @Test - public void testUpdateFloatingIpWOptions() throws Throwable { + public void testGetShareSourceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"203.0.113.1\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"status\": \"available\", \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"resource_type\": \"network_interface\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; - String updateFloatingIpPath = "/floating_ips/testString"; + String mockResponseBody = "{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::share:r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"id\": \"r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58\", \"name\": \"my-share\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"share\"}"; + String getShareSourcePath = "/shares/testString/source"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById model - FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById floatingIpTargetPatchModel = new FloatingIPTargetPatchBareMetalServerNetworkInterfaceIdentityBareMetalServerNetworkInterfaceIdentityById.Builder() - .id("0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6") - .build(); - - // Construct an instance of the FloatingIPPatch model - FloatingIPPatch floatingIpPatchModel = new FloatingIPPatch.Builder() - .name("my-floating-ip") - .target(floatingIpTargetPatchModel) - .build(); - Map floatingIpPatchModelAsPatch = floatingIpPatchModel.asPatch(); - - // Construct an instance of the UpdateFloatingIpOptions model - UpdateFloatingIpOptions updateFloatingIpOptionsModel = new UpdateFloatingIpOptions.Builder() - .id("testString") - .floatingIpPatch(floatingIpPatchModelAsPatch) + // Construct an instance of the GetShareSourceOptions model + GetShareSourceOptions getShareSourceOptionsModel = new GetShareSourceOptions.Builder() + .shareId("testString") .build(); - // Invoke updateFloatingIp() with a valid options model and verify the result - Response response = vpcService.updateFloatingIp(updateFloatingIpOptionsModel).execute(); + // Invoke getShareSource() with a valid options model and verify the result + Response response = vpcService.getShareSource(getShareSourceOptionsModel).execute(); assertNotNull(response); - FloatingIP responseObj = response.getResult(); + ShareReference responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateFloatingIpPath); + assertEquals(parsedPath, getShareSourcePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateFloatingIp operation with and without retries enabled + // Test the getShareSource operation with and without retries enabled @Test - public void testUpdateFloatingIpWRetries() throws Throwable { + public void testGetShareSourceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateFloatingIpWOptions(); + testGetShareSourceWOptions(); vpcService.disableRetries(); - testUpdateFloatingIpWOptions(); + testGetShareSourceWOptions(); } - // Test the updateFloatingIp operation with a null options model (negative test) + // Test the getShareSource operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateFloatingIpNoOptions() throws Throwable { + public void testGetShareSourceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateFloatingIp(null).execute(); + vpcService.getShareSource(null).execute(); } - // Test the listPublicAddressRanges operation with a valid options model parameter + // Test the listSnapshotConsistencyGroups operation with a valid options model parameter @Test - public void testListPublicAddressRangesWOptions() throws Throwable { + public void testListSnapshotConsistencyGroupsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"public_address_ranges\": [{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}], \"total_count\": 132}"; - String listPublicAddressRangesPath = "/public_address_ranges"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"snapshot_consistency_groups\": [{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}], \"total_count\": 132}"; + String listSnapshotConsistencyGroupsPath = "/snapshot_consistency_groups"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListPublicAddressRangesOptions model - ListPublicAddressRangesOptions listPublicAddressRangesOptionsModel = new ListPublicAddressRangesOptions.Builder() + // Construct an instance of the ListSnapshotConsistencyGroupsOptions model + ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptionsModel = new ListSnapshotConsistencyGroupsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .name("my-name") + .sort("name") + .backupPolicyPlanId("testString") .build(); - // Invoke listPublicAddressRanges() with a valid options model and verify the result - Response response = vpcService.listPublicAddressRanges(listPublicAddressRangesOptionsModel).execute(); + // Invoke listSnapshotConsistencyGroups() with a valid options model and verify the result + Response response = vpcService.listSnapshotConsistencyGroups(listSnapshotConsistencyGroupsOptionsModel).execute(); assertNotNull(response); - PublicAddressRangeCollection responseObj = response.getResult(); + SnapshotConsistencyGroupCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24005,33 +25330,36 @@ public void testListPublicAddressRangesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listPublicAddressRangesPath); + assertEquals(parsedPath, listSnapshotConsistencyGroupsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("sort"), "name"); + assertEquals(query.get("backup_policy_plan.id"), "testString"); } - // Test the listPublicAddressRanges operation with and without retries enabled + // Test the listSnapshotConsistencyGroups operation with and without retries enabled @Test - public void testListPublicAddressRangesWRetries() throws Throwable { + public void testListSnapshotConsistencyGroupsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListPublicAddressRangesWOptions(); + testListSnapshotConsistencyGroupsWOptions(); vpcService.disableRetries(); - testListPublicAddressRangesWOptions(); + testListSnapshotConsistencyGroupsWOptions(); } - // Test the listPublicAddressRanges operation using the PublicAddressRangesPager.getNext() method + // Test the listSnapshotConsistencyGroups operation using the SnapshotConsistencyGroupsPager.getNext() method @Test - public void testListPublicAddressRangesWithPagerGetNext() throws Throwable { + public void testListSnapshotConsistencyGroupsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_address_ranges\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"ipv4_address_count\":8,\"lifecycle_state\":\"stable\",\"name\":\"my-public-address-range\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_address_range\",\"target\":{\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_address_ranges\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"ipv4_address_count\":8,\"lifecycle_state\":\"stable\",\"name\":\"my-public-address-range\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_address_range\",\"target\":{\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"snapshot_consistency_groups\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"delete_snapshots_on_delete\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"name\":\"my-snapshot-consistency-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot_consistency_group\",\"service_tags\":[\"serviceTags\"],\"snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"snapshot_consistency_groups\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"delete_snapshots_on_delete\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"name\":\"my-snapshot-consistency-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot_consistency_group\",\"service_tags\":[\"serviceTags\"],\"snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -24045,27 +25373,30 @@ public void testListPublicAddressRangesWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPublicAddressRangesOptions listPublicAddressRangesOptions = new ListPublicAddressRangesOptions.Builder() + ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptions = new ListSnapshotConsistencyGroupsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") + .name("my-name") + .sort("name") + .backupPolicyPlanId("testString") .build(); - List allResults = new ArrayList<>(); - PublicAddressRangesPager pager = new PublicAddressRangesPager(vpcService, listPublicAddressRangesOptions); + List allResults = new ArrayList<>(); + SnapshotConsistencyGroupsPager pager = new SnapshotConsistencyGroupsPager(vpcService, listSnapshotConsistencyGroupsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listPublicAddressRanges operation using the PublicAddressRangesPager.getAll() method + // Test the listSnapshotConsistencyGroups operation using the SnapshotConsistencyGroupsPager.getAll() method @Test - public void testListPublicAddressRangesWithPagerGetAll() throws Throwable { + public void testListSnapshotConsistencyGroupsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"public_address_ranges\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"ipv4_address_count\":8,\"lifecycle_state\":\"stable\",\"name\":\"my-public-address-range\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_address_range\",\"target\":{\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"public_address_ranges\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"ipv4_address_count\":8,\"lifecycle_state\":\"stable\",\"name\":\"my-public-address-range\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"public_address_range\",\"target\":{\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"snapshot_consistency_groups\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"delete_snapshots_on_delete\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"name\":\"my-snapshot-consistency-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot_consistency_group\",\"service_tags\":[\"serviceTags\"],\"snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"snapshot_consistency_groups\":[{\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"delete_snapshots_on_delete\":false,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"name\":\"my-snapshot-consistency-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot_consistency_group\",\"service_tags\":[\"serviceTags\"],\"snapshots\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}]}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -24079,23 +25410,26 @@ public void testListPublicAddressRangesWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPublicAddressRangesOptions listPublicAddressRangesOptions = new ListPublicAddressRangesOptions.Builder() + ListSnapshotConsistencyGroupsOptions listSnapshotConsistencyGroupsOptions = new ListSnapshotConsistencyGroupsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") + .name("my-name") + .sort("name") + .backupPolicyPlanId("testString") .build(); - PublicAddressRangesPager pager = new PublicAddressRangesPager(vpcService, listPublicAddressRangesOptions); - List allResults = pager.getAll(); + SnapshotConsistencyGroupsPager pager = new SnapshotConsistencyGroupsPager(vpcService, listSnapshotConsistencyGroupsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createPublicAddressRange operation with a valid options model parameter + // Test the createSnapshotConsistencyGroup operation with a valid options model parameter @Test - public void testCreatePublicAddressRangeWOptions() throws Throwable { + public void testCreateSnapshotConsistencyGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}"; - String createPublicAddressRangePath = "/public_address_ranges"; + String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; + String createSnapshotConsistencyGroupPath = "/snapshot_consistency_groups"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) @@ -24106,34 +25440,35 @@ public void testCreatePublicAddressRangeWOptions() throws Throwable { .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + // Construct an instance of the VolumeIdentityById model + VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() + .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the SnapshotPrototypeSnapshotConsistencyGroupContext model + SnapshotPrototypeSnapshotConsistencyGroupContext snapshotPrototypeSnapshotConsistencyGroupContextModel = new SnapshotPrototypeSnapshotConsistencyGroupContext.Builder() + .name("my-snapshot") + .sourceVolume(volumeIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); - // Construct an instance of the PublicAddressRangeTargetPrototype model - PublicAddressRangeTargetPrototype publicAddressRangeTargetPrototypeModel = new PublicAddressRangeTargetPrototype.Builder() - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) + // Construct an instance of the SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots model + SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots snapshotConsistencyGroupPrototypeModel = new SnapshotConsistencyGroupPrototypeSnapshotConsistencyGroupBySnapshots.Builder() + .deleteSnapshotsOnDelete(true) + .name("my-snapshot-consistency-group") + .resourceGroup(resourceGroupIdentityModel) + .snapshots(java.util.Arrays.asList(snapshotPrototypeSnapshotConsistencyGroupContextModel)) .build(); - // Construct an instance of the CreatePublicAddressRangeOptions model - CreatePublicAddressRangeOptions createPublicAddressRangeOptionsModel = new CreatePublicAddressRangeOptions.Builder() - .ipv4AddressCount(Long.valueOf("8")) - .name("my-public-address-range") - .resourceGroup(resourceGroupIdentityModel) - .target(publicAddressRangeTargetPrototypeModel) + // Construct an instance of the CreateSnapshotConsistencyGroupOptions model + CreateSnapshotConsistencyGroupOptions createSnapshotConsistencyGroupOptionsModel = new CreateSnapshotConsistencyGroupOptions.Builder() + .snapshotConsistencyGroupPrototype(snapshotConsistencyGroupPrototypeModel) .build(); - // Invoke createPublicAddressRange() with a valid options model and verify the result - Response response = vpcService.createPublicAddressRange(createPublicAddressRangeOptionsModel).execute(); + // Invoke createSnapshotConsistencyGroup() with a valid options model and verify the result + Response response = vpcService.createSnapshotConsistencyGroup(createSnapshotConsistencyGroupOptionsModel).execute(); assertNotNull(response); - PublicAddressRange responseObj = response.getResult(); + SnapshotConsistencyGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24142,51 +25477,51 @@ public void testCreatePublicAddressRangeWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createPublicAddressRangePath); + assertEquals(parsedPath, createSnapshotConsistencyGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createPublicAddressRange operation with and without retries enabled + // Test the createSnapshotConsistencyGroup operation with and without retries enabled @Test - public void testCreatePublicAddressRangeWRetries() throws Throwable { + public void testCreateSnapshotConsistencyGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreatePublicAddressRangeWOptions(); + testCreateSnapshotConsistencyGroupWOptions(); vpcService.disableRetries(); - testCreatePublicAddressRangeWOptions(); + testCreateSnapshotConsistencyGroupWOptions(); } - // Test the createPublicAddressRange operation with a null options model (negative test) + // Test the createSnapshotConsistencyGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreatePublicAddressRangeNoOptions() throws Throwable { + public void testCreateSnapshotConsistencyGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createPublicAddressRange(null).execute(); + vpcService.createSnapshotConsistencyGroup(null).execute(); } - // Test the deletePublicAddressRange operation with a valid options model parameter + // Test the deleteSnapshotConsistencyGroup operation with a valid options model parameter @Test - public void testDeletePublicAddressRangeWOptions() throws Throwable { + public void testDeleteSnapshotConsistencyGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}"; - String deletePublicAddressRangePath = "/public_address_ranges/testString"; + String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; + String deleteSnapshotConsistencyGroupPath = "/snapshot_consistency_groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeletePublicAddressRangeOptions model - DeletePublicAddressRangeOptions deletePublicAddressRangeOptionsModel = new DeletePublicAddressRangeOptions.Builder() + // Construct an instance of the DeleteSnapshotConsistencyGroupOptions model + DeleteSnapshotConsistencyGroupOptions deleteSnapshotConsistencyGroupOptionsModel = new DeleteSnapshotConsistencyGroupOptions.Builder() .id("testString") .build(); - // Invoke deletePublicAddressRange() with a valid options model and verify the result - Response response = vpcService.deletePublicAddressRange(deletePublicAddressRangeOptionsModel).execute(); + // Invoke deleteSnapshotConsistencyGroup() with a valid options model and verify the result + Response response = vpcService.deleteSnapshotConsistencyGroup(deleteSnapshotConsistencyGroupOptionsModel).execute(); assertNotNull(response); - PublicAddressRange responseObj = response.getResult(); + SnapshotConsistencyGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24195,51 +25530,51 @@ public void testDeletePublicAddressRangeWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deletePublicAddressRangePath); + assertEquals(parsedPath, deleteSnapshotConsistencyGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deletePublicAddressRange operation with and without retries enabled + // Test the deleteSnapshotConsistencyGroup operation with and without retries enabled @Test - public void testDeletePublicAddressRangeWRetries() throws Throwable { + public void testDeleteSnapshotConsistencyGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeletePublicAddressRangeWOptions(); + testDeleteSnapshotConsistencyGroupWOptions(); vpcService.disableRetries(); - testDeletePublicAddressRangeWOptions(); + testDeleteSnapshotConsistencyGroupWOptions(); } - // Test the deletePublicAddressRange operation with a null options model (negative test) + // Test the deleteSnapshotConsistencyGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeletePublicAddressRangeNoOptions() throws Throwable { + public void testDeleteSnapshotConsistencyGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deletePublicAddressRange(null).execute(); + vpcService.deleteSnapshotConsistencyGroup(null).execute(); } - // Test the getPublicAddressRange operation with a valid options model parameter + // Test the getSnapshotConsistencyGroup operation with a valid options model parameter @Test - public void testGetPublicAddressRangeWOptions() throws Throwable { + public void testGetSnapshotConsistencyGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}"; - String getPublicAddressRangePath = "/public_address_ranges/testString"; + String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; + String getSnapshotConsistencyGroupPath = "/snapshot_consistency_groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetPublicAddressRangeOptions model - GetPublicAddressRangeOptions getPublicAddressRangeOptionsModel = new GetPublicAddressRangeOptions.Builder() + // Construct an instance of the GetSnapshotConsistencyGroupOptions model + GetSnapshotConsistencyGroupOptions getSnapshotConsistencyGroupOptionsModel = new GetSnapshotConsistencyGroupOptions.Builder() .id("testString") .build(); - // Invoke getPublicAddressRange() with a valid options model and verify the result - Response response = vpcService.getPublicAddressRange(getPublicAddressRangeOptionsModel).execute(); + // Invoke getSnapshotConsistencyGroup() with a valid options model and verify the result + Response response = vpcService.getSnapshotConsistencyGroup(getSnapshotConsistencyGroupOptionsModel).execute(); assertNotNull(response); - PublicAddressRange responseObj = response.getResult(); + SnapshotConsistencyGroup responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24248,130 +25583,187 @@ public void testGetPublicAddressRangeWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getPublicAddressRangePath); + assertEquals(parsedPath, getSnapshotConsistencyGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getPublicAddressRange operation with and without retries enabled + // Test the getSnapshotConsistencyGroup operation with and without retries enabled @Test - public void testGetPublicAddressRangeWRetries() throws Throwable { + public void testGetSnapshotConsistencyGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetPublicAddressRangeWOptions(); + testGetSnapshotConsistencyGroupWOptions(); vpcService.disableRetries(); - testGetPublicAddressRangeWOptions(); + testGetSnapshotConsistencyGroupWOptions(); } - // Test the getPublicAddressRange operation with a null options model (negative test) + // Test the getSnapshotConsistencyGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetPublicAddressRangeNoOptions() throws Throwable { + public void testGetSnapshotConsistencyGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getPublicAddressRange(null).execute(); + vpcService.getSnapshotConsistencyGroup(null).execute(); } - // Test the updatePublicAddressRange operation with a valid options model parameter + // Test the updateSnapshotConsistencyGroup operation with a valid options model parameter @Test - public void testUpdatePublicAddressRangeWOptions() throws Throwable { + public void testUpdateSnapshotConsistencyGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"ipv4_address_count\": 8, \"lifecycle_state\": \"stable\", \"name\": \"my-public-address-range\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_address_range\", \"target\": {\"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}}"; - String updatePublicAddressRangePath = "/public_address_ranges/testString"; + String mockResponseBody = "{\"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"delete_snapshots_on_delete\": false, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"name\": \"my-snapshot-consistency-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot_consistency_group\", \"service_tags\": [\"serviceTags\"], \"snapshots\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}]}"; + String updateSnapshotConsistencyGroupPath = "/snapshot_consistency_groups/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + // Construct an instance of the SnapshotConsistencyGroupPatch model + SnapshotConsistencyGroupPatch snapshotConsistencyGroupPatchModel = new SnapshotConsistencyGroupPatch.Builder() + .deleteSnapshotsOnDelete(false) + .name("my-snapshot-consistency-group") .build(); + Map snapshotConsistencyGroupPatchModelAsPatch = snapshotConsistencyGroupPatchModel.asPatch(); - // Construct an instance of the ZoneIdentityByName model - ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() - .name("us-south-1") + // Construct an instance of the UpdateSnapshotConsistencyGroupOptions model + UpdateSnapshotConsistencyGroupOptions updateSnapshotConsistencyGroupOptionsModel = new UpdateSnapshotConsistencyGroupOptions.Builder() + .id("testString") + .snapshotConsistencyGroupPatch(snapshotConsistencyGroupPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Construct an instance of the PublicAddressRangeTargetPatch model - PublicAddressRangeTargetPatch publicAddressRangeTargetPatchModel = new PublicAddressRangeTargetPatch.Builder() - .vpc(vpcIdentityModel) - .zone(zoneIdentityModel) - .build(); + // Invoke updateSnapshotConsistencyGroup() with a valid options model and verify the result + Response response = vpcService.updateSnapshotConsistencyGroup(updateSnapshotConsistencyGroupOptionsModel).execute(); + assertNotNull(response); + SnapshotConsistencyGroup responseObj = response.getResult(); + assertNotNull(responseObj); - // Construct an instance of the PublicAddressRangePatch model - PublicAddressRangePatch publicAddressRangePatchModel = new PublicAddressRangePatch.Builder() - .name("my-public-address-range-updated") - .target(publicAddressRangeTargetPatchModel) - .build(); - Map publicAddressRangePatchModelAsPatch = publicAddressRangePatchModel.asPatch(); + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateSnapshotConsistencyGroupPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } - // Construct an instance of the UpdatePublicAddressRangeOptions model - UpdatePublicAddressRangeOptions updatePublicAddressRangeOptionsModel = new UpdatePublicAddressRangeOptions.Builder() - .id("testString") - .publicAddressRangePatch(publicAddressRangePatchModelAsPatch) + // Test the updateSnapshotConsistencyGroup operation with and without retries enabled + @Test + public void testUpdateSnapshotConsistencyGroupWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testUpdateSnapshotConsistencyGroupWOptions(); + + vpcService.disableRetries(); + testUpdateSnapshotConsistencyGroupWOptions(); + } + + // Test the updateSnapshotConsistencyGroup operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateSnapshotConsistencyGroupNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateSnapshotConsistencyGroup(null).execute(); + } + + // Test the deleteSnapshots operation with a valid options model parameter + @Test + public void testDeleteSnapshotsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteSnapshotsPath = "/snapshots"; + server.enqueue(new MockResponse() + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteSnapshotsOptions model + DeleteSnapshotsOptions deleteSnapshotsOptionsModel = new DeleteSnapshotsOptions.Builder() + .sourceVolumeId("testString") .build(); - // Invoke updatePublicAddressRange() with a valid options model and verify the result - Response response = vpcService.updatePublicAddressRange(updatePublicAddressRangeOptionsModel).execute(); + // Invoke deleteSnapshots() with a valid options model and verify the result + Response response = vpcService.deleteSnapshots(deleteSnapshotsOptionsModel).execute(); assertNotNull(response); - PublicAddressRange responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updatePublicAddressRangePath); + assertEquals(parsedPath, deleteSnapshotsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("source_volume.id"), "testString"); } - // Test the updatePublicAddressRange operation with and without retries enabled + // Test the deleteSnapshots operation with and without retries enabled @Test - public void testUpdatePublicAddressRangeWRetries() throws Throwable { + public void testDeleteSnapshotsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdatePublicAddressRangeWOptions(); + testDeleteSnapshotsWOptions(); vpcService.disableRetries(); - testUpdatePublicAddressRangeWOptions(); + testDeleteSnapshotsWOptions(); } - // Test the updatePublicAddressRange operation with a null options model (negative test) + // Test the deleteSnapshots operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdatePublicAddressRangeNoOptions() throws Throwable { + public void testDeleteSnapshotsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updatePublicAddressRange(null).execute(); + vpcService.deleteSnapshots(null).execute(); } - // Test the listNetworkAcls operation with a valid options model parameter + // Test the listSnapshots operation with a valid options model parameter @Test - public void testListNetworkAclsWOptions() throws Throwable { + public void testListSnapshotsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"network_acls\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listNetworkAclsPath = "/network_acls"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"snapshots\": [{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"copies\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"progress\": 55, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot\", \"service_tags\": [\"serviceTags\"], \"size\": 1, \"snapshot_consistency_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot-consistency-group\", \"resource_type\": \"snapshot_consistency_group\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"]}], \"total_count\": 132}"; + String listSnapshotsPath = "/snapshots"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListNetworkAclsOptions model - ListNetworkAclsOptions listNetworkAclsOptionsModel = new ListNetworkAclsOptions.Builder() + // Construct an instance of the ListSnapshotsOptions model + ListSnapshotsOptions listSnapshotsOptionsModel = new ListSnapshotsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .tag("testString") .resourceGroupId("testString") + .name("my-name") + .sourceVolumeId("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .sourceImageId("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .sort("name") + .backupPolicyPlanId("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-east") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") + .snapshotConsistencyGroupId("testString") + .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") .build(); - // Invoke listNetworkAcls() with a valid options model and verify the result - Response response = vpcService.listNetworkAcls(listNetworkAclsOptionsModel).execute(); + // Invoke listSnapshots() with a valid options model and verify the result + Response response = vpcService.listSnapshots(listSnapshotsOptionsModel).execute(); assertNotNull(response); - NetworkACLCollection responseObj = response.getResult(); + SnapshotCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24380,33 +25772,52 @@ public void testListNetworkAclsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listNetworkAclsPath); + assertEquals(parsedPath, listSnapshotsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("tag"), "testString"); assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("source_volume.id"), "testString"); + assertEquals(query.get("source_volume.crn"), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); + assertEquals(query.get("source_image.id"), "testString"); + assertEquals(query.get("source_image.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"); + assertEquals(query.get("sort"), "name"); + assertEquals(query.get("backup_policy_plan.id"), "testString"); + assertEquals(query.get("copies[].id"), "testString"); + assertEquals(query.get("copies[].name"), "my-snapshot-copy"); + assertEquals(query.get("copies[].crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); + assertEquals(query.get("copies[].remote.region.name"), "us-south"); + assertEquals(query.get("source_snapshot.id"), "testString"); + assertEquals(query.get("source_snapshot.remote.region.name"), "us-south"); + assertEquals(query.get("source_volume.remote.region.name"), "us-east"); + assertEquals(query.get("source_image.remote.region.name"), "us-south"); + assertEquals(query.get("clones[].zone.name"), "us-south-1"); + assertEquals(query.get("snapshot_consistency_group.id"), "testString"); + assertEquals(query.get("snapshot_consistency_group.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263"); } - // Test the listNetworkAcls operation with and without retries enabled + // Test the listSnapshots operation with and without retries enabled @Test - public void testListNetworkAclsWRetries() throws Throwable { + public void testListSnapshotsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListNetworkAclsWOptions(); + testListSnapshotsWOptions(); vpcService.disableRetries(); - testListNetworkAclsWOptions(); + testListSnapshotsWOptions(); } - // Test the listNetworkAcls operation using the NetworkAclsPager.getNext() method + // Test the listSnapshots operation using the SnapshotsPager.getNext() method @Test - public void testListNetworkAclsWithPagerGetNext() throws Throwable { + public void testListSnapshotsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"all\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"all\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"snapshots\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"clones\":[{\"available\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"copies\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"progress\":55,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"snapshot_consistency_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot-consistency-group\",\"resource_type\":\"snapshot_consistency_group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"]}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"snapshots\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"clones\":[{\"available\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"copies\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"progress\":55,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"snapshot_consistency_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot-consistency-group\",\"resource_type\":\"snapshot_consistency_group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -24420,27 +25831,46 @@ public void testListNetworkAclsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() + ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() .limit(Long.valueOf("10")) + .tag("testString") .resourceGroupId("testString") + .name("my-name") + .sourceVolumeId("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .sourceImageId("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .sort("name") + .backupPolicyPlanId("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-east") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") + .snapshotConsistencyGroupId("testString") + .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") .build(); - List allResults = new ArrayList<>(); - NetworkAclsPager pager = new NetworkAclsPager(vpcService, listNetworkAclsOptions); + List allResults = new ArrayList<>(); + SnapshotsPager pager = new SnapshotsPager(vpcService, listSnapshotsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listNetworkAcls operation using the NetworkAclsPager.getAll() method + // Test the listSnapshots operation using the SnapshotsPager.getAll() method @Test - public void testListNetworkAclsWithPagerGetAll() throws Throwable { + public void testListSnapshotsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"all\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"network_acls\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"all\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"snapshots\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"clones\":[{\"available\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"copies\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"progress\":55,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"snapshot_consistency_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot-consistency-group\",\"resource_type\":\"snapshot_consistency_group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"]}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"snapshots\":[{\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"backup_policy_plan\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"id\":\"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\",\"name\":\"my-policy-plan\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"backup_policy_plan\"},\"bootable\":true,\"captured_at\":\"2019-01-01T12:00:00.000Z\",\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"clones\":[{\"available\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"copies\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deletable\":false,\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"lifecycle_state\":\"stable\",\"minimum_capacity\":1,\"name\":\"my-snapshot\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"progress\":55,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"snapshot\",\"service_tags\":[\"serviceTags\"],\"size\":1,\"snapshot_consistency_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot-consistency-group\",\"resource_type\":\"snapshot_consistency_group\"},\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"source_volume\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"name\":\"my-volume\",\"remote\":{\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"volume\"},\"storage_generation\":1,\"user_tags\":[\"userTags\"]}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -24454,66 +25884,93 @@ public void testListNetworkAclsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListNetworkAclsOptions listNetworkAclsOptions = new ListNetworkAclsOptions.Builder() + ListSnapshotsOptions listSnapshotsOptions = new ListSnapshotsOptions.Builder() .limit(Long.valueOf("10")) + .tag("testString") .resourceGroupId("testString") + .name("my-name") + .sourceVolumeId("testString") + .sourceVolumeCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") + .sourceImageId("testString") + .sourceImageCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") + .sort("name") + .backupPolicyPlanId("testString") + .copiesId("testString") + .copiesName("my-snapshot-copy") + .copiesCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263") + .copiesRemoteRegionName("us-south") + .sourceSnapshotId("testString") + .sourceSnapshotRemoteRegionName("us-south") + .sourceVolumeRemoteRegionName("us-east") + .sourceImageRemoteRegionName("us-south") + .clonesZoneName("us-south-1") + .snapshotConsistencyGroupId("testString") + .snapshotConsistencyGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263") .build(); - NetworkAclsPager pager = new NetworkAclsPager(vpcService, listNetworkAclsOptions); - List allResults = pager.getAll(); + SnapshotsPager pager = new SnapshotsPager(vpcService, listSnapshotsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createNetworkAcl operation with a valid options model parameter + // Test the createSnapshot operation with a valid options model parameter @Test - public void testCreateNetworkAclWOptions() throws Throwable { + public void testCreateSnapshotWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String createNetworkAclPath = "/network_acls"; + String mockResponseBody = "{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"copies\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"progress\": 55, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot\", \"service_tags\": [\"serviceTags\"], \"size\": 1, \"snapshot_consistency_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot-consistency-group\", \"resource_type\": \"snapshot_consistency_group\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"]}"; + String createSnapshotPath = "/snapshots"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); + // Construct an instance of the SnapshotAllowedUsePrototype model + SnapshotAllowedUsePrototype snapshotAllowedUsePrototypeModel = new SnapshotAllowedUsePrototype.Builder() + .apiVersion(version) + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + // Construct an instance of the SnapshotClonePrototype model + SnapshotClonePrototype snapshotClonePrototypeModel = new SnapshotClonePrototype.Builder() + .zone(zoneIdentityModel) + .build(); + // Construct an instance of the ResourceGroupIdentityById model ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .build(); - - // Construct an instance of the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Builder() - .action("allow") - .destination("192.168.3.2/32") - .direction("inbound") - .ipVersion("ipv4") - .name("my-network-acl-rule") - .source("192.168.3.2/32") - .protocol("all") + // Construct an instance of the VolumeIdentityById model + VolumeIdentityById volumeIdentityModel = new VolumeIdentityById.Builder() + .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); - // Construct an instance of the NetworkACLPrototypeNetworkACLByRules model - NetworkACLPrototypeNetworkACLByRules networkAclPrototypeModel = new NetworkACLPrototypeNetworkACLByRules.Builder() - .name("my-network-acl") + // Construct an instance of the SnapshotPrototypeSnapshotBySourceVolume model + SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() + .allowedUse(snapshotAllowedUsePrototypeModel) + .clones(java.util.Arrays.asList(snapshotClonePrototypeModel)) + .name("my-snapshot") .resourceGroup(resourceGroupIdentityModel) - .vpc(vpcIdentityModel) - .rules(java.util.Arrays.asList(networkAclRulePrototypeNetworkAclContextModel)) + .userTags(java.util.Arrays.asList()) + .sourceVolume(volumeIdentityModel) .build(); - // Construct an instance of the CreateNetworkAclOptions model - CreateNetworkAclOptions createNetworkAclOptionsModel = new CreateNetworkAclOptions.Builder() - .networkAclPrototype(networkAclPrototypeModel) + // Construct an instance of the CreateSnapshotOptions model + CreateSnapshotOptions createSnapshotOptionsModel = new CreateSnapshotOptions.Builder() + .snapshotPrototype(snapshotPrototypeModel) .build(); - // Invoke createNetworkAcl() with a valid options model and verify the result - Response response = vpcService.createNetworkAcl(createNetworkAclOptionsModel).execute(); + // Invoke createSnapshot() with a valid options model and verify the result + Response response = vpcService.createSnapshot(createSnapshotOptionsModel).execute(); assertNotNull(response); - NetworkACL responseObj = response.getResult(); + Snapshot responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24522,48 +25979,49 @@ public void testCreateNetworkAclWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createNetworkAclPath); + assertEquals(parsedPath, createSnapshotPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createNetworkAcl operation with and without retries enabled + // Test the createSnapshot operation with and without retries enabled @Test - public void testCreateNetworkAclWRetries() throws Throwable { + public void testCreateSnapshotWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateNetworkAclWOptions(); + testCreateSnapshotWOptions(); vpcService.disableRetries(); - testCreateNetworkAclWOptions(); + testCreateSnapshotWOptions(); } - // Test the createNetworkAcl operation with a null options model (negative test) + // Test the createSnapshot operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateNetworkAclNoOptions() throws Throwable { + public void testCreateSnapshotNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createNetworkAcl(null).execute(); + vpcService.createSnapshot(null).execute(); } - // Test the deleteNetworkAcl operation with a valid options model parameter + // Test the deleteSnapshot operation with a valid options model parameter @Test - public void testDeleteNetworkAclWOptions() throws Throwable { + public void testDeleteSnapshotWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteNetworkAclPath = "/network_acls/testString"; + String deleteSnapshotPath = "/snapshots/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteNetworkAclOptions model - DeleteNetworkAclOptions deleteNetworkAclOptionsModel = new DeleteNetworkAclOptions.Builder() + // Construct an instance of the DeleteSnapshotOptions model + DeleteSnapshotOptions deleteSnapshotOptionsModel = new DeleteSnapshotOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteNetworkAcl() with a valid options model and verify the result - Response response = vpcService.deleteNetworkAcl(deleteNetworkAclOptionsModel).execute(); + // Invoke deleteSnapshot() with a valid options model and verify the result + Response response = vpcService.deleteSnapshot(deleteSnapshotOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -24574,51 +26032,51 @@ public void testDeleteNetworkAclWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteNetworkAclPath); + assertEquals(parsedPath, deleteSnapshotPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteNetworkAcl operation with and without retries enabled + // Test the deleteSnapshot operation with and without retries enabled @Test - public void testDeleteNetworkAclWRetries() throws Throwable { + public void testDeleteSnapshotWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteNetworkAclWOptions(); + testDeleteSnapshotWOptions(); vpcService.disableRetries(); - testDeleteNetworkAclWOptions(); + testDeleteSnapshotWOptions(); } - // Test the deleteNetworkAcl operation with a null options model (negative test) + // Test the deleteSnapshot operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteNetworkAclNoOptions() throws Throwable { + public void testDeleteSnapshotNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteNetworkAcl(null).execute(); + vpcService.deleteSnapshot(null).execute(); } - // Test the getNetworkAcl operation with a valid options model parameter + // Test the getSnapshot operation with a valid options model parameter @Test - public void testGetNetworkAclWOptions() throws Throwable { + public void testGetSnapshotWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getNetworkAclPath = "/network_acls/testString"; + String mockResponseBody = "{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"copies\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"progress\": 55, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot\", \"service_tags\": [\"serviceTags\"], \"size\": 1, \"snapshot_consistency_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot-consistency-group\", \"resource_type\": \"snapshot_consistency_group\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"]}"; + String getSnapshotPath = "/snapshots/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetNetworkAclOptions model - GetNetworkAclOptions getNetworkAclOptionsModel = new GetNetworkAclOptions.Builder() + // Construct an instance of the GetSnapshotOptions model + GetSnapshotOptions getSnapshotOptionsModel = new GetSnapshotOptions.Builder() .id("testString") .build(); - // Invoke getNetworkAcl() with a valid options model and verify the result - Response response = vpcService.getNetworkAcl(getNetworkAclOptionsModel).execute(); + // Invoke getSnapshot() with a valid options model and verify the result + Response response = vpcService.getSnapshot(getSnapshotOptionsModel).execute(); assertNotNull(response); - NetworkACL responseObj = response.getResult(); + Snapshot responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24627,58 +26085,68 @@ public void testGetNetworkAclWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getNetworkAclPath); + assertEquals(parsedPath, getSnapshotPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getNetworkAcl operation with and without retries enabled + // Test the getSnapshot operation with and without retries enabled @Test - public void testGetNetworkAclWRetries() throws Throwable { + public void testGetSnapshotWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetNetworkAclWOptions(); + testGetSnapshotWOptions(); vpcService.disableRetries(); - testGetNetworkAclWOptions(); + testGetSnapshotWOptions(); } - // Test the getNetworkAcl operation with a null options model (negative test) + // Test the getSnapshot operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetNetworkAclNoOptions() throws Throwable { + public void testGetSnapshotNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getNetworkAcl(null).execute(); + vpcService.getSnapshot(null).execute(); } - // Test the updateNetworkAcl operation with a valid options model parameter + // Test the updateSnapshot operation with a valid options model parameter @Test - public void testUpdateNetworkAclWOptions() throws Throwable { + public void testUpdateSnapshotWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String updateNetworkAclPath = "/network_acls/testString"; + String mockResponseBody = "{\"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"backup_policy_plan\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/backup_policies/r006-076191ba-49c2-4763-94fd-c70de73ee2e6/plans/r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"id\": \"r006-6da51cfe-6f7b-4638-a6ba-00e9c327b178\", \"name\": \"my-policy-plan\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"backup_policy_plan\"}, \"bootable\": true, \"captured_at\": \"2019-01-01T12:00:00.000Z\", \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"copies\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deletable\": false, \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"lifecycle_state\": \"stable\", \"minimum_capacity\": 1, \"name\": \"my-snapshot\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"progress\": 55, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"snapshot\", \"service_tags\": [\"serviceTags\"], \"size\": 1, \"snapshot_consistency_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot-consistency-group:r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-fa329f6b-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot-consistency-group\", \"resource_type\": \"snapshot_consistency_group\"}, \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"source_volume\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"name\": \"my-volume\", \"remote\": {\"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"volume\"}, \"storage_generation\": 1, \"user_tags\": [\"userTags\"]}"; + String updateSnapshotPath = "/snapshots/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the NetworkACLPatch model - NetworkACLPatch networkAclPatchModel = new NetworkACLPatch.Builder() - .name("my-network-acl-updated") + // Construct an instance of the SnapshotAllowedUsePatch model + SnapshotAllowedUsePatch snapshotAllowedUsePatchModel = new SnapshotAllowedUsePatch.Builder() + .apiVersion(version) + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - Map networkAclPatchModelAsPatch = networkAclPatchModel.asPatch(); - // Construct an instance of the UpdateNetworkAclOptions model - UpdateNetworkAclOptions updateNetworkAclOptionsModel = new UpdateNetworkAclOptions.Builder() + // Construct an instance of the SnapshotPatch model + SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() + .allowedUse(snapshotAllowedUsePatchModel) + .name("my-snapshot-updated") + .userTags(java.util.Arrays.asList("testString")) + .build(); + Map snapshotPatchModelAsPatch = snapshotPatchModel.asPatch(); + + // Construct an instance of the UpdateSnapshotOptions model + UpdateSnapshotOptions updateSnapshotOptionsModel = new UpdateSnapshotOptions.Builder() .id("testString") - .networkAclPatch(networkAclPatchModelAsPatch) + .snapshotPatch(snapshotPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateNetworkAcl() with a valid options model and verify the result - Response response = vpcService.updateNetworkAcl(updateNetworkAclOptionsModel).execute(); + // Invoke updateSnapshot() with a valid options model and verify the result + Response response = vpcService.updateSnapshot(updateSnapshotOptionsModel).execute(); assertNotNull(response); - NetworkACL responseObj = response.getResult(); + Snapshot responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24687,54 +26155,51 @@ public void testUpdateNetworkAclWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateNetworkAclPath); + assertEquals(parsedPath, updateSnapshotPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateNetworkAcl operation with and without retries enabled + // Test the updateSnapshot operation with and without retries enabled @Test - public void testUpdateNetworkAclWRetries() throws Throwable { + public void testUpdateSnapshotWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateNetworkAclWOptions(); + testUpdateSnapshotWOptions(); vpcService.disableRetries(); - testUpdateNetworkAclWOptions(); + testUpdateSnapshotWOptions(); } - // Test the updateNetworkAcl operation with a null options model (negative test) + // Test the updateSnapshot operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateNetworkAclNoOptions() throws Throwable { + public void testUpdateSnapshotNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateNetworkAcl(null).execute(); + vpcService.updateSnapshot(null).execute(); } - // Test the listNetworkAclRules operation with a valid options model parameter + // Test the listSnapshotClones operation with a valid options model parameter @Test - public void testListNetworkAclRulesWOptions() throws Throwable { + public void testListSnapshotClonesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}], \"total_count\": 132}"; - String listNetworkAclRulesPath = "/network_acls/testString/rules"; + String mockResponseBody = "{\"clones\": [{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; + String listSnapshotClonesPath = "/snapshots/testString/clones"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListNetworkAclRulesOptions model - ListNetworkAclRulesOptions listNetworkAclRulesOptionsModel = new ListNetworkAclRulesOptions.Builder() - .networkAclId("testString") - .start("testString") - .limit(Long.valueOf("10")) - .direction("inbound") + // Construct an instance of the ListSnapshotClonesOptions model + ListSnapshotClonesOptions listSnapshotClonesOptionsModel = new ListSnapshotClonesOptions.Builder() + .id("testString") .build(); - // Invoke listNetworkAclRules() with a valid options model and verify the result - Response response = vpcService.listNetworkAclRules(listNetworkAclRulesOptionsModel).execute(); + // Invoke listSnapshotClones() with a valid options model and verify the result + Response response = vpcService.listSnapshotClones(listSnapshotClonesOptionsModel).execute(); assertNotNull(response); - NetworkACLRuleCollection responseObj = response.getResult(); + SnapshotCloneCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -24743,380 +26208,341 @@ public void testListNetworkAclRulesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listNetworkAclRulesPath); + assertEquals(parsedPath, listSnapshotClonesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("direction"), "inbound"); } - // Test the listNetworkAclRules operation with and without retries enabled + // Test the listSnapshotClones operation with and without retries enabled @Test - public void testListNetworkAclRulesWRetries() throws Throwable { + public void testListSnapshotClonesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListNetworkAclRulesWOptions(); + testListSnapshotClonesWOptions(); vpcService.disableRetries(); - testListNetworkAclRulesWOptions(); + testListSnapshotClonesWOptions(); } - // Test the listNetworkAclRules operation with a null options model (negative test) + // Test the listSnapshotClones operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListNetworkAclRulesNoOptions() throws Throwable { + public void testListSnapshotClonesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listNetworkAclRules(null).execute(); - } - - // Test the listNetworkAclRules operation using the NetworkAclRulesPager.getNext() method - @Test - public void testListNetworkAclRulesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"all\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"all\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() - .networkAclId("testString") - .limit(Long.valueOf("10")) - .direction("inbound") - .build(); - - List allResults = new ArrayList<>(); - NetworkAclRulesPager pager = new NetworkAclRulesPager(vpcService, listNetworkAclRulesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + vpcService.listSnapshotClones(null).execute(); } - - // Test the listNetworkAclRules operation using the NetworkAclRulesPager.getAll() method - @Test - public void testListNetworkAclRulesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"all\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"rules\":[{\"action\":\"allow\",\"before\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"name\":\"my-network-acl-rule\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"id\":\"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\",\"ip_version\":\"ipv4\",\"name\":\"my-network-acl-rule\",\"source\":\"192.168.3.0/24\",\"protocol\":\"all\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListNetworkAclRulesOptions listNetworkAclRulesOptions = new ListNetworkAclRulesOptions.Builder() - .networkAclId("testString") - .limit(Long.valueOf("10")) - .direction("inbound") - .build(); - NetworkAclRulesPager pager = new NetworkAclRulesPager(vpcService, listNetworkAclRulesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createNetworkAclRule operation with a valid options model parameter + // Test the deleteSnapshotClone operation with a valid options model parameter @Test - public void testCreateNetworkAclRuleWOptions() throws Throwable { + public void testDeleteSnapshotCloneWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}"; - String createNetworkAclRulePath = "/network_acls/testString/rules"; + String mockResponseBody = ""; + String deleteSnapshotClonePath = "/snapshots/testString/clones/us-south-1"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() - .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") - .build(); - - // Construct an instance of the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Builder() - .action("allow") - .before(networkAclRuleBeforePrototypeModel) - .destination("192.168.3.2/32") - .direction("inbound") - .ipVersion("ipv4") - .name("my-network-acl-rule") - .source("192.168.3.2/32") - .protocol("all") - .build(); - - // Construct an instance of the CreateNetworkAclRuleOptions model - CreateNetworkAclRuleOptions createNetworkAclRuleOptionsModel = new CreateNetworkAclRuleOptions.Builder() - .networkAclId("testString") - .networkAclRulePrototype(networkAclRulePrototypeModel) + // Construct an instance of the DeleteSnapshotCloneOptions model + DeleteSnapshotCloneOptions deleteSnapshotCloneOptionsModel = new DeleteSnapshotCloneOptions.Builder() + .id("testString") + .zoneName("us-south-1") .build(); - // Invoke createNetworkAclRule() with a valid options model and verify the result - Response response = vpcService.createNetworkAclRule(createNetworkAclRuleOptionsModel).execute(); + // Invoke deleteSnapshotClone() with a valid options model and verify the result + Response response = vpcService.deleteSnapshotClone(deleteSnapshotCloneOptionsModel).execute(); assertNotNull(response); - NetworkACLRule responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createNetworkAclRulePath); + assertEquals(parsedPath, deleteSnapshotClonePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createNetworkAclRule operation with and without retries enabled + // Test the deleteSnapshotClone operation with and without retries enabled @Test - public void testCreateNetworkAclRuleWRetries() throws Throwable { + public void testDeleteSnapshotCloneWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateNetworkAclRuleWOptions(); + testDeleteSnapshotCloneWOptions(); vpcService.disableRetries(); - testCreateNetworkAclRuleWOptions(); + testDeleteSnapshotCloneWOptions(); } - // Test the createNetworkAclRule operation with a null options model (negative test) + // Test the deleteSnapshotClone operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateNetworkAclRuleNoOptions() throws Throwable { + public void testDeleteSnapshotCloneNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createNetworkAclRule(null).execute(); + vpcService.deleteSnapshotClone(null).execute(); } - // Test the deleteNetworkAclRule operation with a valid options model parameter + // Test the getSnapshotClone operation with a valid options model parameter @Test - public void testDeleteNetworkAclRuleWOptions() throws Throwable { + public void testGetSnapshotCloneWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteNetworkAclRulePath = "/network_acls/testString/rules/testString"; + String mockResponseBody = "{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getSnapshotClonePath = "/snapshots/testString/clones/us-south-1"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteNetworkAclRuleOptions model - DeleteNetworkAclRuleOptions deleteNetworkAclRuleOptionsModel = new DeleteNetworkAclRuleOptions.Builder() - .networkAclId("testString") + // Construct an instance of the GetSnapshotCloneOptions model + GetSnapshotCloneOptions getSnapshotCloneOptionsModel = new GetSnapshotCloneOptions.Builder() .id("testString") + .zoneName("us-south-1") .build(); - // Invoke deleteNetworkAclRule() with a valid options model and verify the result - Response response = vpcService.deleteNetworkAclRule(deleteNetworkAclRuleOptionsModel).execute(); + // Invoke getSnapshotClone() with a valid options model and verify the result + Response response = vpcService.getSnapshotClone(getSnapshotCloneOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + SnapshotClone responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteNetworkAclRulePath); + assertEquals(parsedPath, getSnapshotClonePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteNetworkAclRule operation with and without retries enabled + // Test the getSnapshotClone operation with and without retries enabled @Test - public void testDeleteNetworkAclRuleWRetries() throws Throwable { + public void testGetSnapshotCloneWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteNetworkAclRuleWOptions(); + testGetSnapshotCloneWOptions(); vpcService.disableRetries(); - testDeleteNetworkAclRuleWOptions(); + testGetSnapshotCloneWOptions(); } - // Test the deleteNetworkAclRule operation with a null options model (negative test) + // Test the getSnapshotClone operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteNetworkAclRuleNoOptions() throws Throwable { + public void testGetSnapshotCloneNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteNetworkAclRule(null).execute(); + vpcService.getSnapshotClone(null).execute(); } - // Test the getNetworkAclRule operation with a valid options model parameter + // Test the createSnapshotClone operation with a valid options model parameter @Test - public void testGetNetworkAclRuleWOptions() throws Throwable { + public void testCreateSnapshotCloneWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}"; - String getNetworkAclRulePath = "/network_acls/testString/rules/testString"; + String mockResponseBody = "{\"available\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createSnapshotClonePath = "/snapshots/testString/clones/us-south-1"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetNetworkAclRuleOptions model - GetNetworkAclRuleOptions getNetworkAclRuleOptionsModel = new GetNetworkAclRuleOptions.Builder() - .networkAclId("testString") + // Construct an instance of the CreateSnapshotCloneOptions model + CreateSnapshotCloneOptions createSnapshotCloneOptionsModel = new CreateSnapshotCloneOptions.Builder() .id("testString") + .zoneName("us-south-1") .build(); - // Invoke getNetworkAclRule() with a valid options model and verify the result - Response response = vpcService.getNetworkAclRule(getNetworkAclRuleOptionsModel).execute(); + // Invoke createSnapshotClone() with a valid options model and verify the result + Response response = vpcService.createSnapshotClone(createSnapshotCloneOptionsModel).execute(); assertNotNull(response); - NetworkACLRule responseObj = response.getResult(); + SnapshotClone responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getNetworkAclRulePath); + assertEquals(parsedPath, createSnapshotClonePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getNetworkAclRule operation with and without retries enabled + // Test the createSnapshotClone operation with and without retries enabled @Test - public void testGetNetworkAclRuleWRetries() throws Throwable { + public void testCreateSnapshotCloneWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetNetworkAclRuleWOptions(); + testCreateSnapshotCloneWOptions(); vpcService.disableRetries(); - testGetNetworkAclRuleWOptions(); + testCreateSnapshotCloneWOptions(); } - // Test the getNetworkAclRule operation with a null options model (negative test) + // Test the createSnapshotClone operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetNetworkAclRuleNoOptions() throws Throwable { + public void testCreateSnapshotCloneNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getNetworkAclRule(null).execute(); + vpcService.createSnapshotClone(null).execute(); } - // Test the updateNetworkAclRule operation with a valid options model parameter + // Test the listSnapshotInstanceProfiles operation with a valid options model parameter @Test - public void testUpdateNetworkAclRuleWOptions() throws Throwable { + public void testListSnapshotInstanceProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"all\"}"; - String updateNetworkAclRulePath = "/network_acls/testString/rules/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listSnapshotInstanceProfilesPath = "/snapshots/testString/instance_profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model - NetworkACLRuleBeforePatchNetworkACLRuleIdentityById networkAclRuleBeforePatchModel = new NetworkACLRuleBeforePatchNetworkACLRuleIdentityById.Builder() - .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") - .build(); - - // Construct an instance of the NetworkACLRulePatch model - NetworkACLRulePatch networkAclRulePatchModel = new NetworkACLRulePatch.Builder() - .action("allow") - .before(networkAclRuleBeforePatchModel) - .code(Long.valueOf("0")) - .destination("192.168.3.2/32") - .destinationPortMax(Long.valueOf("22")) - .destinationPortMin(Long.valueOf("22")) - .direction("inbound") - .name("my-network-acl-rule") - .source("10.0.0.0/0") - .sourcePortMax(Long.valueOf("65535")) - .sourcePortMin(Long.valueOf("49152")) - .type(Long.valueOf("8")) - .build(); - Map networkAclRulePatchModelAsPatch = networkAclRulePatchModel.asPatch(); - - // Construct an instance of the UpdateNetworkAclRuleOptions model - UpdateNetworkAclRuleOptions updateNetworkAclRuleOptionsModel = new UpdateNetworkAclRuleOptions.Builder() - .networkAclId("testString") + // Construct an instance of the ListSnapshotInstanceProfilesOptions model + ListSnapshotInstanceProfilesOptions listSnapshotInstanceProfilesOptionsModel = new ListSnapshotInstanceProfilesOptions.Builder() .id("testString") - .networkAclRulePatch(networkAclRulePatchModelAsPatch) + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke updateNetworkAclRule() with a valid options model and verify the result - Response response = vpcService.updateNetworkAclRule(updateNetworkAclRuleOptionsModel).execute(); + // Invoke listSnapshotInstanceProfiles() with a valid options model and verify the result + Response response = vpcService.listSnapshotInstanceProfiles(listSnapshotInstanceProfilesOptionsModel).execute(); assertNotNull(response); - NetworkACLRule responseObj = response.getResult(); + SnapshotInstanceProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateNetworkAclRulePath); + assertEquals(parsedPath, listSnapshotInstanceProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the updateNetworkAclRule operation with and without retries enabled + // Test the listSnapshotInstanceProfiles operation with and without retries enabled @Test - public void testUpdateNetworkAclRuleWRetries() throws Throwable { + public void testListSnapshotInstanceProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateNetworkAclRuleWOptions(); + testListSnapshotInstanceProfilesWOptions(); vpcService.disableRetries(); - testUpdateNetworkAclRuleWOptions(); + testListSnapshotInstanceProfilesWOptions(); } - // Test the updateNetworkAclRule operation with a null options model (negative test) + // Test the listSnapshotInstanceProfiles operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateNetworkAclRuleNoOptions() throws Throwable { + public void testListSnapshotInstanceProfilesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateNetworkAclRule(null).execute(); + vpcService.listSnapshotInstanceProfiles(null).execute(); } - // Test the listSecurityGroups operation with a valid options model parameter + // Test the listSnapshotInstanceProfiles operation using the SnapshotInstanceProfilesPager.getNext() method @Test - public void testListSecurityGroupsWOptions() throws Throwable { + public void testListSnapshotInstanceProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSnapshotInstanceProfilesOptions listSnapshotInstanceProfilesOptions = new ListSnapshotInstanceProfilesOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + SnapshotInstanceProfilesPager pager = new SnapshotInstanceProfilesPager(vpcService, listSnapshotInstanceProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listSnapshotInstanceProfiles operation using the SnapshotInstanceProfilesPager.getAll() method + @Test + public void testListSnapshotInstanceProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListSnapshotInstanceProfilesOptions listSnapshotInstanceProfilesOptions = new ListSnapshotInstanceProfilesOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); + + SnapshotInstanceProfilesPager pager = new SnapshotInstanceProfilesPager(vpcService, listSnapshotInstanceProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the listSubnets operation with a valid options model parameter + @Test + public void testListSubnetsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"security_groups\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"total_count\": 132}"; - String listSecurityGroupsPath = "/security_groups"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"subnets\": [{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"name\": \"my-subnet\", \"network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"public_gateway\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_type\": \"public_gateway\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"subnet\", \"routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"status\": \"available\", \"total_ipv4_address_count\": 256, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String listSubnetsPath = "/subnets"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListSecurityGroupsOptions model - ListSecurityGroupsOptions listSecurityGroupsOptionsModel = new ListSecurityGroupsOptions.Builder() + // Construct an instance of the ListSubnetsOptions model + ListSubnetsOptions listSubnetsOptionsModel = new ListSubnetsOptions.Builder() .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") + .routingTableId("testString") + .routingTableName("my-routing-table") .build(); - // Invoke listSecurityGroups() with a valid options model and verify the result - Response response = vpcService.listSecurityGroups(listSecurityGroupsOptionsModel).execute(); + // Invoke listSubnets() with a valid options model and verify the result + Response response = vpcService.listSubnets(listSubnetsOptionsModel).execute(); assertNotNull(response); - SecurityGroupCollection responseObj = response.getResult(); + SubnetCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -25125,36 +26551,39 @@ public void testListSecurityGroupsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSecurityGroupsPath); + assertEquals(parsedPath, listSubnetsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); assertEquals(query.get("vpc.id"), "testString"); assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); assertEquals(query.get("vpc.name"), "my-vpc"); + assertEquals(query.get("routing_table.id"), "testString"); + assertEquals(query.get("routing_table.name"), "my-routing-table"); } - // Test the listSecurityGroups operation with and without retries enabled + // Test the listSubnets operation with and without retries enabled @Test - public void testListSecurityGroupsWRetries() throws Throwable { + public void testListSubnetsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSecurityGroupsWOptions(); + testListSubnetsWOptions(); vpcService.disableRetries(); - testListSecurityGroupsWOptions(); + testListSubnetsWOptions(); } - // Test the listSecurityGroups operation using the SecurityGroupsPager.getNext() method + // Test the listSubnets operation using the SubnetsPager.getNext() method @Test - public void testListSecurityGroupsWithPagerGetNext() throws Throwable { + public void testListSubnetsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"local\":{\"address\":\"192.168.3.4\"},\"remote\":{\"address\":\"192.168.3.4\"},\"protocol\":\"all\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"local\":{\"address\":\"192.168.3.4\"},\"remote\":{\"address\":\"192.168.3.4\"},\"protocol\":\"all\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -25168,30 +26597,33 @@ public void testListSecurityGroupsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() + ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") + .routingTableId("testString") + .routingTableName("my-routing-table") .build(); - List allResults = new ArrayList<>(); - SecurityGroupsPager pager = new SecurityGroupsPager(vpcService, listSecurityGroupsOptions); + List allResults = new ArrayList<>(); + SubnetsPager pager = new SubnetsPager(vpcService, listSubnetsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listSecurityGroups operation using the SecurityGroupsPager.getAll() method + // Test the listSubnets operation using the SubnetsPager.getAll() method @Test - public void testListSecurityGroupsWithPagerGetAll() throws Throwable { + public void testListSubnetsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"local\":{\"address\":\"192.168.3.4\"},\"remote\":{\"address\":\"192.168.3.4\"},\"protocol\":\"all\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"security_groups\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"rules\":[{\"direction\":\"inbound\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"id\":\"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\",\"ip_version\":\"ipv4\",\"local\":{\"address\":\"192.168.3.4\"},\"remote\":{\"address\":\"192.168.3.4\"},\"protocol\":\"all\"}],\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"subnets\":[{\"available_ipv4_address_count\":15,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"ip_version\":\"ipv4\",\"ipv4_cidr_block\":\"10.0.0.0/24\",\"name\":\"my-subnet\",\"network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"public_gateway\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"id\":\"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\",\"name\":\"my-public-gateway\",\"resource_type\":\"public_gateway\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"subnet\",\"routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"status\":\"available\",\"total_ipv4_address_count\":256,\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -25205,34 +26637,42 @@ public void testListSecurityGroupsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSecurityGroupsOptions listSecurityGroupsOptions = new ListSecurityGroupsOptions.Builder() + ListSubnetsOptions listSubnetsOptions = new ListSubnetsOptions.Builder() .limit(Long.valueOf("10")) .resourceGroupId("testString") + .zoneName("us-south-1") .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") + .routingTableId("testString") + .routingTableName("my-routing-table") .build(); - SecurityGroupsPager pager = new SecurityGroupsPager(vpcService, listSecurityGroupsOptions); - List allResults = pager.getAll(); + SubnetsPager pager = new SubnetsPager(vpcService, listSubnetsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createSecurityGroup operation with a valid options model parameter + // Test the createSubnet operation with a valid options model parameter @Test - public void testCreateSecurityGroupWOptions() throws Throwable { + public void testCreateSubnetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String createSecurityGroupPath = "/security_groups"; + String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"name\": \"my-subnet\", \"network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"public_gateway\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_type\": \"public_gateway\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"subnet\", \"routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"status\": \"available\", \"total_ipv4_address_count\": 256, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createSubnetPath = "/subnets"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + // Construct an instance of the NetworkACLIdentityById model + NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() + .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") + .build(); + + // Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityById model + PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() + .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") .build(); // Construct an instance of the ResourceGroupIdentityById model @@ -25240,37 +26680,43 @@ public void testCreateSecurityGroupWOptions() throws Throwable { .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the SecurityGroupRuleLocalPrototypeIP model - SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() - .address("192.168.3.4") + // Construct an instance of the RoutingTableIdentityByCRN model + RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") .build(); - // Construct an instance of the SecurityGroupRuleRemotePrototypeIP model - SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() - .address("192.168.3.4") + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .build(); - // Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() - .direction("inbound") - .ipVersion("ipv4") - .local(securityGroupRuleLocalPrototypeModel) - .remote(securityGroupRuleRemotePrototypeModel) - .protocol("all") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Construct an instance of the CreateSecurityGroupOptions model - CreateSecurityGroupOptions createSecurityGroupOptionsModel = new CreateSecurityGroupOptions.Builder() - .vpc(vpcIdentityModel) - .name("my-security-group") + // Construct an instance of the SubnetPrototypeSubnetByTotalCount model + SubnetPrototypeSubnetByTotalCount subnetPrototypeModel = new SubnetPrototypeSubnetByTotalCount.Builder() + .ipVersion("ipv4") + .name("my-subnet") + .networkAcl(networkAclIdentityModel) + .publicGateway(publicGatewayIdentityModel) .resourceGroup(resourceGroupIdentityModel) - .rules(java.util.Arrays.asList(securityGroupRulePrototypeModel)) + .routingTable(routingTableIdentityModel) + .vpc(vpcIdentityModel) + .totalIpv4AddressCount(Long.valueOf("256")) + .zone(zoneIdentityModel) .build(); - // Invoke createSecurityGroup() with a valid options model and verify the result - Response response = vpcService.createSecurityGroup(createSecurityGroupOptionsModel).execute(); + // Construct an instance of the CreateSubnetOptions model + CreateSubnetOptions createSubnetOptionsModel = new CreateSubnetOptions.Builder() + .subnetPrototype(subnetPrototypeModel) + .build(); + + // Invoke createSubnet() with a valid options model and verify the result + Response response = vpcService.createSubnet(createSubnetOptionsModel).execute(); assertNotNull(response); - SecurityGroup responseObj = response.getResult(); + Subnet responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -25279,48 +26725,48 @@ public void testCreateSecurityGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSecurityGroupPath); + assertEquals(parsedPath, createSubnetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createSecurityGroup operation with and without retries enabled + // Test the createSubnet operation with and without retries enabled @Test - public void testCreateSecurityGroupWRetries() throws Throwable { + public void testCreateSubnetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateSecurityGroupWOptions(); + testCreateSubnetWOptions(); vpcService.disableRetries(); - testCreateSecurityGroupWOptions(); + testCreateSubnetWOptions(); } - // Test the createSecurityGroup operation with a null options model (negative test) + // Test the createSubnet operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateSecurityGroupNoOptions() throws Throwable { + public void testCreateSubnetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createSecurityGroup(null).execute(); + vpcService.createSubnet(null).execute(); } - // Test the deleteSecurityGroup operation with a valid options model parameter + // Test the deleteSubnet operation with a valid options model parameter @Test - public void testDeleteSecurityGroupWOptions() throws Throwable { + public void testDeleteSubnetWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteSecurityGroupPath = "/security_groups/testString"; + String deleteSubnetPath = "/subnets/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteSecurityGroupOptions model - DeleteSecurityGroupOptions deleteSecurityGroupOptionsModel = new DeleteSecurityGroupOptions.Builder() + // Construct an instance of the DeleteSubnetOptions model + DeleteSubnetOptions deleteSubnetOptionsModel = new DeleteSubnetOptions.Builder() .id("testString") .build(); - // Invoke deleteSecurityGroup() with a valid options model and verify the result - Response response = vpcService.deleteSecurityGroup(deleteSecurityGroupOptionsModel).execute(); + // Invoke deleteSubnet() with a valid options model and verify the result + Response response = vpcService.deleteSubnet(deleteSubnetOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -25331,51 +26777,51 @@ public void testDeleteSecurityGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSecurityGroupPath); + assertEquals(parsedPath, deleteSubnetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteSecurityGroup operation with and without retries enabled + // Test the deleteSubnet operation with and without retries enabled @Test - public void testDeleteSecurityGroupWRetries() throws Throwable { + public void testDeleteSubnetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSecurityGroupWOptions(); + testDeleteSubnetWOptions(); vpcService.disableRetries(); - testDeleteSecurityGroupWOptions(); + testDeleteSubnetWOptions(); } - // Test the deleteSecurityGroup operation with a null options model (negative test) + // Test the deleteSubnet operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSecurityGroupNoOptions() throws Throwable { + public void testDeleteSubnetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSecurityGroup(null).execute(); + vpcService.deleteSubnet(null).execute(); } - // Test the getSecurityGroup operation with a valid options model parameter + // Test the getSubnet operation with a valid options model parameter @Test - public void testGetSecurityGroupWOptions() throws Throwable { + public void testGetSubnetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getSecurityGroupPath = "/security_groups/testString"; + String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"name\": \"my-subnet\", \"network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"public_gateway\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_type\": \"public_gateway\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"subnet\", \"routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"status\": \"available\", \"total_ipv4_address_count\": 256, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getSubnetPath = "/subnets/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetSecurityGroupOptions model - GetSecurityGroupOptions getSecurityGroupOptionsModel = new GetSecurityGroupOptions.Builder() + // Construct an instance of the GetSubnetOptions model + GetSubnetOptions getSubnetOptionsModel = new GetSubnetOptions.Builder() .id("testString") .build(); - // Invoke getSecurityGroup() with a valid options model and verify the result - Response response = vpcService.getSecurityGroup(getSecurityGroupOptionsModel).execute(); + // Invoke getSubnet() with a valid options model and verify the result + Response response = vpcService.getSubnet(getSubnetOptionsModel).execute(); assertNotNull(response); - SecurityGroup responseObj = response.getResult(); + Subnet responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -25384,58 +26830,76 @@ public void testGetSecurityGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSecurityGroupPath); + assertEquals(parsedPath, getSubnetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getSecurityGroup operation with and without retries enabled + // Test the getSubnet operation with and without retries enabled @Test - public void testGetSecurityGroupWRetries() throws Throwable { + public void testGetSubnetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSecurityGroupWOptions(); + testGetSubnetWOptions(); vpcService.disableRetries(); - testGetSecurityGroupWOptions(); + testGetSubnetWOptions(); } - // Test the getSecurityGroup operation with a null options model (negative test) + // Test the getSubnet operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSecurityGroupNoOptions() throws Throwable { + public void testGetSubnetNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSecurityGroup(null).execute(); + vpcService.getSubnet(null).execute(); } - // Test the updateSecurityGroup operation with a valid options model parameter + // Test the updateSubnet operation with a valid options model parameter @Test - public void testUpdateSecurityGroupWOptions() throws Throwable { + public void testUpdateSubnetWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String updateSecurityGroupPath = "/security_groups/testString"; + String mockResponseBody = "{\"available_ipv4_address_count\": 15, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"ip_version\": \"ipv4\", \"ipv4_cidr_block\": \"10.0.0.0/24\", \"name\": \"my-subnet\", \"network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"public_gateway\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_type\": \"public_gateway\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"subnet\", \"routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"status\": \"available\", \"total_ipv4_address_count\": 256, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateSubnetPath = "/subnets/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the SecurityGroupPatch model - SecurityGroupPatch securityGroupPatchModel = new SecurityGroupPatch.Builder() - .name("my-security-group") + // Construct an instance of the NetworkACLIdentityById model + NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() + .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") .build(); - Map securityGroupPatchModelAsPatch = securityGroupPatchModel.asPatch(); - // Construct an instance of the UpdateSecurityGroupOptions model - UpdateSecurityGroupOptions updateSecurityGroupOptionsModel = new UpdateSecurityGroupOptions.Builder() + // Construct an instance of the SubnetPublicGatewayPatchPublicGatewayIdentityById model + SubnetPublicGatewayPatchPublicGatewayIdentityById subnetPublicGatewayPatchModel = new SubnetPublicGatewayPatchPublicGatewayIdentityById.Builder() + .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") + .build(); + + // Construct an instance of the RoutingTableIdentityByCRN model + RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") + .build(); + + // Construct an instance of the SubnetPatch model + SubnetPatch subnetPatchModel = new SubnetPatch.Builder() + .name("my-subnet") + .networkAcl(networkAclIdentityModel) + .publicGateway(subnetPublicGatewayPatchModel) + .routingTable(routingTableIdentityModel) + .build(); + Map subnetPatchModelAsPatch = subnetPatchModel.asPatch(); + + // Construct an instance of the UpdateSubnetOptions model + UpdateSubnetOptions updateSubnetOptionsModel = new UpdateSubnetOptions.Builder() .id("testString") - .securityGroupPatch(securityGroupPatchModelAsPatch) + .subnetPatch(subnetPatchModelAsPatch) .build(); - // Invoke updateSecurityGroup() with a valid options model and verify the result - Response response = vpcService.updateSecurityGroup(updateSecurityGroupOptionsModel).execute(); + // Invoke updateSubnet() with a valid options model and verify the result + Response response = vpcService.updateSubnet(updateSubnetOptionsModel).execute(); assertNotNull(response); - SecurityGroup responseObj = response.getResult(); + Subnet responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -25444,231 +26908,327 @@ public void testUpdateSecurityGroupWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateSecurityGroupPath); + assertEquals(parsedPath, updateSubnetPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateSecurityGroup operation with and without retries enabled + // Test the updateSubnet operation with and without retries enabled @Test - public void testUpdateSecurityGroupWRetries() throws Throwable { + public void testUpdateSubnetWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateSecurityGroupWOptions(); + testUpdateSubnetWOptions(); vpcService.disableRetries(); - testUpdateSecurityGroupWOptions(); + testUpdateSubnetWOptions(); } - // Test the updateSecurityGroup operation with a null options model (negative test) + // Test the updateSubnet operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateSecurityGroupNoOptions() throws Throwable { + public void testUpdateSubnetNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateSubnet(null).execute(); + } + + // Test the getSubnetNetworkAcl operation with a valid options model parameter + @Test + public void testGetSubnetNetworkAclWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getSubnetNetworkAclPath = "/subnets/testString/network_acl"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetSubnetNetworkAclOptions model + GetSubnetNetworkAclOptions getSubnetNetworkAclOptionsModel = new GetSubnetNetworkAclOptions.Builder() + .id("testString") + .build(); + + // Invoke getSubnetNetworkAcl() with a valid options model and verify the result + Response response = vpcService.getSubnetNetworkAcl(getSubnetNetworkAclOptionsModel).execute(); + assertNotNull(response); + NetworkACL responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getSubnetNetworkAclPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the getSubnetNetworkAcl operation with and without retries enabled + @Test + public void testGetSubnetNetworkAclWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetSubnetNetworkAclWOptions(); + + vpcService.disableRetries(); + testGetSubnetNetworkAclWOptions(); + } + + // Test the getSubnetNetworkAcl operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetSubnetNetworkAclNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getSubnetNetworkAcl(null).execute(); + } + + // Test the replaceSubnetNetworkAcl operation with a valid options model parameter + @Test + public void testReplaceSubnetNetworkAclWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String replaceSubnetNetworkAclPath = "/subnets/testString/network_acl"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the NetworkACLIdentityById model + NetworkACLIdentityById networkAclIdentityModel = new NetworkACLIdentityById.Builder() + .id("r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf") + .build(); + + // Construct an instance of the ReplaceSubnetNetworkAclOptions model + ReplaceSubnetNetworkAclOptions replaceSubnetNetworkAclOptionsModel = new ReplaceSubnetNetworkAclOptions.Builder() + .id("testString") + .networkAclIdentity(networkAclIdentityModel) + .build(); + + // Invoke replaceSubnetNetworkAcl() with a valid options model and verify the result + Response response = vpcService.replaceSubnetNetworkAcl(replaceSubnetNetworkAclOptionsModel).execute(); + assertNotNull(response); + NetworkACL responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PUT"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, replaceSubnetNetworkAclPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the replaceSubnetNetworkAcl operation with and without retries enabled + @Test + public void testReplaceSubnetNetworkAclWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testReplaceSubnetNetworkAclWOptions(); + + vpcService.disableRetries(); + testReplaceSubnetNetworkAclWOptions(); + } + + // Test the replaceSubnetNetworkAcl operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testReplaceSubnetNetworkAclNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateSecurityGroup(null).execute(); + vpcService.replaceSubnetNetworkAcl(null).execute(); } - // Test the listSecurityGroupRules operation with a valid options model parameter + // Test the unsetSubnetPublicGateway operation with a valid options model parameter @Test - public void testListSecurityGroupRulesWOptions() throws Throwable { + public void testUnsetSubnetPublicGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}]}"; - String listSecurityGroupRulesPath = "/security_groups/testString/rules"; + String mockResponseBody = ""; + String unsetSubnetPublicGatewayPath = "/subnets/testString/public_gateway"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ListSecurityGroupRulesOptions model - ListSecurityGroupRulesOptions listSecurityGroupRulesOptionsModel = new ListSecurityGroupRulesOptions.Builder() - .securityGroupId("testString") + // Construct an instance of the UnsetSubnetPublicGatewayOptions model + UnsetSubnetPublicGatewayOptions unsetSubnetPublicGatewayOptionsModel = new UnsetSubnetPublicGatewayOptions.Builder() + .id("testString") .build(); - // Invoke listSecurityGroupRules() with a valid options model and verify the result - Response response = vpcService.listSecurityGroupRules(listSecurityGroupRulesOptionsModel).execute(); + // Invoke unsetSubnetPublicGateway() with a valid options model and verify the result + Response response = vpcService.unsetSubnetPublicGateway(unsetSubnetPublicGatewayOptionsModel).execute(); assertNotNull(response); - SecurityGroupRuleCollection responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSecurityGroupRulesPath); + assertEquals(parsedPath, unsetSubnetPublicGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listSecurityGroupRules operation with and without retries enabled + // Test the unsetSubnetPublicGateway operation with and without retries enabled @Test - public void testListSecurityGroupRulesWRetries() throws Throwable { + public void testUnsetSubnetPublicGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSecurityGroupRulesWOptions(); + testUnsetSubnetPublicGatewayWOptions(); vpcService.disableRetries(); - testListSecurityGroupRulesWOptions(); + testUnsetSubnetPublicGatewayWOptions(); } - // Test the listSecurityGroupRules operation with a null options model (negative test) + // Test the unsetSubnetPublicGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListSecurityGroupRulesNoOptions() throws Throwable { + public void testUnsetSubnetPublicGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listSecurityGroupRules(null).execute(); + vpcService.unsetSubnetPublicGateway(null).execute(); } - // Test the createSecurityGroupRule operation with a valid options model parameter + // Test the getSubnetPublicGateway operation with a valid options model parameter @Test - public void testCreateSecurityGroupRuleWOptions() throws Throwable { + public void testGetSubnetPublicGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}"; - String createSecurityGroupRulePath = "/security_groups/testString/rules"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getSubnetPublicGatewayPath = "/subnets/testString/public_gateway"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the SecurityGroupRuleLocalPrototypeIP model - SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() - .address("192.168.3.4") - .build(); - - // Construct an instance of the SecurityGroupRuleRemotePrototypeIP model - SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() - .address("192.168.3.4") - .build(); - - // Construct an instance of the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() - .direction("inbound") - .ipVersion("ipv4") - .local(securityGroupRuleLocalPrototypeModel) - .remote(securityGroupRuleRemotePrototypeModel) - .protocol("all") - .build(); - - // Construct an instance of the CreateSecurityGroupRuleOptions model - CreateSecurityGroupRuleOptions createSecurityGroupRuleOptionsModel = new CreateSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") - .securityGroupRulePrototype(securityGroupRulePrototypeModel) + // Construct an instance of the GetSubnetPublicGatewayOptions model + GetSubnetPublicGatewayOptions getSubnetPublicGatewayOptionsModel = new GetSubnetPublicGatewayOptions.Builder() + .id("testString") .build(); - // Invoke createSecurityGroupRule() with a valid options model and verify the result - Response response = vpcService.createSecurityGroupRule(createSecurityGroupRuleOptionsModel).execute(); + // Invoke getSubnetPublicGateway() with a valid options model and verify the result + Response response = vpcService.getSubnetPublicGateway(getSubnetPublicGatewayOptionsModel).execute(); assertNotNull(response); - SecurityGroupRule responseObj = response.getResult(); + PublicGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSecurityGroupRulePath); + assertEquals(parsedPath, getSubnetPublicGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createSecurityGroupRule operation with and without retries enabled + // Test the getSubnetPublicGateway operation with and without retries enabled @Test - public void testCreateSecurityGroupRuleWRetries() throws Throwable { + public void testGetSubnetPublicGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateSecurityGroupRuleWOptions(); + testGetSubnetPublicGatewayWOptions(); vpcService.disableRetries(); - testCreateSecurityGroupRuleWOptions(); + testGetSubnetPublicGatewayWOptions(); } - // Test the createSecurityGroupRule operation with a null options model (negative test) + // Test the getSubnetPublicGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateSecurityGroupRuleNoOptions() throws Throwable { + public void testGetSubnetPublicGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createSecurityGroupRule(null).execute(); + vpcService.getSubnetPublicGateway(null).execute(); } - // Test the deleteSecurityGroupRule operation with a valid options model parameter + // Test the setSubnetPublicGateway operation with a valid options model parameter @Test - public void testDeleteSecurityGroupRuleWOptions() throws Throwable { + public void testSetSubnetPublicGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteSecurityGroupRulePath = "/security_groups/testString/rules/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::public-gateway:r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"floating_ip\": {\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_gateways/r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"id\": \"r006-dc5431ef-1fc6-4861-adc9-a59d077d1241\", \"name\": \"my-public-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"public_gateway\", \"status\": \"available\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String setSubnetPublicGatewayPath = "/subnets/testString/public_gateway"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the DeleteSecurityGroupRuleOptions model - DeleteSecurityGroupRuleOptions deleteSecurityGroupRuleOptionsModel = new DeleteSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") + // Construct an instance of the PublicGatewayIdentityPublicGatewayIdentityById model + PublicGatewayIdentityPublicGatewayIdentityById publicGatewayIdentityModel = new PublicGatewayIdentityPublicGatewayIdentityById.Builder() + .id("r006-dc5431ef-1fc6-4861-adc9-a59d077d1241") + .build(); + + // Construct an instance of the SetSubnetPublicGatewayOptions model + SetSubnetPublicGatewayOptions setSubnetPublicGatewayOptionsModel = new SetSubnetPublicGatewayOptions.Builder() .id("testString") + .publicGatewayIdentity(publicGatewayIdentityModel) .build(); - // Invoke deleteSecurityGroupRule() with a valid options model and verify the result - Response response = vpcService.deleteSecurityGroupRule(deleteSecurityGroupRuleOptionsModel).execute(); + // Invoke setSubnetPublicGateway() with a valid options model and verify the result + Response response = vpcService.setSubnetPublicGateway(setSubnetPublicGatewayOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + PublicGateway responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSecurityGroupRulePath); + assertEquals(parsedPath, setSubnetPublicGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteSecurityGroupRule operation with and without retries enabled + // Test the setSubnetPublicGateway operation with and without retries enabled @Test - public void testDeleteSecurityGroupRuleWRetries() throws Throwable { + public void testSetSubnetPublicGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSecurityGroupRuleWOptions(); + testSetSubnetPublicGatewayWOptions(); vpcService.disableRetries(); - testDeleteSecurityGroupRuleWOptions(); + testSetSubnetPublicGatewayWOptions(); } - // Test the deleteSecurityGroupRule operation with a null options model (negative test) + // Test the setSubnetPublicGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSecurityGroupRuleNoOptions() throws Throwable { + public void testSetSubnetPublicGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSecurityGroupRule(null).execute(); + vpcService.setSubnetPublicGateway(null).execute(); } - // Test the getSecurityGroupRule operation with a valid options model parameter + // Test the getSubnetRoutingTable operation with a valid options model parameter @Test - public void testGetSecurityGroupRuleWOptions() throws Throwable { + public void testGetSubnetRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}"; - String getSecurityGroupRulePath = "/security_groups/testString/rules/testString"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String getSubnetRoutingTablePath = "/subnets/testString/routing_table"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetSecurityGroupRuleOptions model - GetSecurityGroupRuleOptions getSecurityGroupRuleOptionsModel = new GetSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") + // Construct an instance of the GetSubnetRoutingTableOptions model + GetSubnetRoutingTableOptions getSubnetRoutingTableOptionsModel = new GetSubnetRoutingTableOptions.Builder() .id("testString") .build(); - // Invoke getSecurityGroupRule() with a valid options model and verify the result - Response response = vpcService.getSecurityGroupRule(getSecurityGroupRuleOptionsModel).execute(); + // Invoke getSubnetRoutingTable() with a valid options model and verify the result + Response response = vpcService.getSubnetRoutingTable(getSubnetRoutingTableOptionsModel).execute(); assertNotNull(response); - SecurityGroupRule responseObj = response.getResult(); + RoutingTable responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -25677,131 +27237,117 @@ public void testGetSecurityGroupRuleWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSecurityGroupRulePath); + assertEquals(parsedPath, getSubnetRoutingTablePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getSecurityGroupRule operation with and without retries enabled + // Test the getSubnetRoutingTable operation with and without retries enabled @Test - public void testGetSecurityGroupRuleWRetries() throws Throwable { + public void testGetSubnetRoutingTableWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSecurityGroupRuleWOptions(); + testGetSubnetRoutingTableWOptions(); vpcService.disableRetries(); - testGetSecurityGroupRuleWOptions(); + testGetSubnetRoutingTableWOptions(); } - // Test the getSecurityGroupRule operation with a null options model (negative test) + // Test the getSubnetRoutingTable operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSecurityGroupRuleNoOptions() throws Throwable { + public void testGetSubnetRoutingTableNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSecurityGroupRule(null).execute(); + vpcService.getSubnetRoutingTable(null).execute(); } - // Test the updateSecurityGroupRule operation with a valid options model parameter + // Test the replaceSubnetRoutingTable operation with a valid options model parameter @Test - public void testUpdateSecurityGroupRuleWOptions() throws Throwable { + public void testReplaceSubnetRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"remote\": {\"address\": \"192.168.3.4\"}, \"protocol\": \"all\"}"; - String updateSecurityGroupRulePath = "/security_groups/testString/rules/testString"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String replaceSubnetRoutingTablePath = "/subnets/testString/routing_table"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the SecurityGroupRuleLocalPatchIP model - SecurityGroupRuleLocalPatchIP securityGroupRuleLocalPatchModel = new SecurityGroupRuleLocalPatchIP.Builder() - .address("192.168.3.4") - .build(); - - // Construct an instance of the SecurityGroupRuleRemotePatchCIDR model - SecurityGroupRuleRemotePatchCIDR securityGroupRuleRemotePatchModel = new SecurityGroupRuleRemotePatchCIDR.Builder() - .cidrBlock("10.0.0.0/8") - .build(); - - // Construct an instance of the SecurityGroupRulePatch model - SecurityGroupRulePatch securityGroupRulePatchModel = new SecurityGroupRulePatch.Builder() - .code(Long.valueOf("0")) - .direction("inbound") - .ipVersion("ipv4") - .local(securityGroupRuleLocalPatchModel) - .portMax(Long.valueOf("22")) - .portMin(Long.valueOf("22")) - .remote(securityGroupRuleRemotePatchModel) - .type(Long.valueOf("8")) + // Construct an instance of the RoutingTableIdentityByCRN model + RoutingTableIdentityByCRN routingTableIdentityModel = new RoutingTableIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840") .build(); - Map securityGroupRulePatchModelAsPatch = securityGroupRulePatchModel.asPatch(); - // Construct an instance of the UpdateSecurityGroupRuleOptions model - UpdateSecurityGroupRuleOptions updateSecurityGroupRuleOptionsModel = new UpdateSecurityGroupRuleOptions.Builder() - .securityGroupId("testString") + // Construct an instance of the ReplaceSubnetRoutingTableOptions model + ReplaceSubnetRoutingTableOptions replaceSubnetRoutingTableOptionsModel = new ReplaceSubnetRoutingTableOptions.Builder() .id("testString") - .securityGroupRulePatch(securityGroupRulePatchModelAsPatch) + .routingTableIdentity(routingTableIdentityModel) .build(); - // Invoke updateSecurityGroupRule() with a valid options model and verify the result - Response response = vpcService.updateSecurityGroupRule(updateSecurityGroupRuleOptionsModel).execute(); + // Invoke replaceSubnetRoutingTable() with a valid options model and verify the result + Response response = vpcService.replaceSubnetRoutingTable(replaceSubnetRoutingTableOptionsModel).execute(); assertNotNull(response); - SecurityGroupRule responseObj = response.getResult(); + RoutingTable responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateSecurityGroupRulePath); + assertEquals(parsedPath, replaceSubnetRoutingTablePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateSecurityGroupRule operation with and without retries enabled + // Test the replaceSubnetRoutingTable operation with and without retries enabled @Test - public void testUpdateSecurityGroupRuleWRetries() throws Throwable { + public void testReplaceSubnetRoutingTableWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateSecurityGroupRuleWOptions(); + testReplaceSubnetRoutingTableWOptions(); vpcService.disableRetries(); - testUpdateSecurityGroupRuleWOptions(); + testReplaceSubnetRoutingTableWOptions(); } - // Test the updateSecurityGroupRule operation with a null options model (negative test) + // Test the replaceSubnetRoutingTable operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateSecurityGroupRuleNoOptions() throws Throwable { + public void testReplaceSubnetRoutingTableNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateSecurityGroupRule(null).execute(); + vpcService.replaceSubnetRoutingTable(null).execute(); } - // Test the listSecurityGroupTargets operation with a valid options model parameter + // Test the listSubnetReservedIps operation with a valid options model parameter @Test - public void testListSecurityGroupTargetsWOptions() throws Throwable { + public void testListSubnetReservedIpsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"total_count\": 132}"; - String listSecurityGroupTargetsPath = "/security_groups/testString/targets"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"reserved_ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"total_count\": 132}"; + String listSubnetReservedIpsPath = "/subnets/testString/reserved_ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListSecurityGroupTargetsOptions model - ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptionsModel = new ListSecurityGroupTargetsOptions.Builder() - .securityGroupId("testString") + // Construct an instance of the ListSubnetReservedIpsOptions model + ListSubnetReservedIpsOptions listSubnetReservedIpsOptionsModel = new ListSubnetReservedIpsOptions.Builder() + .subnetId("testString") .start("testString") .limit(Long.valueOf("10")) + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); - // Invoke listSecurityGroupTargets() with a valid options model and verify the result - Response response = vpcService.listSecurityGroupTargets(listSecurityGroupTargetsOptionsModel).execute(); + // Invoke listSubnetReservedIps() with a valid options model and verify the result + Response response = vpcService.listSubnetReservedIps(listSubnetReservedIpsOptionsModel).execute(); assertNotNull(response); - SecurityGroupTargetCollection responseObj = response.getResult(); + ReservedIPCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -25810,39 +27356,44 @@ public void testListSecurityGroupTargetsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listSecurityGroupTargetsPath); + assertEquals(parsedPath, listSubnetReservedIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("sort"), "name"); + assertEquals(query.get("target.id"), "testString"); + assertEquals(query.get("target.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727"); + assertEquals(query.get("target.name"), "my-resource"); + assertEquals(query.get("target.resource_type"), "testString"); } - // Test the listSecurityGroupTargets operation with and without retries enabled + // Test the listSubnetReservedIps operation with and without retries enabled @Test - public void testListSecurityGroupTargetsWRetries() throws Throwable { + public void testListSubnetReservedIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListSecurityGroupTargetsWOptions(); + testListSubnetReservedIpsWOptions(); vpcService.disableRetries(); - testListSecurityGroupTargetsWOptions(); + testListSubnetReservedIpsWOptions(); } - // Test the listSecurityGroupTargets operation with a null options model (negative test) + // Test the listSubnetReservedIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListSecurityGroupTargetsNoOptions() throws Throwable { + public void testListSubnetReservedIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listSecurityGroupTargets(null).execute(); + vpcService.listSubnetReservedIps(null).execute(); } - // Test the listSecurityGroupTargets operation using the SecurityGroupTargetsPager.getNext() method + // Test the listSubnetReservedIps operation using the SubnetReservedIpsPager.getNext() method @Test - public void testListSecurityGroupTargetsWithPagerGetNext() throws Throwable { + public void testListSubnetReservedIpsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -25856,27 +27407,32 @@ public void testListSecurityGroupTargetsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() - .securityGroupId("testString") + ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() + .subnetId("testString") .limit(Long.valueOf("10")) + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); - List allResults = new ArrayList<>(); - SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(vpcService, listSecurityGroupTargetsOptions); + List allResults = new ArrayList<>(); + SubnetReservedIpsPager pager = new SubnetReservedIpsPager(vpcService, listSubnetReservedIpsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listSecurityGroupTargets operation using the SecurityGroupTargetsPager.getAll() method + // Test the listSubnetReservedIps operation using the SubnetReservedIpsPager.getAll() method @Test - public void testListSecurityGroupTargetsWithPagerGetAll() throws Throwable { + public void testListSubnetReservedIpsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"targets\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"id\":\"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\",\"name\":\"my-bare-metal-server-network-interface\",\"resource_type\":\"network_interface\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"reserved_ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -25890,35 +27446,102 @@ public void testListSecurityGroupTargetsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListSecurityGroupTargetsOptions listSecurityGroupTargetsOptions = new ListSecurityGroupTargetsOptions.Builder() - .securityGroupId("testString") + ListSubnetReservedIpsOptions listSubnetReservedIpsOptions = new ListSubnetReservedIpsOptions.Builder() + .subnetId("testString") .limit(Long.valueOf("10")) + .sort("name") + .targetId("testString") + .targetCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + .targetName("my-resource") + .targetResourceType("testString") .build(); - SecurityGroupTargetsPager pager = new SecurityGroupTargetsPager(vpcService, listSecurityGroupTargetsOptions); - List allResults = pager.getAll(); + SubnetReservedIpsPager pager = new SubnetReservedIpsPager(vpcService, listSubnetReservedIpsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the deleteSecurityGroupTargetBinding operation with a valid options model parameter + // Test the createSubnetReservedIp operation with a valid options model parameter @Test - public void testDeleteSecurityGroupTargetBindingWOptions() throws Throwable { + public void testCreateSubnetReservedIpWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; + String createSubnetReservedIpPath = "/subnets/testString/reserved_ips"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById model + ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById reservedIpTargetPrototypeModel = new ReservedIPTargetPrototypeEndpointGatewayIdentityEndpointGatewayIdentityById.Builder() + .id("r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0") + .build(); + + // Construct an instance of the CreateSubnetReservedIpOptions model + CreateSubnetReservedIpOptions createSubnetReservedIpOptionsModel = new CreateSubnetReservedIpOptions.Builder() + .subnetId("testString") + .address("192.168.3.4") + .autoDelete(false) + .name("my-reserved-ip") + .target(reservedIpTargetPrototypeModel) + .build(); + + // Invoke createSubnetReservedIp() with a valid options model and verify the result + Response response = vpcService.createSubnetReservedIp(createSubnetReservedIpOptionsModel).execute(); + assertNotNull(response); + ReservedIP responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createSubnetReservedIpPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createSubnetReservedIp operation with and without retries enabled + @Test + public void testCreateSubnetReservedIpWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateSubnetReservedIpWOptions(); + + vpcService.disableRetries(); + testCreateSubnetReservedIpWOptions(); + } + + // Test the createSubnetReservedIp operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateSubnetReservedIpNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createSubnetReservedIp(null).execute(); + } + + // Test the deleteSubnetReservedIp operation with a valid options model parameter + @Test + public void testDeleteSubnetReservedIpWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteSecurityGroupTargetBindingPath = "/security_groups/testString/targets/testString"; + String deleteSubnetReservedIpPath = "/subnets/testString/reserved_ips/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteSecurityGroupTargetBindingOptions model - DeleteSecurityGroupTargetBindingOptions deleteSecurityGroupTargetBindingOptionsModel = new DeleteSecurityGroupTargetBindingOptions.Builder() - .securityGroupId("testString") + // Construct an instance of the DeleteSubnetReservedIpOptions model + DeleteSubnetReservedIpOptions deleteSubnetReservedIpOptionsModel = new DeleteSubnetReservedIpOptions.Builder() + .subnetId("testString") .id("testString") .build(); - // Invoke deleteSecurityGroupTargetBinding() with a valid options model and verify the result - Response response = vpcService.deleteSecurityGroupTargetBinding(deleteSecurityGroupTargetBindingOptionsModel).execute(); + // Invoke deleteSubnetReservedIp() with a valid options model and verify the result + Response response = vpcService.deleteSubnetReservedIp(deleteSubnetReservedIpOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -25929,52 +27552,52 @@ public void testDeleteSecurityGroupTargetBindingWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteSecurityGroupTargetBindingPath); + assertEquals(parsedPath, deleteSubnetReservedIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteSecurityGroupTargetBinding operation with and without retries enabled + // Test the deleteSubnetReservedIp operation with and without retries enabled @Test - public void testDeleteSecurityGroupTargetBindingWRetries() throws Throwable { + public void testDeleteSubnetReservedIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteSecurityGroupTargetBindingWOptions(); + testDeleteSubnetReservedIpWOptions(); vpcService.disableRetries(); - testDeleteSecurityGroupTargetBindingWOptions(); + testDeleteSubnetReservedIpWOptions(); } - // Test the deleteSecurityGroupTargetBinding operation with a null options model (negative test) + // Test the deleteSubnetReservedIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteSecurityGroupTargetBindingNoOptions() throws Throwable { + public void testDeleteSubnetReservedIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteSecurityGroupTargetBinding(null).execute(); + vpcService.deleteSubnetReservedIp(null).execute(); } - // Test the getSecurityGroupTarget operation with a valid options model parameter + // Test the getSubnetReservedIp operation with a valid options model parameter @Test - public void testGetSecurityGroupTargetWOptions() throws Throwable { + public void testGetSubnetReservedIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}"; - String getSecurityGroupTargetPath = "/security_groups/testString/targets/testString"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; + String getSubnetReservedIpPath = "/subnets/testString/reserved_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetSecurityGroupTargetOptions model - GetSecurityGroupTargetOptions getSecurityGroupTargetOptionsModel = new GetSecurityGroupTargetOptions.Builder() - .securityGroupId("testString") + // Construct an instance of the GetSubnetReservedIpOptions model + GetSubnetReservedIpOptions getSubnetReservedIpOptionsModel = new GetSubnetReservedIpOptions.Builder() + .subnetId("testString") .id("testString") .build(); - // Invoke getSecurityGroupTarget() with a valid options model and verify the result - Response response = vpcService.getSecurityGroupTarget(getSecurityGroupTargetOptionsModel).execute(); + // Invoke getSubnetReservedIp() with a valid options model and verify the result + Response response = vpcService.getSubnetReservedIp(getSubnetReservedIpOptionsModel).execute(); assertNotNull(response); - SecurityGroupTargetReference responseObj = response.getResult(); + ReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -25983,106 +27606,115 @@ public void testGetSecurityGroupTargetWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getSecurityGroupTargetPath); + assertEquals(parsedPath, getSubnetReservedIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getSecurityGroupTarget operation with and without retries enabled + // Test the getSubnetReservedIp operation with and without retries enabled @Test - public void testGetSecurityGroupTargetWRetries() throws Throwable { + public void testGetSubnetReservedIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetSecurityGroupTargetWOptions(); + testGetSubnetReservedIpWOptions(); vpcService.disableRetries(); - testGetSecurityGroupTargetWOptions(); + testGetSubnetReservedIpWOptions(); } - // Test the getSecurityGroupTarget operation with a null options model (negative test) + // Test the getSubnetReservedIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetSecurityGroupTargetNoOptions() throws Throwable { + public void testGetSubnetReservedIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getSecurityGroupTarget(null).execute(); + vpcService.getSubnetReservedIp(null).execute(); } - // Test the createSecurityGroupTargetBinding operation with a valid options model parameter + // Test the updateSubnetReservedIp operation with a valid options model parameter @Test - public void testCreateSecurityGroupTargetBindingWOptions() throws Throwable { + public void testUpdateSubnetReservedIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}"; - String createSecurityGroupTargetBindingPath = "/security_groups/testString/targets/testString"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; + String updateSubnetReservedIpPath = "/subnets/testString/reserved_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the CreateSecurityGroupTargetBindingOptions model - CreateSecurityGroupTargetBindingOptions createSecurityGroupTargetBindingOptionsModel = new CreateSecurityGroupTargetBindingOptions.Builder() - .securityGroupId("testString") + // Construct an instance of the ReservedIPPatch model + ReservedIPPatch reservedIpPatchModel = new ReservedIPPatch.Builder() + .autoDelete(false) + .name("my-reserved-ip-updated") + .build(); + Map reservedIpPatchModelAsPatch = reservedIpPatchModel.asPatch(); + + // Construct an instance of the UpdateSubnetReservedIpOptions model + UpdateSubnetReservedIpOptions updateSubnetReservedIpOptionsModel = new UpdateSubnetReservedIpOptions.Builder() + .subnetId("testString") .id("testString") + .reservedIpPatch(reservedIpPatchModelAsPatch) .build(); - // Invoke createSecurityGroupTargetBinding() with a valid options model and verify the result - Response response = vpcService.createSecurityGroupTargetBinding(createSecurityGroupTargetBindingOptionsModel).execute(); + // Invoke updateSubnetReservedIp() with a valid options model and verify the result + Response response = vpcService.updateSubnetReservedIp(updateSubnetReservedIpOptionsModel).execute(); assertNotNull(response); - SecurityGroupTargetReference responseObj = response.getResult(); + ReservedIP responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createSecurityGroupTargetBindingPath); + assertEquals(parsedPath, updateSubnetReservedIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createSecurityGroupTargetBinding operation with and without retries enabled + // Test the updateSubnetReservedIp operation with and without retries enabled @Test - public void testCreateSecurityGroupTargetBindingWRetries() throws Throwable { + public void testUpdateSubnetReservedIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateSecurityGroupTargetBindingWOptions(); + testUpdateSubnetReservedIpWOptions(); vpcService.disableRetries(); - testCreateSecurityGroupTargetBindingWOptions(); + testUpdateSubnetReservedIpWOptions(); } - // Test the createSecurityGroupTargetBinding operation with a null options model (negative test) + // Test the updateSubnetReservedIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateSecurityGroupTargetBindingNoOptions() throws Throwable { + public void testUpdateSubnetReservedIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createSecurityGroupTargetBinding(null).execute(); + vpcService.updateSubnetReservedIp(null).execute(); } - // Test the listIkePolicies operation with a valid options model parameter + // Test the listVirtualNetworkInterfaces operation with a valid options model parameter @Test - public void testListIkePoliciesWOptions() throws Throwable { + public void testListVirtualNetworkInterfacesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ike_policies\": [{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dh_group\": 14, \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"ike_version\": 1, \"key_lifetime\": 28800, \"name\": \"my-ike-policy\", \"negotiation_mode\": \"main\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ike_policy\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listIkePoliciesPath = "/ike_policies"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"virtual_network_interfaces\": [{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; + String listVirtualNetworkInterfacesPath = "/virtual_network_interfaces"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListIkePoliciesOptions model - ListIkePoliciesOptions listIkePoliciesOptionsModel = new ListIkePoliciesOptions.Builder() + // Construct an instance of the ListVirtualNetworkInterfacesOptions model + ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptionsModel = new ListVirtualNetworkInterfacesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); - // Invoke listIkePolicies() with a valid options model and verify the result - Response response = vpcService.listIkePolicies(listIkePoliciesOptionsModel).execute(); + // Invoke listVirtualNetworkInterfaces() with a valid options model and verify the result + Response response = vpcService.listVirtualNetworkInterfaces(listVirtualNetworkInterfacesOptionsModel).execute(); assertNotNull(response); - IKEPolicyCollection responseObj = response.getResult(); + VirtualNetworkInterfaceCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -26091,32 +27723,33 @@ public void testListIkePoliciesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listIkePoliciesPath); + assertEquals(parsedPath, listVirtualNetworkInterfacesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); } - // Test the listIkePolicies operation with and without retries enabled + // Test the listVirtualNetworkInterfaces operation with and without retries enabled @Test - public void testListIkePoliciesWRetries() throws Throwable { + public void testListVirtualNetworkInterfacesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListIkePoliciesWOptions(); + testListVirtualNetworkInterfacesWOptions(); vpcService.disableRetries(); - testListIkePoliciesWOptions(); + testListVirtualNetworkInterfacesWOptions(); } - // Test the listIkePolicies operation using the IkePoliciesPager.getNext() method + // Test the listVirtualNetworkInterfaces operation using the VirtualNetworkInterfacesPager.getNext() method @Test - public void testListIkePoliciesWithPagerGetNext() throws Throwable { + public void testListVirtualNetworkInterfacesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; - String mockResponsePage2 = "{\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + String mockResponsePage1 = "{\"virtual_network_interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"enable_infrastructure_nat\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-virtual-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"protocol_state_filtering_mode\":\"auto\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"virtual_network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"virtual_network_interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"enable_infrastructure_nat\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-virtual-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"protocol_state_filtering_mode\":\"auto\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"virtual_network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -26130,26 +27763,27 @@ public void testListIkePoliciesWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() + ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptions = new ListVirtualNetworkInterfacesOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); - List allResults = new ArrayList<>(); - IkePoliciesPager pager = new IkePoliciesPager(vpcService, listIkePoliciesOptions); + List allResults = new ArrayList<>(); + VirtualNetworkInterfacesPager pager = new VirtualNetworkInterfacesPager(vpcService, listVirtualNetworkInterfacesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listIkePolicies operation using the IkePoliciesPager.getAll() method + // Test the listVirtualNetworkInterfaces operation using the VirtualNetworkInterfacesPager.getAll() method @Test - public void testListIkePoliciesWithPagerGetAll() throws Throwable { + public void testListVirtualNetworkInterfacesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; - String mockResponsePage2 = "{\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + String mockResponsePage1 = "{\"virtual_network_interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"enable_infrastructure_nat\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-virtual-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"protocol_state_filtering_mode\":\"auto\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"virtual_network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"virtual_network_interfaces\":[{\"allow_ip_spoofing\":true,\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"enable_infrastructure_nat\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"id\":\"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_state\":\"stable\",\"mac_address\":\"02:00:4D:45:45:4D\",\"name\":\"my-virtual-network-interface\",\"primary_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"protocol_state_filtering_mode\":\"auto\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"virtual_network_interface\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"id\":\"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\",\"name\":\"my-share-mount-target\",\"resource_type\":\"share_mount_target\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -26163,47 +27797,71 @@ public void testListIkePoliciesWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() + ListVirtualNetworkInterfacesOptions listVirtualNetworkInterfacesOptions = new ListVirtualNetworkInterfacesOptions.Builder() .limit(Long.valueOf("10")) + .resourceGroupId("testString") .build(); - IkePoliciesPager pager = new IkePoliciesPager(vpcService, listIkePoliciesOptions); - List allResults = pager.getAll(); + VirtualNetworkInterfacesPager pager = new VirtualNetworkInterfacesPager(vpcService, listVirtualNetworkInterfacesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createIkePolicy operation with a valid options model parameter + // Test the createVirtualNetworkInterface operation with a valid options model parameter @Test - public void testCreateIkePolicyWOptions() throws Throwable { + public void testCreateVirtualNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dh_group\": 14, \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"ike_version\": 1, \"key_lifetime\": 28800, \"name\": \"my-ike-policy\", \"negotiation_mode\": \"main\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ike_policy\"}"; - String createIkePolicyPath = "/ike_policies"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createVirtualNetworkInterfacePath = "/virtual_network_interfaces"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); + // Construct an instance of the VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById model + VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById virtualNetworkInterfaceIpPrototypeModel = new VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.Builder() + .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + .build(); + + // Construct an instance of the VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById model + VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById virtualNetworkInterfacePrimaryIpPrototypeModel = new VirtualNetworkInterfacePrimaryIPPrototypeReservedIPIdentityVirtualNetworkInterfacePrimaryIPContextById.Builder() + .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + .build(); + // Construct an instance of the ResourceGroupIdentityById model ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the CreateIkePolicyOptions model - CreateIkePolicyOptions createIkePolicyOptionsModel = new CreateIkePolicyOptions.Builder() - .authenticationAlgorithm("sha256") - .dhGroup(Long.valueOf("14")) - .encryptionAlgorithm("aes128") - .ikeVersion(Long.valueOf("1")) - .keyLifetime(Long.valueOf("28800")) - .name("my-ike-policy") + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("69e55145-cc7d-4d8e-9e1f-cc3fb60b1793") + .build(); + + // Construct an instance of the CreateVirtualNetworkInterfaceOptions model + CreateVirtualNetworkInterfaceOptions createVirtualNetworkInterfaceOptionsModel = new CreateVirtualNetworkInterfaceOptions.Builder() + .allowIpSpoofing(false) + .autoDelete(false) + .enableInfrastructureNat(true) + .ips(java.util.Arrays.asList(virtualNetworkInterfaceIpPrototypeModel)) + .name("my-virtual-network-interface") + .primaryIp(virtualNetworkInterfacePrimaryIpPrototypeModel) + .protocolStateFilteringMode("auto") .resourceGroup(resourceGroupIdentityModel) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + .subnet(subnetIdentityModel) .build(); - // Invoke createIkePolicy() with a valid options model and verify the result - Response response = vpcService.createIkePolicy(createIkePolicyOptionsModel).execute(); + // Invoke createVirtualNetworkInterface() with a valid options model and verify the result + Response response = vpcService.createVirtualNetworkInterface(createVirtualNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - IKEPolicy responseObj = response.getResult(); + VirtualNetworkInterface responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -26212,51 +27870,46 @@ public void testCreateIkePolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createIkePolicyPath); + assertEquals(parsedPath, createVirtualNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createIkePolicy operation with and without retries enabled + // Test the createVirtualNetworkInterface operation with and without retries enabled @Test - public void testCreateIkePolicyWRetries() throws Throwable { + public void testCreateVirtualNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateIkePolicyWOptions(); + testCreateVirtualNetworkInterfaceWOptions(); vpcService.disableRetries(); - testCreateIkePolicyWOptions(); - } - - // Test the createIkePolicy operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateIkePolicyNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createIkePolicy(null).execute(); + testCreateVirtualNetworkInterfaceWOptions(); } - // Test the deleteIkePolicy operation with a valid options model parameter + // Test the deleteVirtualNetworkInterfaces operation with a valid options model parameter @Test - public void testDeleteIkePolicyWOptions() throws Throwable { + public void testDeleteVirtualNetworkInterfacesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteIkePolicyPath = "/ike_policies/testString"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String deleteVirtualNetworkInterfacesPath = "/virtual_network_interfaces/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteIkePolicyOptions model - DeleteIkePolicyOptions deleteIkePolicyOptionsModel = new DeleteIkePolicyOptions.Builder() + // Construct an instance of the DeleteVirtualNetworkInterfacesOptions model + DeleteVirtualNetworkInterfacesOptions deleteVirtualNetworkInterfacesOptionsModel = new DeleteVirtualNetworkInterfacesOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteIkePolicy() with a valid options model and verify the result - Response response = vpcService.deleteIkePolicy(deleteIkePolicyOptionsModel).execute(); + // Invoke deleteVirtualNetworkInterfaces() with a valid options model and verify the result + Response response = vpcService.deleteVirtualNetworkInterfaces(deleteVirtualNetworkInterfacesOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + VirtualNetworkInterface responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -26264,51 +27917,51 @@ public void testDeleteIkePolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteIkePolicyPath); + assertEquals(parsedPath, deleteVirtualNetworkInterfacesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteIkePolicy operation with and without retries enabled + // Test the deleteVirtualNetworkInterfaces operation with and without retries enabled @Test - public void testDeleteIkePolicyWRetries() throws Throwable { + public void testDeleteVirtualNetworkInterfacesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteIkePolicyWOptions(); + testDeleteVirtualNetworkInterfacesWOptions(); vpcService.disableRetries(); - testDeleteIkePolicyWOptions(); + testDeleteVirtualNetworkInterfacesWOptions(); } - // Test the deleteIkePolicy operation with a null options model (negative test) + // Test the deleteVirtualNetworkInterfaces operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteIkePolicyNoOptions() throws Throwable { + public void testDeleteVirtualNetworkInterfacesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteIkePolicy(null).execute(); + vpcService.deleteVirtualNetworkInterfaces(null).execute(); } - // Test the getIkePolicy operation with a valid options model parameter + // Test the getVirtualNetworkInterface operation with a valid options model parameter @Test - public void testGetIkePolicyWOptions() throws Throwable { + public void testGetVirtualNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dh_group\": 14, \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"ike_version\": 1, \"key_lifetime\": 28800, \"name\": \"my-ike-policy\", \"negotiation_mode\": \"main\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ike_policy\"}"; - String getIkePolicyPath = "/ike_policies/testString"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getVirtualNetworkInterfacePath = "/virtual_network_interfaces/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetIkePolicyOptions model - GetIkePolicyOptions getIkePolicyOptionsModel = new GetIkePolicyOptions.Builder() + // Construct an instance of the GetVirtualNetworkInterfaceOptions model + GetVirtualNetworkInterfaceOptions getVirtualNetworkInterfaceOptionsModel = new GetVirtualNetworkInterfaceOptions.Builder() .id("testString") .build(); - // Invoke getIkePolicy() with a valid options model and verify the result - Response response = vpcService.getIkePolicy(getIkePolicyOptionsModel).execute(); + // Invoke getVirtualNetworkInterface() with a valid options model and verify the result + Response response = vpcService.getVirtualNetworkInterface(getVirtualNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - IKEPolicy responseObj = response.getResult(); + VirtualNetworkInterface responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -26317,63 +27970,63 @@ public void testGetIkePolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getIkePolicyPath); + assertEquals(parsedPath, getVirtualNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getIkePolicy operation with and without retries enabled + // Test the getVirtualNetworkInterface operation with and without retries enabled @Test - public void testGetIkePolicyWRetries() throws Throwable { + public void testGetVirtualNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetIkePolicyWOptions(); + testGetVirtualNetworkInterfaceWOptions(); vpcService.disableRetries(); - testGetIkePolicyWOptions(); + testGetVirtualNetworkInterfaceWOptions(); } - // Test the getIkePolicy operation with a null options model (negative test) + // Test the getVirtualNetworkInterface operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetIkePolicyNoOptions() throws Throwable { + public void testGetVirtualNetworkInterfaceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getIkePolicy(null).execute(); + vpcService.getVirtualNetworkInterface(null).execute(); } - // Test the updateIkePolicy operation with a valid options model parameter + // Test the updateVirtualNetworkInterface operation with a valid options model parameter @Test - public void testUpdateIkePolicyWOptions() throws Throwable { + public void testUpdateVirtualNetworkInterfaceWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dh_group\": 14, \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"ike_version\": 1, \"key_lifetime\": 28800, \"name\": \"my-ike-policy\", \"negotiation_mode\": \"main\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ike_policy\"}"; - String updateIkePolicyPath = "/ike_policies/testString"; + String mockResponseBody = "{\"allow_ip_spoofing\": true, \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::virtual-network-interface:0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"enable_infrastructure_nat\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"id\": \"0717-54eb57ee-86f2-4796-90bb-d7874e0831ef\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_state\": \"stable\", \"mac_address\": \"02:00:4D:45:45:4D\", \"name\": \"my-virtual-network-interface\", \"primary_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"protocol_state_filtering_mode\": \"auto\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"virtual_network_interface\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/mount_targets/r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"id\": \"r006-76083f29-e320-4c3f-a1ff-ec479f7249d1\", \"name\": \"my-share-mount-target\", \"resource_type\": \"share_mount_target\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateVirtualNetworkInterfacePath = "/virtual_network_interfaces/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the IKEPolicyPatch model - IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() - .authenticationAlgorithm("sha256") - .dhGroup(Long.valueOf("14")) - .encryptionAlgorithm("aes128") - .ikeVersion(Long.valueOf("1")) - .keyLifetime(Long.valueOf("86400")) - .name("my-ike-policy") + // Construct an instance of the VirtualNetworkInterfacePatch model + VirtualNetworkInterfacePatch virtualNetworkInterfacePatchModel = new VirtualNetworkInterfacePatch.Builder() + .allowIpSpoofing(true) + .autoDelete(false) + .enableInfrastructureNat(true) + .name("my-virtual-network-interface") + .protocolStateFilteringMode("auto") .build(); - Map ikePolicyPatchModelAsPatch = ikePolicyPatchModel.asPatch(); + Map virtualNetworkInterfacePatchModelAsPatch = virtualNetworkInterfacePatchModel.asPatch(); - // Construct an instance of the UpdateIkePolicyOptions model - UpdateIkePolicyOptions updateIkePolicyOptionsModel = new UpdateIkePolicyOptions.Builder() + // Construct an instance of the UpdateVirtualNetworkInterfaceOptions model + UpdateVirtualNetworkInterfaceOptions updateVirtualNetworkInterfaceOptionsModel = new UpdateVirtualNetworkInterfaceOptions.Builder() .id("testString") - .ikePolicyPatch(ikePolicyPatchModelAsPatch) + .virtualNetworkInterfacePatch(virtualNetworkInterfacePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateIkePolicy() with a valid options model and verify the result - Response response = vpcService.updateIkePolicy(updateIkePolicyOptionsModel).execute(); + // Invoke updateVirtualNetworkInterface() with a valid options model and verify the result + Response response = vpcService.updateVirtualNetworkInterface(updateVirtualNetworkInterfaceOptionsModel).execute(); assertNotNull(response); - IKEPolicy responseObj = response.getResult(); + VirtualNetworkInterface responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -26382,53 +28035,54 @@ public void testUpdateIkePolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateIkePolicyPath); + assertEquals(parsedPath, updateVirtualNetworkInterfacePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateIkePolicy operation with and without retries enabled + // Test the updateVirtualNetworkInterface operation with and without retries enabled @Test - public void testUpdateIkePolicyWRetries() throws Throwable { + public void testUpdateVirtualNetworkInterfaceWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateIkePolicyWOptions(); + testUpdateVirtualNetworkInterfaceWOptions(); vpcService.disableRetries(); - testUpdateIkePolicyWOptions(); + testUpdateVirtualNetworkInterfaceWOptions(); } - // Test the updateIkePolicy operation with a null options model (negative test) + // Test the updateVirtualNetworkInterface operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateIkePolicyNoOptions() throws Throwable { + public void testUpdateVirtualNetworkInterfaceNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateIkePolicy(null).execute(); + vpcService.updateVirtualNetworkInterface(null).execute(); } - // Test the listIkePolicyConnections operation with a valid options model parameter + // Test the listNetworkInterfaceFloatingIps operation with a valid options model parameter @Test - public void testListIkePolicyConnectionsWOptions() throws Throwable { + public void testListNetworkInterfaceFloatingIpsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listIkePolicyConnectionsPath = "/ike_policies/testString/connections"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"floating_ips\": [{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listNetworkInterfaceFloatingIpsPath = "/virtual_network_interfaces/testString/floating_ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListIkePolicyConnectionsOptions model - ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptionsModel = new ListIkePolicyConnectionsOptions.Builder() - .id("testString") + // Construct an instance of the ListNetworkInterfaceFloatingIpsOptions model + ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptionsModel = new ListNetworkInterfaceFloatingIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .start("testString") .limit(Long.valueOf("10")) + .sort("name") .build(); - // Invoke listIkePolicyConnections() with a valid options model and verify the result - Response response = vpcService.listIkePolicyConnections(listIkePolicyConnectionsOptionsModel).execute(); + // Invoke listNetworkInterfaceFloatingIps() with a valid options model and verify the result + Response response = vpcService.listNetworkInterfaceFloatingIps(listNetworkInterfaceFloatingIpsOptionsModel).execute(); assertNotNull(response); - IKEPolicyConnectionCollection responseObj = response.getResult(); + FloatingIPCollectionVirtualNetworkInterfaceContext responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -26437,152 +28091,40 @@ public void testListIkePolicyConnectionsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listIkePolicyConnectionsPath); + assertEquals(parsedPath, listNetworkInterfaceFloatingIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("sort"), "name"); } - // Test the listIkePolicyConnections operation with and without retries enabled + // Test the listNetworkInterfaceFloatingIps operation with and without retries enabled @Test - public void testListIkePolicyConnectionsWRetries() throws Throwable { + public void testListNetworkInterfaceFloatingIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListIkePolicyConnectionsWOptions(); + testListNetworkInterfaceFloatingIpsWOptions(); vpcService.disableRetries(); - testListIkePolicyConnectionsWOptions(); + testListNetworkInterfaceFloatingIpsWOptions(); } - // Test the listIkePolicyConnections operation with a null options model (negative test) + // Test the listNetworkInterfaceFloatingIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListIkePolicyConnectionsNoOptions() throws Throwable { + public void testListNetworkInterfaceFloatingIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listIkePolicyConnections(null).execute(); - } - - // Test the listIkePolicyConnections operation using the IkePolicyConnectionsPager.getNext() method - @Test - public void testListIkePolicyConnectionsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions = new ListIkePolicyConnectionsOptions.Builder() - .id("testString") - .limit(Long.valueOf("10")) - .build(); - - List allResults = new ArrayList<>(); - IkePolicyConnectionsPager pager = new IkePolicyConnectionsPager(vpcService, listIkePolicyConnectionsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); - } - - // Test the listIkePolicyConnections operation using the IkePolicyConnectionsPager.getAll() method - @Test - public void testListIkePolicyConnectionsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions = new ListIkePolicyConnectionsOptions.Builder() - .id("testString") - .limit(Long.valueOf("10")) - .build(); - - IkePolicyConnectionsPager pager = new IkePolicyConnectionsPager(vpcService, listIkePolicyConnectionsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the listIpsecPolicies operation with a valid options model parameter - @Test - public void testListIpsecPoliciesWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ipsec_policies\": [{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listIpsecPoliciesPath = "/ipsec_policies"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListIpsecPoliciesOptions model - ListIpsecPoliciesOptions listIpsecPoliciesOptionsModel = new ListIpsecPoliciesOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .build(); - - // Invoke listIpsecPolicies() with a valid options model and verify the result - Response response = vpcService.listIpsecPolicies(listIpsecPoliciesOptionsModel).execute(); - assertNotNull(response); - IPsecPolicyCollection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listIpsecPoliciesPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - } - - // Test the listIpsecPolicies operation with and without retries enabled - @Test - public void testListIpsecPoliciesWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListIpsecPoliciesWOptions(); - - vpcService.disableRetries(); - testListIpsecPoliciesWOptions(); + vpcService.listNetworkInterfaceFloatingIps(null).execute(); } - // Test the listIpsecPolicies operation using the IpsecPoliciesPager.getNext() method + // Test the listNetworkInterfaceFloatingIps operation using the NetworkInterfaceFloatingIpsPager.getNext() method @Test - public void testListIpsecPoliciesWithPagerGetNext() throws Throwable { + public void testListNetworkInterfaceFloatingIpsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -26596,129 +28138,71 @@ public void testListIpsecPoliciesWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() + ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptions = new ListNetworkInterfaceFloatingIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .limit(Long.valueOf("10")) + .sort("name") .build(); - List allResults = new ArrayList<>(); - IpsecPoliciesPager pager = new IpsecPoliciesPager(vpcService, listIpsecPoliciesOptions); + List allResults = new ArrayList<>(); + NetworkInterfaceFloatingIpsPager pager = new NetworkInterfaceFloatingIpsPager(vpcService, listNetworkInterfaceFloatingIpsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } - assertEquals(allResults.size(), 2); - } - - // Test the listIpsecPolicies operation using the IpsecPoliciesPager.getAll() method - @Test - public void testListIpsecPoliciesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() - .limit(Long.valueOf("10")) - .build(); - - IpsecPoliciesPager pager = new IpsecPoliciesPager(vpcService, listIpsecPoliciesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createIpsecPolicy operation with a valid options model parameter - @Test - public void testCreateIpsecPolicyWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; - String createIpsecPolicyPath = "/ipsec_policies"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the CreateIpsecPolicyOptions model - CreateIpsecPolicyOptions createIpsecPolicyOptionsModel = new CreateIpsecPolicyOptions.Builder() - .authenticationAlgorithm("disabled") - .encryptionAlgorithm("aes128") - .pfs("disabled") - .keyLifetime(Long.valueOf("3600")) - .name("my-ipsec-policy") - .resourceGroup(resourceGroupIdentityModel) - .build(); - - // Invoke createIpsecPolicy() with a valid options model and verify the result - Response response = vpcService.createIpsecPolicy(createIpsecPolicyOptionsModel).execute(); - assertNotNull(response); - IPsecPolicy responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createIpsecPolicyPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the createIpsecPolicy operation with and without retries enabled - @Test - public void testCreateIpsecPolicyWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testCreateIpsecPolicyWOptions(); - - vpcService.disableRetries(); - testCreateIpsecPolicyWOptions(); + assertEquals(allResults.size(), 2); } + + // Test the listNetworkInterfaceFloatingIps operation using the NetworkInterfaceFloatingIpsPager.getAll() method + @Test + public void testListNetworkInterfaceFloatingIpsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"floating_ips\":[{\"address\":\"203.0.113.1\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"id\":\"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\",\"name\":\"my-floating-ip\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Test the createIpsecPolicy operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateIpsecPolicyNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createIpsecPolicy(null).execute(); - } + ListNetworkInterfaceFloatingIpsOptions listNetworkInterfaceFloatingIpsOptions = new ListNetworkInterfaceFloatingIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") + .limit(Long.valueOf("10")) + .sort("name") + .build(); - // Test the deleteIpsecPolicy operation with a valid options model parameter + NetworkInterfaceFloatingIpsPager pager = new NetworkInterfaceFloatingIpsPager(vpcService, listNetworkInterfaceFloatingIpsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the removeNetworkInterfaceFloatingIp operation with a valid options model parameter @Test - public void testDeleteIpsecPolicyWOptions() throws Throwable { + public void testRemoveNetworkInterfaceFloatingIpWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteIpsecPolicyPath = "/ipsec_policies/testString"; + String removeNetworkInterfaceFloatingIpPath = "/virtual_network_interfaces/testString/floating_ips/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteIpsecPolicyOptions model - DeleteIpsecPolicyOptions deleteIpsecPolicyOptionsModel = new DeleteIpsecPolicyOptions.Builder() + // Construct an instance of the RemoveNetworkInterfaceFloatingIpOptions model + RemoveNetworkInterfaceFloatingIpOptions removeNetworkInterfaceFloatingIpOptionsModel = new RemoveNetworkInterfaceFloatingIpOptions.Builder() + .virtualNetworkInterfaceId("testString") .id("testString") .build(); - // Invoke deleteIpsecPolicy() with a valid options model and verify the result - Response response = vpcService.deleteIpsecPolicy(deleteIpsecPolicyOptionsModel).execute(); + // Invoke removeNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.removeNetworkInterfaceFloatingIp(removeNetworkInterfaceFloatingIpOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -26729,51 +28213,52 @@ public void testDeleteIpsecPolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteIpsecPolicyPath); + assertEquals(parsedPath, removeNetworkInterfaceFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteIpsecPolicy operation with and without retries enabled + // Test the removeNetworkInterfaceFloatingIp operation with and without retries enabled @Test - public void testDeleteIpsecPolicyWRetries() throws Throwable { + public void testRemoveNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteIpsecPolicyWOptions(); + testRemoveNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testDeleteIpsecPolicyWOptions(); + testRemoveNetworkInterfaceFloatingIpWOptions(); } - // Test the deleteIpsecPolicy operation with a null options model (negative test) + // Test the removeNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteIpsecPolicyNoOptions() throws Throwable { + public void testRemoveNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteIpsecPolicy(null).execute(); + vpcService.removeNetworkInterfaceFloatingIp(null).execute(); } - // Test the getIpsecPolicy operation with a valid options model parameter + // Test the getNetworkInterfaceFloatingIp operation with a valid options model parameter @Test - public void testGetIpsecPolicyWOptions() throws Throwable { + public void testGetNetworkInterfaceFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; - String getIpsecPolicyPath = "/ipsec_policies/testString"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}"; + String getNetworkInterfaceFloatingIpPath = "/virtual_network_interfaces/testString/floating_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetIpsecPolicyOptions model - GetIpsecPolicyOptions getIpsecPolicyOptionsModel = new GetIpsecPolicyOptions.Builder() + // Construct an instance of the GetNetworkInterfaceFloatingIpOptions model + GetNetworkInterfaceFloatingIpOptions getNetworkInterfaceFloatingIpOptionsModel = new GetNetworkInterfaceFloatingIpOptions.Builder() + .virtualNetworkInterfaceId("testString") .id("testString") .build(); - // Invoke getIpsecPolicy() with a valid options model and verify the result - Response response = vpcService.getIpsecPolicy(getIpsecPolicyOptionsModel).execute(); + // Invoke getNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.getNetworkInterfaceFloatingIp(getNetworkInterfaceFloatingIpOptionsModel).execute(); assertNotNull(response); - IPsecPolicy responseObj = response.getResult(); + FloatingIPReference responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -26782,117 +28267,108 @@ public void testGetIpsecPolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getIpsecPolicyPath); + assertEquals(parsedPath, getNetworkInterfaceFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getIpsecPolicy operation with and without retries enabled + // Test the getNetworkInterfaceFloatingIp operation with and without retries enabled @Test - public void testGetIpsecPolicyWRetries() throws Throwable { + public void testGetNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetIpsecPolicyWOptions(); + testGetNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testGetIpsecPolicyWOptions(); + testGetNetworkInterfaceFloatingIpWOptions(); } - // Test the getIpsecPolicy operation with a null options model (negative test) + // Test the getNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetIpsecPolicyNoOptions() throws Throwable { + public void testGetNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getIpsecPolicy(null).execute(); + vpcService.getNetworkInterfaceFloatingIp(null).execute(); } - // Test the updateIpsecPolicy operation with a valid options model parameter + // Test the addNetworkInterfaceFloatingIp operation with a valid options model parameter @Test - public void testUpdateIpsecPolicyWOptions() throws Throwable { + public void testAddNetworkInterfaceFloatingIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; - String updateIpsecPolicyPath = "/ipsec_policies/testString"; + String mockResponseBody = "{\"address\": \"203.0.113.1\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::floating-ip:r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/floating_ips/r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"id\": \"r006-f45e0d90-12a8-4460-8210-290ff2ab75cd\", \"name\": \"my-floating-ip\"}"; + String addNetworkInterfaceFloatingIpPath = "/virtual_network_interfaces/testString/floating_ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the IPsecPolicyPatch model - IPsecPolicyPatch iPsecPolicyPatchModel = new IPsecPolicyPatch.Builder() - .authenticationAlgorithm("disabled") - .encryptionAlgorithm("aes128") - .keyLifetime(Long.valueOf("3600")) - .name("my-ipsec-policy") - .pfs("disabled") - .build(); - Map iPsecPolicyPatchModelAsPatch = iPsecPolicyPatchModel.asPatch(); - - // Construct an instance of the UpdateIpsecPolicyOptions model - UpdateIpsecPolicyOptions updateIpsecPolicyOptionsModel = new UpdateIpsecPolicyOptions.Builder() + // Construct an instance of the AddNetworkInterfaceFloatingIpOptions model + AddNetworkInterfaceFloatingIpOptions addNetworkInterfaceFloatingIpOptionsModel = new AddNetworkInterfaceFloatingIpOptions.Builder() + .virtualNetworkInterfaceId("testString") .id("testString") - .iPsecPolicyPatch(iPsecPolicyPatchModelAsPatch) .build(); - // Invoke updateIpsecPolicy() with a valid options model and verify the result - Response response = vpcService.updateIpsecPolicy(updateIpsecPolicyOptionsModel).execute(); + // Invoke addNetworkInterfaceFloatingIp() with a valid options model and verify the result + Response response = vpcService.addNetworkInterfaceFloatingIp(addNetworkInterfaceFloatingIpOptionsModel).execute(); assertNotNull(response); - IPsecPolicy responseObj = response.getResult(); + FloatingIPReference responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateIpsecPolicyPath); + assertEquals(parsedPath, addNetworkInterfaceFloatingIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateIpsecPolicy operation with and without retries enabled + // Test the addNetworkInterfaceFloatingIp operation with and without retries enabled @Test - public void testUpdateIpsecPolicyWRetries() throws Throwable { + public void testAddNetworkInterfaceFloatingIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateIpsecPolicyWOptions(); + testAddNetworkInterfaceFloatingIpWOptions(); vpcService.disableRetries(); - testUpdateIpsecPolicyWOptions(); + testAddNetworkInterfaceFloatingIpWOptions(); } - // Test the updateIpsecPolicy operation with a null options model (negative test) + // Test the addNetworkInterfaceFloatingIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateIpsecPolicyNoOptions() throws Throwable { + public void testAddNetworkInterfaceFloatingIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateIpsecPolicy(null).execute(); + vpcService.addNetworkInterfaceFloatingIp(null).execute(); } - // Test the listIpsecPolicyConnections operation with a valid options model parameter + // Test the listVirtualNetworkInterfaceIps operation with a valid options model parameter @Test - public void testListIpsecPolicyConnectionsWOptions() throws Throwable { + public void testListVirtualNetworkInterfaceIpsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listIpsecPolicyConnectionsPath = "/ipsec_policies/testString/connections"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listVirtualNetworkInterfaceIpsPath = "/virtual_network_interfaces/testString/ips"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListIpsecPolicyConnectionsOptions model - ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptionsModel = new ListIpsecPolicyConnectionsOptions.Builder() - .id("testString") + // Construct an instance of the ListVirtualNetworkInterfaceIpsOptions model + ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptionsModel = new ListVirtualNetworkInterfaceIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .start("testString") .limit(Long.valueOf("10")) + .sort("name") .build(); - // Invoke listIpsecPolicyConnections() with a valid options model and verify the result - Response response = vpcService.listIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModel).execute(); + // Invoke listVirtualNetworkInterfaceIps() with a valid options model and verify the result + Response response = vpcService.listVirtualNetworkInterfaceIps(listVirtualNetworkInterfaceIpsOptionsModel).execute(); assertNotNull(response); - IPsecPolicyConnectionCollection responseObj = response.getResult(); + ReservedIPCollectionVirtualNetworkInterfaceContext responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -26901,39 +28377,40 @@ public void testListIpsecPolicyConnectionsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listIpsecPolicyConnectionsPath); + assertEquals(parsedPath, listVirtualNetworkInterfaceIpsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("sort"), "name"); } - // Test the listIpsecPolicyConnections operation with and without retries enabled + // Test the listVirtualNetworkInterfaceIps operation with and without retries enabled @Test - public void testListIpsecPolicyConnectionsWRetries() throws Throwable { + public void testListVirtualNetworkInterfaceIpsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListIpsecPolicyConnectionsWOptions(); + testListVirtualNetworkInterfaceIpsWOptions(); vpcService.disableRetries(); - testListIpsecPolicyConnectionsWOptions(); + testListVirtualNetworkInterfaceIpsWOptions(); } - // Test the listIpsecPolicyConnections operation with a null options model (negative test) + // Test the listVirtualNetworkInterfaceIps operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListIpsecPolicyConnectionsNoOptions() throws Throwable { + public void testListVirtualNetworkInterfaceIpsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listIpsecPolicyConnections(null).execute(); + vpcService.listVirtualNetworkInterfaceIps(null).execute(); } - // Test the listIpsecPolicyConnections operation using the IpsecPolicyConnectionsPager.getNext() method + // Test the listVirtualNetworkInterfaceIps operation using the VirtualNetworkInterfaceIpsPager.getNext() method @Test - public void testListIpsecPolicyConnectionsWithPagerGetNext() throws Throwable { + public void testListVirtualNetworkInterfaceIpsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -26947,27 +28424,28 @@ public void testListIpsecPolicyConnectionsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions = new ListIpsecPolicyConnectionsOptions.Builder() - .id("testString") + ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptions = new ListVirtualNetworkInterfaceIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .limit(Long.valueOf("10")) + .sort("name") .build(); - List allResults = new ArrayList<>(); - IpsecPolicyConnectionsPager pager = new IpsecPolicyConnectionsPager(vpcService, listIpsecPolicyConnectionsOptions); + List allResults = new ArrayList<>(); + VirtualNetworkInterfaceIpsPager pager = new VirtualNetworkInterfaceIpsPager(vpcService, listVirtualNetworkInterfaceIpsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listIpsecPolicyConnections operation using the IpsecPolicyConnectionsPager.getAll() method + // Test the listVirtualNetworkInterfaceIps operation using the VirtualNetworkInterfaceIpsPager.getAll() method @Test - public void testListIpsecPolicyConnectionsWithPagerGetAll() throws Throwable { + public void testListVirtualNetworkInterfaceIpsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -26981,283 +28459,200 @@ public void testListIpsecPolicyConnectionsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions = new ListIpsecPolicyConnectionsOptions.Builder() - .id("testString") + ListVirtualNetworkInterfaceIpsOptions listVirtualNetworkInterfaceIpsOptions = new ListVirtualNetworkInterfaceIpsOptions.Builder() + .virtualNetworkInterfaceId("testString") .limit(Long.valueOf("10")) + .sort("name") .build(); - IpsecPolicyConnectionsPager pager = new IpsecPolicyConnectionsPager(vpcService, listIpsecPolicyConnectionsOptions); - List allResults = pager.getAll(); + VirtualNetworkInterfaceIpsPager pager = new VirtualNetworkInterfaceIpsPager(vpcService, listVirtualNetworkInterfaceIpsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the listVpnGateways operation with a valid options model parameter + // Test the removeVirtualNetworkInterfaceIp operation with a valid options model parameter @Test - public void testListVpnGatewaysWOptions() throws Throwable { + public void testRemoveVirtualNetworkInterfaceIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"vpn_gateways\": [{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"members\": [{\"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"private_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"policy\"}]}"; - String listVpnGatewaysPath = "/vpn_gateways"; + String mockResponseBody = ""; + String removeVirtualNetworkInterfaceIpPath = "/virtual_network_interfaces/testString/ips/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ListVpnGatewaysOptions model - ListVpnGatewaysOptions listVpnGatewaysOptionsModel = new ListVpnGatewaysOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .sort("name") - .mode("policy") + // Construct an instance of the RemoveVirtualNetworkInterfaceIpOptions model + RemoveVirtualNetworkInterfaceIpOptions removeVirtualNetworkInterfaceIpOptionsModel = new RemoveVirtualNetworkInterfaceIpOptions.Builder() + .virtualNetworkInterfaceId("testString") + .id("testString") .build(); - // Invoke listVpnGateways() with a valid options model and verify the result - Response response = vpcService.listVpnGateways(listVpnGatewaysOptionsModel).execute(); + // Invoke removeVirtualNetworkInterfaceIp() with a valid options model and verify the result + Response response = vpcService.removeVirtualNetworkInterfaceIp(removeVirtualNetworkInterfaceIpOptionsModel).execute(); assertNotNull(response); - VPNGatewayCollection responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpnGatewaysPath); + assertEquals(parsedPath, removeVirtualNetworkInterfaceIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("sort"), "name"); - assertEquals(query.get("mode"), "policy"); } - // Test the listVpnGateways operation with and without retries enabled + // Test the removeVirtualNetworkInterfaceIp operation with and without retries enabled @Test - public void testListVpnGatewaysWRetries() throws Throwable { + public void testRemoveVirtualNetworkInterfaceIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpnGatewaysWOptions(); + testRemoveVirtualNetworkInterfaceIpWOptions(); vpcService.disableRetries(); - testListVpnGatewaysWOptions(); + testRemoveVirtualNetworkInterfaceIpWOptions(); } - // Test the listVpnGateways operation using the VpnGatewaysPager.getNext() method - @Test - public void testListVpnGatewaysWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"members\":[{\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"private_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"policy\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"members\":[{\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"private_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"policy\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .sort("name") - .mode("policy") - .build(); - - List allResults = new ArrayList<>(); - VpnGatewaysPager pager = new VpnGatewaysPager(vpcService, listVpnGatewaysOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Test the removeVirtualNetworkInterfaceIp operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testRemoveVirtualNetworkInterfaceIpNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.removeVirtualNetworkInterfaceIp(null).execute(); } - - // Test the listVpnGateways operation using the VpnGatewaysPager.getAll() method - @Test - public void testListVpnGatewaysWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"members\":[{\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"private_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"policy\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"members\":[{\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"private_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"policy\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .sort("name") - .mode("policy") - .build(); - VpnGatewaysPager pager = new VpnGatewaysPager(vpcService, listVpnGatewaysOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createVpnGateway operation with a valid options model parameter + // Test the getVirtualNetworkInterfaceIp operation with a valid options model parameter @Test - public void testCreateVpnGatewayWOptions() throws Throwable { + public void testGetVirtualNetworkInterfaceIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"members\": [{\"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"private_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"policy\"}"; - String createVpnGatewayPath = "/vpn_gateways"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}"; + String getVirtualNetworkInterfaceIpPath = "/virtual_network_interfaces/testString/ips/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the VPNGatewayPrototypeVPNGatewayRouteModePrototype model - VPNGatewayPrototypeVPNGatewayRouteModePrototype vpnGatewayPrototypeModel = new VPNGatewayPrototypeVPNGatewayRouteModePrototype.Builder() - .name("my-vpn-gateway") - .resourceGroup(resourceGroupIdentityModel) - .subnet(subnetIdentityModel) - .mode("route") - .build(); - - // Construct an instance of the CreateVpnGatewayOptions model - CreateVpnGatewayOptions createVpnGatewayOptionsModel = new CreateVpnGatewayOptions.Builder() - .vpnGatewayPrototype(vpnGatewayPrototypeModel) + // Construct an instance of the GetVirtualNetworkInterfaceIpOptions model + GetVirtualNetworkInterfaceIpOptions getVirtualNetworkInterfaceIpOptionsModel = new GetVirtualNetworkInterfaceIpOptions.Builder() + .virtualNetworkInterfaceId("testString") + .id("testString") .build(); - // Invoke createVpnGateway() with a valid options model and verify the result - Response response = vpcService.createVpnGateway(createVpnGatewayOptionsModel).execute(); + // Invoke getVirtualNetworkInterfaceIp() with a valid options model and verify the result + Response response = vpcService.getVirtualNetworkInterfaceIp(getVirtualNetworkInterfaceIpOptionsModel).execute(); assertNotNull(response); - VPNGateway responseObj = response.getResult(); + ReservedIPReference responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpnGatewayPath); + assertEquals(parsedPath, getVirtualNetworkInterfaceIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpnGateway operation with and without retries enabled + // Test the getVirtualNetworkInterfaceIp operation with and without retries enabled @Test - public void testCreateVpnGatewayWRetries() throws Throwable { + public void testGetVirtualNetworkInterfaceIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpnGatewayWOptions(); + testGetVirtualNetworkInterfaceIpWOptions(); vpcService.disableRetries(); - testCreateVpnGatewayWOptions(); + testGetVirtualNetworkInterfaceIpWOptions(); } - // Test the createVpnGateway operation with a null options model (negative test) + // Test the getVirtualNetworkInterfaceIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpnGatewayNoOptions() throws Throwable { + public void testGetVirtualNetworkInterfaceIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpnGateway(null).execute(); + vpcService.getVirtualNetworkInterfaceIp(null).execute(); } - // Test the deleteVpnGateway operation with a valid options model parameter + // Test the addVirtualNetworkInterfaceIp operation with a valid options model parameter @Test - public void testDeleteVpnGatewayWOptions() throws Throwable { + public void testAddVirtualNetworkInterfaceIpWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteVpnGatewayPath = "/vpn_gateways/testString"; + String mockResponseBody = "{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}"; + String addVirtualNetworkInterfaceIpPath = "/virtual_network_interfaces/testString/ips/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpnGatewayOptions model - DeleteVpnGatewayOptions deleteVpnGatewayOptionsModel = new DeleteVpnGatewayOptions.Builder() + // Construct an instance of the AddVirtualNetworkInterfaceIpOptions model + AddVirtualNetworkInterfaceIpOptions addVirtualNetworkInterfaceIpOptionsModel = new AddVirtualNetworkInterfaceIpOptions.Builder() + .virtualNetworkInterfaceId("testString") .id("testString") .build(); - // Invoke deleteVpnGateway() with a valid options model and verify the result - Response response = vpcService.deleteVpnGateway(deleteVpnGatewayOptionsModel).execute(); + // Invoke addVirtualNetworkInterfaceIp() with a valid options model and verify the result + Response response = vpcService.addVirtualNetworkInterfaceIp(addVirtualNetworkInterfaceIpOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + ReservedIPReference responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpnGatewayPath); + assertEquals(parsedPath, addVirtualNetworkInterfaceIpPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpnGateway operation with and without retries enabled + // Test the addVirtualNetworkInterfaceIp operation with and without retries enabled @Test - public void testDeleteVpnGatewayWRetries() throws Throwable { + public void testAddVirtualNetworkInterfaceIpWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpnGatewayWOptions(); + testAddVirtualNetworkInterfaceIpWOptions(); vpcService.disableRetries(); - testDeleteVpnGatewayWOptions(); + testAddVirtualNetworkInterfaceIpWOptions(); } - // Test the deleteVpnGateway operation with a null options model (negative test) + // Test the addVirtualNetworkInterfaceIp operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpnGatewayNoOptions() throws Throwable { + public void testAddVirtualNetworkInterfaceIpNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpnGateway(null).execute(); + vpcService.addVirtualNetworkInterfaceIp(null).execute(); } - // Test the getVpnGateway operation with a valid options model parameter + // Test the listVolumeProfiles operation with a valid options model parameter @Test - public void testGetVpnGatewayWOptions() throws Throwable { + public void testListVolumeProfilesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"members\": [{\"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"private_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"policy\"}"; - String getVpnGatewayPath = "/vpn_gateways/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"adjustable_capacity_states\": {\"type\": \"enum\", \"values\": [\"attached\"]}, \"adjustable_iops_states\": {\"type\": \"enum\", \"values\": [\"attached\"]}, \"bandwidth\": {\"type\": \"fixed\", \"value\": 4000}, \"boot_capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"family\": \"tiered\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"iops\": {\"type\": \"fixed\", \"value\": 4000}, \"name\": \"general-purpose\", \"storage_generation\": {\"type\": \"fixed\", \"value\": 1}}], \"total_count\": 132}"; + String listVolumeProfilesPath = "/volume/profiles"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpnGatewayOptions model - GetVpnGatewayOptions getVpnGatewayOptionsModel = new GetVpnGatewayOptions.Builder() - .id("testString") + // Construct an instance of the ListVolumeProfilesOptions model + ListVolumeProfilesOptions listVolumeProfilesOptionsModel = new ListVolumeProfilesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke getVpnGateway() with a valid options model and verify the result - Response response = vpcService.getVpnGateway(getVpnGatewayOptionsModel).execute(); + // Invoke listVolumeProfiles() with a valid options model and verify the result + Response response = vpcService.listVolumeProfiles(listVolumeProfilesOptionsModel).execute(); assertNotNull(response); - VPNGateway responseObj = response.getResult(); + VolumeProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -27266,114 +28661,169 @@ public void testGetVpnGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpnGatewayPath); + assertEquals(parsedPath, listVolumeProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + } + + // Test the listVolumeProfiles operation with and without retries enabled + @Test + public void testListVolumeProfilesWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testListVolumeProfilesWOptions(); + + vpcService.disableRetries(); + testListVolumeProfilesWOptions(); + } + + // Test the listVolumeProfiles operation using the VolumeProfilesPager.getNext() method + @Test + public void testListVolumeProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"adjustable_capacity_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"adjustable_iops_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"bandwidth\":{\"type\":\"fixed\",\"value\":4000},\"boot_capacity\":{\"type\":\"fixed\",\"value\":4800},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"general-purpose\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"adjustable_capacity_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"adjustable_iops_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"bandwidth\":{\"type\":\"fixed\",\"value\":4000},\"boot_capacity\":{\"type\":\"fixed\",\"value\":4800},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"general-purpose\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + VolumeProfilesPager pager = new VolumeProfilesPager(vpcService, listVolumeProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } - - // Test the getVpnGateway operation with and without retries enabled + + // Test the listVolumeProfiles operation using the VolumeProfilesPager.getAll() method @Test - public void testGetVpnGatewayWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetVpnGatewayWOptions(); + public void testListVolumeProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"adjustable_capacity_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"adjustable_iops_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"bandwidth\":{\"type\":\"fixed\",\"value\":4000},\"boot_capacity\":{\"type\":\"fixed\",\"value\":4800},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"general-purpose\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"adjustable_capacity_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"adjustable_iops_states\":{\"type\":\"enum\",\"values\":[\"attached\"]},\"bandwidth\":{\"type\":\"fixed\",\"value\":4000},\"boot_capacity\":{\"type\":\"fixed\",\"value\":4800},\"capacity\":{\"type\":\"fixed\",\"value\":4800},\"family\":\"tiered\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"iops\":{\"type\":\"fixed\",\"value\":4000},\"name\":\"general-purpose\",\"storage_generation\":{\"type\":\"fixed\",\"value\":1}}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testGetVpnGatewayWOptions(); - } + ListVolumeProfilesOptions listVolumeProfilesOptions = new ListVolumeProfilesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); - // Test the getVpnGateway operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpnGatewayNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getVpnGateway(null).execute(); + VolumeProfilesPager pager = new VolumeProfilesPager(vpcService, listVolumeProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the updateVpnGateway operation with a valid options model parameter + + // Test the getVolumeProfile operation with a valid options model parameter @Test - public void testUpdateVpnGatewayWOptions() throws Throwable { + public void testGetVolumeProfileWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"members\": [{\"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"private_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"policy\"}"; - String updateVpnGatewayPath = "/vpn_gateways/testString"; + String mockResponseBody = "{\"adjustable_capacity_states\": {\"type\": \"enum\", \"values\": [\"attached\"]}, \"adjustable_iops_states\": {\"type\": \"enum\", \"values\": [\"attached\"]}, \"bandwidth\": {\"type\": \"fixed\", \"value\": 4000}, \"boot_capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"capacity\": {\"type\": \"fixed\", \"value\": 4800}, \"family\": \"tiered\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"iops\": {\"type\": \"fixed\", \"value\": 4000}, \"name\": \"general-purpose\", \"storage_generation\": {\"type\": \"fixed\", \"value\": 1}}"; + String getVolumeProfilePath = "/volume/profiles/10iops-tier"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VPNGatewayPatch model - VPNGatewayPatch vpnGatewayPatchModel = new VPNGatewayPatch.Builder() - .name("my-vpn-gateway-updated") - .build(); - Map vpnGatewayPatchModelAsPatch = vpnGatewayPatchModel.asPatch(); - - // Construct an instance of the UpdateVpnGatewayOptions model - UpdateVpnGatewayOptions updateVpnGatewayOptionsModel = new UpdateVpnGatewayOptions.Builder() - .id("testString") - .vpnGatewayPatch(vpnGatewayPatchModelAsPatch) + // Construct an instance of the GetVolumeProfileOptions model + GetVolumeProfileOptions getVolumeProfileOptionsModel = new GetVolumeProfileOptions.Builder() + .name("10iops-tier") .build(); - // Invoke updateVpnGateway() with a valid options model and verify the result - Response response = vpcService.updateVpnGateway(updateVpnGatewayOptionsModel).execute(); + // Invoke getVolumeProfile() with a valid options model and verify the result + Response response = vpcService.getVolumeProfile(getVolumeProfileOptionsModel).execute(); assertNotNull(response); - VPNGateway responseObj = response.getResult(); + VolumeProfile responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpnGatewayPath); + assertEquals(parsedPath, getVolumeProfilePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVpnGateway operation with and without retries enabled + // Test the getVolumeProfile operation with and without retries enabled @Test - public void testUpdateVpnGatewayWRetries() throws Throwable { + public void testGetVolumeProfileWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpnGatewayWOptions(); + testGetVolumeProfileWOptions(); vpcService.disableRetries(); - testUpdateVpnGatewayWOptions(); + testGetVolumeProfileWOptions(); } - // Test the updateVpnGateway operation with a null options model (negative test) + // Test the getVolumeProfile operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpnGatewayNoOptions() throws Throwable { + public void testGetVolumeProfileNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpnGateway(null).execute(); + vpcService.getVolumeProfile(null).execute(); } - // Test the listVpnGatewayConnections operation with a valid options model parameter + // Test the listVolumes operation with a valid options model parameter @Test - public void testListVpnGatewayConnectionsWOptions() throws Throwable { + public void testListVolumesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"connections\": [{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listVpnGatewayConnectionsPath = "/vpn_gateways/testString/connections"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"volumes\": [{\"active\": true, \"adjustable_capacity_states\": [\"attached\"], \"adjustable_iops_states\": [\"attached\"], \"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"attachment_state\": \"attached\", \"bandwidth\": 100, \"busy\": true, \"capacity\": 1000, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"health_reasons\": [{\"code\": \"initializing_from_snapshot\", \"message\": \"Performance will be degraded while this volume is being initialized from its snapshot\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"name\": \"general-purpose\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"volume\", \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"name\": \"my-volume-attachment\", \"type\": \"boot\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}]}"; + String listVolumesPath = "/volumes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpnGatewayConnectionsOptions model - ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptionsModel = new ListVpnGatewayConnectionsOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the ListVolumesOptions model + ListVolumesOptions listVolumesOptionsModel = new ListVolumesOptions.Builder() .start("testString") .limit(Long.valueOf("10")) - .status("down") + .attachmentState("attached") + .encryption("provider_managed") + .name("my-name") + .operatingSystemFamily("Ubuntu Server") + .operatingSystemArchitecture("amd64") + .tag("testString") + .zoneName("us-south-1") .build(); - // Invoke listVpnGatewayConnections() with a valid options model and verify the result - Response response = vpcService.listVpnGatewayConnections(listVpnGatewayConnectionsOptionsModel).execute(); + // Invoke listVolumes() with a valid options model and verify the result + Response response = vpcService.listVolumes(listVolumesOptionsModel).execute(); assertNotNull(response); - VPNGatewayConnectionCollection responseObj = response.getResult(); + VolumeCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -27382,40 +28832,39 @@ public void testListVpnGatewayConnectionsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpnGatewayConnectionsPath); + assertEquals(parsedPath, listVolumesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("status"), "down"); + assertEquals(query.get("attachment_state"), "attached"); + assertEquals(query.get("encryption"), "provider_managed"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("operating_system.family"), "Ubuntu Server"); + assertEquals(query.get("operating_system.architecture"), "amd64"); + assertEquals(query.get("tag"), "testString"); + assertEquals(query.get("zone.name"), "us-south-1"); } - // Test the listVpnGatewayConnections operation with and without retries enabled + // Test the listVolumes operation with and without retries enabled @Test - public void testListVpnGatewayConnectionsWRetries() throws Throwable { + public void testListVolumesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpnGatewayConnectionsWOptions(); + testListVolumesWOptions(); vpcService.disableRetries(); - testListVpnGatewayConnectionsWOptions(); - } - - // Test the listVpnGatewayConnections operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpnGatewayConnectionsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listVpnGatewayConnections(null).execute(); + testListVolumesWOptions(); } - // Test the listVpnGatewayConnections operation using the VpnGatewayConnectionsPager.getNext() method + // Test the listVolumes operation using the VolumesPager.getNext() method @Test - public void testListVpnGatewayConnectionsWithPagerGetNext() throws Throwable { + public void testListVolumesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"adjustable_capacity_states\":[\"attached\"],\"adjustable_iops_states\":[\"attached\"],\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"attachment_state\":\"attached\",\"bandwidth\":100,\"busy\":true,\"capacity\":1000,\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"health_reasons\":[{\"code\":\"initializing_from_snapshot\",\"message\":\"Performance will be degraded while this volume is being initialized from its snapshot\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"volume\",\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"adjustable_capacity_states\":[\"attached\"],\"adjustable_iops_states\":[\"attached\"],\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"attachment_state\":\"attached\",\"bandwidth\":100,\"busy\":true,\"capacity\":1000,\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"health_reasons\":[{\"code\":\"initializing_from_snapshot\",\"message\":\"Performance will be degraded while this volume is being initialized from its snapshot\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"volume\",\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -27429,28 +28878,33 @@ public void testListVpnGatewayConnectionsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions = new ListVpnGatewayConnectionsOptions.Builder() - .vpnGatewayId("testString") + ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() .limit(Long.valueOf("10")) - .status("down") + .attachmentState("attached") + .encryption("provider_managed") + .name("my-name") + .operatingSystemFamily("Ubuntu Server") + .operatingSystemArchitecture("amd64") + .tag("testString") + .zoneName("us-south-1") .build(); - List allResults = new ArrayList<>(); - VpnGatewayConnectionsPager pager = new VpnGatewayConnectionsPager(vpcService, listVpnGatewayConnectionsOptions); + List allResults = new ArrayList<>(); + VolumesPager pager = new VolumesPager(vpcService, listVolumesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listVpnGatewayConnections operation using the VpnGatewayConnectionsPager.getAll() method + // Test the listVolumes operation using the VolumesPager.getAll() method @Test - public void testListVpnGatewayConnectionsWithPagerGetAll() throws Throwable { + public void testListVolumesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"adjustable_capacity_states\":[\"attached\"],\"adjustable_iops_states\":[\"attached\"],\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"attachment_state\":\"attached\",\"bandwidth\":100,\"busy\":true,\"capacity\":1000,\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"health_reasons\":[{\"code\":\"initializing_from_snapshot\",\"message\":\"Performance will be degraded while this volume is being initialized from its snapshot\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"volume\",\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"volumes\":[{\"active\":true,\"adjustable_capacity_states\":[\"attached\"],\"adjustable_iops_states\":[\"attached\"],\"allowed_use\":{\"api_version\":\"2024-06-23\",\"bare_metal_server\":\"enable_secure_boot == true\",\"instance\":\"gpu.count > 0 && enable_secure_boot == true\"},\"attachment_state\":\"attached\",\"bandwidth\":100,\"busy\":true,\"capacity\":1000,\"catalog_offering\":{\"plan\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}},\"version\":{\"crn\":\"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"encryption\":\"provider_managed\",\"encryption_key\":{\"crn\":\"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"},\"health_reasons\":[{\"code\":\"initializing_from_snapshot\",\"message\":\"Performance will be degraded while this volume is being initialized from its snapshot\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"id\":\"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\",\"iops\":10000,\"name\":\"my-volume\",\"operating_system\":{\"allow_user_image_creation\":true,\"architecture\":\"amd64\",\"dedicated_host_only\":false,\"display_name\":\"Ubuntu Server 16.04 LTS amd64\",\"family\":\"Ubuntu Server\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\",\"name\":\"ubuntu-24-04-amd64\",\"user_data_format\":\"cloud_init\",\"vendor\":\"Canonical\",\"version\":\"16.04 LTS\"},\"profile\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\",\"name\":\"general-purpose\"},\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"volume\",\"source_image\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"id\":\"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\",\"name\":\"my-image\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"image\"},\"source_snapshot\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"id\":\"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\",\"name\":\"my-snapshot\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"snapshot\"},\"status\":\"available\",\"status_reasons\":[{\"code\":\"encryption_key_deleted\",\"message\":\"message\",\"more_info\":\"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}],\"storage_generation\":1,\"user_tags\":[\"userTags\"],\"volume_attachments\":[{\"delete_volume_on_instance_delete\":true,\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"device\":{\"id\":\"id\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"id\":\"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\",\"instance\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"id\":\"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\",\"name\":\"my-instance\"},\"name\":\"my-volume-attachment\",\"type\":\"boot\"}],\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -27464,88 +28918,76 @@ public void testListVpnGatewayConnectionsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions = new ListVpnGatewayConnectionsOptions.Builder() - .vpnGatewayId("testString") + ListVolumesOptions listVolumesOptions = new ListVolumesOptions.Builder() .limit(Long.valueOf("10")) - .status("down") + .attachmentState("attached") + .encryption("provider_managed") + .name("my-name") + .operatingSystemFamily("Ubuntu Server") + .operatingSystemArchitecture("amd64") + .tag("testString") + .zoneName("us-south-1") .build(); - VpnGatewayConnectionsPager pager = new VpnGatewayConnectionsPager(vpcService, listVpnGatewayConnectionsOptions); - List allResults = pager.getAll(); + VolumesPager pager = new VolumesPager(vpcService, listVolumesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createVpnGatewayConnection operation with a valid options model parameter + // Test the createVolume operation with a valid options model parameter @Test - public void testCreateVpnGatewayConnectionWOptions() throws Throwable { + public void testCreateVolumeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}"; - String createVpnGatewayConnectionPath = "/vpn_gateways/testString/connections"; + String mockResponseBody = "{\"active\": true, \"adjustable_capacity_states\": [\"attached\"], \"adjustable_iops_states\": [\"attached\"], \"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"attachment_state\": \"attached\", \"bandwidth\": 100, \"busy\": true, \"capacity\": 1000, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"health_reasons\": [{\"code\": \"initializing_from_snapshot\", \"message\": \"Performance will be degraded while this volume is being initialized from its snapshot\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"name\": \"general-purpose\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"volume\", \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"name\": \"my-volume-attachment\", \"type\": \"boot\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createVolumePath = "/volumes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the VPNGatewayConnectionDPDPrototype model - VPNGatewayConnectionDPDPrototype vpnGatewayConnectionDpdPrototypeModel = new VPNGatewayConnectionDPDPrototype.Builder() - .action("restart") - .interval(Long.valueOf("30")) - .timeout(Long.valueOf("120")) - .build(); - - // Construct an instance of the VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model - VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPrototypeModel = new VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.Builder() - .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") - .build(); - - // Construct an instance of the VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model - VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPrototypeModel = new VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.Builder() - .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") + // Construct an instance of the VolumeProfileIdentityByName model + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("custom") .build(); - // Construct an instance of the VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN model - VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN vpnGatewayConnectionIkeIdentityPrototypeModel = new VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN.Builder() - .type("fqdn") - .value("my-service.example.com") + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the VPNGatewayConnectionStaticRouteModeLocalPrototype model - VPNGatewayConnectionStaticRouteModeLocalPrototype vpnGatewayConnectionStaticRouteModeLocalPrototypeModel = new VPNGatewayConnectionStaticRouteModeLocalPrototype.Builder() - .ikeIdentities(java.util.Arrays.asList(vpnGatewayConnectionIkeIdentityPrototypeModel)) + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Construct an instance of the VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model - VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress vpnGatewayConnectionStaticRouteModePeerPrototypeModel = new VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.Builder() - .ikeIdentity(vpnGatewayConnectionIkeIdentityPrototypeModel) - .address("192.0.2.5") + // Construct an instance of the EncryptionKeyIdentityByCRN model + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); - // Construct an instance of the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model - VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype vpnGatewayConnectionPrototypeModel = new VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.Builder() - .adminStateUp(true) - .deadPeerDetection(vpnGatewayConnectionDpdPrototypeModel) - .establishMode("bidirectional") - .ikePolicy(vpnGatewayConnectionIkePolicyPrototypeModel) - .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPrototypeModel) - .name("my-vpn-gateway-connection") - .psk("lkj14b1oi0alcniejkso") - .distributeTraffic(false) - .local(vpnGatewayConnectionStaticRouteModeLocalPrototypeModel) - .peer(vpnGatewayConnectionStaticRouteModePeerPrototypeModel) - .routingProtocol("none") + // Construct an instance of the VolumePrototypeVolumeByCapacity model + VolumePrototypeVolumeByCapacity volumePrototypeModel = new VolumePrototypeVolumeByCapacity.Builder() + .bandwidth(Long.valueOf("1000")) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .resourceGroup(resourceGroupIdentityModel) + .userTags(java.util.Arrays.asList()) + .zone(zoneIdentityModel) + .capacity(Long.valueOf("100")) + .encryptionKey(encryptionKeyIdentityModel) .build(); - // Construct an instance of the CreateVpnGatewayConnectionOptions model - CreateVpnGatewayConnectionOptions createVpnGatewayConnectionOptionsModel = new CreateVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") - .vpnGatewayConnectionPrototype(vpnGatewayConnectionPrototypeModel) + // Construct an instance of the CreateVolumeOptions model + CreateVolumeOptions createVolumeOptionsModel = new CreateVolumeOptions.Builder() + .volumePrototype(volumePrototypeModel) .build(); - // Invoke createVpnGatewayConnection() with a valid options model and verify the result - Response response = vpcService.createVpnGatewayConnection(createVpnGatewayConnectionOptionsModel).execute(); + // Invoke createVolume() with a valid options model and verify the result + Response response = vpcService.createVolume(createVolumeOptionsModel).execute(); assertNotNull(response); - VPNGatewayConnection responseObj = response.getResult(); + Volume responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -27554,49 +28996,49 @@ public void testCreateVpnGatewayConnectionWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpnGatewayConnectionPath); + assertEquals(parsedPath, createVolumePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpnGatewayConnection operation with and without retries enabled + // Test the createVolume operation with and without retries enabled @Test - public void testCreateVpnGatewayConnectionWRetries() throws Throwable { + public void testCreateVolumeWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpnGatewayConnectionWOptions(); + testCreateVolumeWOptions(); vpcService.disableRetries(); - testCreateVpnGatewayConnectionWOptions(); + testCreateVolumeWOptions(); } - // Test the createVpnGatewayConnection operation with a null options model (negative test) + // Test the createVolume operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpnGatewayConnectionNoOptions() throws Throwable { + public void testCreateVolumeNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpnGatewayConnection(null).execute(); + vpcService.createVolume(null).execute(); } - // Test the deleteVpnGatewayConnection operation with a valid options model parameter + // Test the deleteVolume operation with a valid options model parameter @Test - public void testDeleteVpnGatewayConnectionWOptions() throws Throwable { + public void testDeleteVolumeWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteVpnGatewayConnectionPath = "/vpn_gateways/testString/connections/testString"; + String deleteVolumePath = "/volumes/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpnGatewayConnectionOptions model - DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptionsModel = new DeleteVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the DeleteVolumeOptions model + DeleteVolumeOptions deleteVolumeOptionsModel = new DeleteVolumeOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteVpnGatewayConnection() with a valid options model and verify the result - Response response = vpcService.deleteVpnGatewayConnection(deleteVpnGatewayConnectionOptionsModel).execute(); + // Invoke deleteVolume() with a valid options model and verify the result + Response response = vpcService.deleteVolume(deleteVolumeOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -27607,52 +29049,51 @@ public void testDeleteVpnGatewayConnectionWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpnGatewayConnectionPath); + assertEquals(parsedPath, deleteVolumePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpnGatewayConnection operation with and without retries enabled + // Test the deleteVolume operation with and without retries enabled @Test - public void testDeleteVpnGatewayConnectionWRetries() throws Throwable { + public void testDeleteVolumeWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpnGatewayConnectionWOptions(); + testDeleteVolumeWOptions(); vpcService.disableRetries(); - testDeleteVpnGatewayConnectionWOptions(); + testDeleteVolumeWOptions(); } - // Test the deleteVpnGatewayConnection operation with a null options model (negative test) + // Test the deleteVolume operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpnGatewayConnectionNoOptions() throws Throwable { + public void testDeleteVolumeNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpnGatewayConnection(null).execute(); + vpcService.deleteVolume(null).execute(); } - // Test the getVpnGatewayConnection operation with a valid options model parameter + // Test the getVolume operation with a valid options model parameter @Test - public void testGetVpnGatewayConnectionWOptions() throws Throwable { + public void testGetVolumeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}"; - String getVpnGatewayConnectionPath = "/vpn_gateways/testString/connections/testString"; + String mockResponseBody = "{\"active\": true, \"adjustable_capacity_states\": [\"attached\"], \"adjustable_iops_states\": [\"attached\"], \"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"attachment_state\": \"attached\", \"bandwidth\": 100, \"busy\": true, \"capacity\": 1000, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"health_reasons\": [{\"code\": \"initializing_from_snapshot\", \"message\": \"Performance will be degraded while this volume is being initialized from its snapshot\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"name\": \"general-purpose\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"volume\", \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"name\": \"my-volume-attachment\", \"type\": \"boot\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getVolumePath = "/volumes/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpnGatewayConnectionOptions model - GetVpnGatewayConnectionOptions getVpnGatewayConnectionOptionsModel = new GetVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the GetVolumeOptions model + GetVolumeOptions getVolumeOptionsModel = new GetVolumeOptions.Builder() .id("testString") .build(); - // Invoke getVpnGatewayConnection() with a valid options model and verify the result - Response response = vpcService.getVpnGatewayConnection(getVpnGatewayConnectionOptionsModel).execute(); + // Invoke getVolume() with a valid options model and verify the result + Response response = vpcService.getVolume(getVolumeOptionsModel).execute(); assertNotNull(response); - VPNGatewayConnection responseObj = response.getResult(); + Volume responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -27661,143 +29102,254 @@ public void testGetVpnGatewayConnectionWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpnGatewayConnectionPath); + assertEquals(parsedPath, getVolumePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpnGatewayConnection operation with and without retries enabled + // Test the getVolume operation with and without retries enabled @Test - public void testGetVpnGatewayConnectionWRetries() throws Throwable { + public void testGetVolumeWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpnGatewayConnectionWOptions(); + testGetVolumeWOptions(); vpcService.disableRetries(); - testGetVpnGatewayConnectionWOptions(); + testGetVolumeWOptions(); } - // Test the getVpnGatewayConnection operation with a null options model (negative test) + // Test the getVolume operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpnGatewayConnectionNoOptions() throws Throwable { + public void testGetVolumeNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpnGatewayConnection(null).execute(); + vpcService.getVolume(null).execute(); } - // Test the updateVpnGatewayConnection operation with a valid options model parameter + // Test the updateVolume operation with a valid options model parameter @Test - public void testUpdateVpnGatewayConnectionWOptions() throws Throwable { + public void testUpdateVolumeWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}"; - String updateVpnGatewayConnectionPath = "/vpn_gateways/testString/connections/testString"; + String mockResponseBody = "{\"active\": true, \"adjustable_capacity_states\": [\"attached\"], \"adjustable_iops_states\": [\"attached\"], \"allowed_use\": {\"api_version\": \"2024-06-23\", \"bare_metal_server\": \"enable_secure_boot == true\", \"instance\": \"gpu.count > 0 && enable_secure_boot == true\"}, \"attachment_state\": \"attached\", \"bandwidth\": 100, \"busy\": true, \"capacity\": 1000, \"catalog_offering\": {\"plan\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:51c9e0db-2911-45a6-adb0-ac5332d27cf2:plan:sw.51c9e0db-2911-45a6-adb0-ac5332d27cf2.772c0dbe-aa62-482e-adbe-a3fc20101e0e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}}, \"version\": {\"crn\": \"crn:v1:bluemix:public:globalcatalog-collection:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc:version:00111601-0ec5-41ac-b142-96d1e64e6442/ec66bec2-6a33-42d6-9323-26dd4dc8875d\"}}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::volume:r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"encryption\": \"provider_managed\", \"encryption_key\": {\"crn\": \"crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179\"}, \"health_reasons\": [{\"code\": \"initializing_from_snapshot\", \"message\": \"Performance will be degraded while this volume is being initialized from its snapshot\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-snapshots-vpc-troubleshooting&interface=ui#snapshot_ts_degraded_perf\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volumes/r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"id\": \"r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5\", \"iops\": 10000, \"name\": \"my-volume\", \"operating_system\": {\"allow_user_image_creation\": true, \"architecture\": \"amd64\", \"dedicated_host_only\": false, \"display_name\": \"Ubuntu Server 16.04 LTS amd64\", \"family\": \"Ubuntu Server\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-24-04-amd64\", \"name\": \"ubuntu-24-04-amd64\", \"user_data_format\": \"cloud_init\", \"vendor\": \"Canonical\", \"version\": \"16.04 LTS\"}, \"profile\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose\", \"name\": \"general-purpose\"}, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"volume\", \"source_image\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::image:r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/images/r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"id\": \"r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8\", \"name\": \"my-image\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"image\"}, \"source_snapshot\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/snapshots/r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"id\": \"r006-f6bfa329-0e36-433f-a3bb-0df632e79263\", \"name\": \"my-snapshot\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"snapshot\"}, \"status\": \"available\", \"status_reasons\": [{\"code\": \"encryption_key_deleted\", \"message\": \"message\", \"more_info\": \"https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys\"}], \"storage_generation\": 1, \"user_tags\": [\"userTags\"], \"volume_attachments\": [{\"delete_volume_on_instance_delete\": true, \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"device\": {\"id\": \"id\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"id\": \"0717-82cbf856-9cbb-45fb-b62f-d7bcef32399a\", \"instance\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"name\": \"my-volume-attachment\", \"type\": \"boot\"}], \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateVolumePath = "/volumes/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VPNGatewayConnectionDPDPatch model - VPNGatewayConnectionDPDPatch vpnGatewayConnectionDpdPatchModel = new VPNGatewayConnectionDPDPatch.Builder() - .action("restart") - .interval(Long.valueOf("30")) - .timeout(Long.valueOf("120")) + // Construct an instance of the VolumeAllowedUsePatch model + VolumeAllowedUsePatch volumeAllowedUsePatchModel = new VolumeAllowedUsePatch.Builder() + .apiVersion(version) + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") .build(); - // Construct an instance of the VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model - VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPatchModel = new VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.Builder() - .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") + // Construct an instance of the VolumeProfileIdentityByName model + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() + .name("general-purpose") .build(); - // Construct an instance of the VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model - VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPatchModel = new VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.Builder() - .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") + // Construct an instance of the VolumePatch model + VolumePatch volumePatchModel = new VolumePatch.Builder() + .allowedUse(volumeAllowedUsePatchModel) + .bandwidth(Long.valueOf("1000")) + .capacity(Long.valueOf("100")) + .iops(Long.valueOf("10000")) + .name("my-volume") + .profile(volumeProfileIdentityModel) + .userTags(java.util.Arrays.asList("testString")) .build(); + Map volumePatchModelAsPatch = volumePatchModel.asPatch(); - // Construct an instance of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model - VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch vpnGatewayConnectionPeerPatchModel = new VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch.Builder() - .address("192.0.2.5") + // Construct an instance of the UpdateVolumeOptions model + UpdateVolumeOptions updateVolumeOptionsModel = new UpdateVolumeOptions.Builder() + .id("testString") + .volumePatch(volumePatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Construct an instance of the VPNGatewayConnectionPatch model - VPNGatewayConnectionPatch vpnGatewayConnectionPatchModel = new VPNGatewayConnectionPatch.Builder() - .adminStateUp(true) - .deadPeerDetection(vpnGatewayConnectionDpdPatchModel) - .distributeTraffic(true) - .establishMode("bidirectional") - .ikePolicy(vpnGatewayConnectionIkePolicyPatchModel) - .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPatchModel) - .name("my-vpn-gateway-connection") - .peer(vpnGatewayConnectionPeerPatchModel) - .psk("lkj14b1oi0alcniejkso") - .build(); - Map vpnGatewayConnectionPatchModelAsPatch = vpnGatewayConnectionPatchModel.asPatch(); + // Invoke updateVolume() with a valid options model and verify the result + Response response = vpcService.updateVolume(updateVolumeOptionsModel).execute(); + assertNotNull(response); + Volume responseObj = response.getResult(); + assertNotNull(responseObj); - // Construct an instance of the UpdateVpnGatewayConnectionOptions model - UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOptionsModel = new UpdateVpnGatewayConnectionOptions.Builder() - .vpnGatewayId("testString") + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "PATCH"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateVolumePath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the updateVolume operation with and without retries enabled + @Test + public void testUpdateVolumeWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testUpdateVolumeWOptions(); + + vpcService.disableRetries(); + testUpdateVolumeWOptions(); + } + + // Test the updateVolume operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateVolumeNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.updateVolume(null).execute(); + } + + // Test the listVolumeInstanceProfiles operation with a valid options model parameter + @Test + public void testListVolumeInstanceProfilesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"instance_profiles\": [{\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\", \"name\": \"bx2-4x16\", \"resource_type\": \"instance_profile\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listVolumeInstanceProfilesPath = "/volumes/testString/instance_profiles"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListVolumeInstanceProfilesOptions model + ListVolumeInstanceProfilesOptions listVolumeInstanceProfilesOptionsModel = new ListVolumeInstanceProfilesOptions.Builder() .id("testString") - .vpnGatewayConnectionPatch(vpnGatewayConnectionPatchModelAsPatch) + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke updateVpnGatewayConnection() with a valid options model and verify the result - Response response = vpcService.updateVpnGatewayConnection(updateVpnGatewayConnectionOptionsModel).execute(); + // Invoke listVolumeInstanceProfiles() with a valid options model and verify the result + Response response = vpcService.listVolumeInstanceProfiles(listVolumeInstanceProfilesOptionsModel).execute(); assertNotNull(response); - VPNGatewayConnection responseObj = response.getResult(); + VolumeInstanceProfileCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpnGatewayConnectionPath); + assertEquals(parsedPath, listVolumeInstanceProfilesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the updateVpnGatewayConnection operation with and without retries enabled + // Test the listVolumeInstanceProfiles operation with and without retries enabled @Test - public void testUpdateVpnGatewayConnectionWRetries() throws Throwable { + public void testListVolumeInstanceProfilesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpnGatewayConnectionWOptions(); + testListVolumeInstanceProfilesWOptions(); vpcService.disableRetries(); - testUpdateVpnGatewayConnectionWOptions(); + testListVolumeInstanceProfilesWOptions(); } - // Test the updateVpnGatewayConnection operation with a null options model (negative test) + // Test the listVolumeInstanceProfiles operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpnGatewayConnectionNoOptions() throws Throwable { + public void testListVolumeInstanceProfilesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpnGatewayConnection(null).execute(); + vpcService.listVolumeInstanceProfiles(null).execute(); } - // Test the listVpnGatewayConnectionsLocalCidrs operation with a valid options model parameter + // Test the listVolumeInstanceProfiles operation using the VolumeInstanceProfilesPager.getNext() method @Test - public void testListVpnGatewayConnectionsLocalCidrsWOptions() throws Throwable { + public void testListVolumeInstanceProfilesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVolumeInstanceProfilesOptions listVolumeInstanceProfilesOptions = new ListVolumeInstanceProfilesOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + VolumeInstanceProfilesPager pager = new VolumeInstanceProfilesPager(vpcService, listVolumeInstanceProfilesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVolumeInstanceProfiles operation using the VolumeInstanceProfilesPager.getAll() method + @Test + public void testListVolumeInstanceProfilesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"instance_profiles\":[{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-4x16\",\"name\":\"bx2-4x16\",\"resource_type\":\"instance_profile\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVolumeInstanceProfilesOptions listVolumeInstanceProfilesOptions = new ListVolumeInstanceProfilesOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); + + VolumeInstanceProfilesPager pager = new VolumeInstanceProfilesPager(vpcService, listVolumeInstanceProfilesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the listVpcs operation with a valid options model parameter + @Test + public void testListVpcsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cidrs\": [\"192.0.2.0/24\"]}"; - String listVpnGatewayConnectionsLocalCidrsPath = "/vpn_gateways/testString/connections/testString/local/cidrs"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"vpcs\": [{\"classic_access\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"cse_source_ips\": [{\"ip\": {\"address\": \"192.168.3.4\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"default_network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"default_routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"default_security_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}, \"dns\": {\"enable_hub\": false, \"resolution_binding_count\": 0, \"resolver\": {\"servers\": [{\"address\": \"192.168.3.4\", \"zone_affinity\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"type\": \"delegated\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}}, \"health_reasons\": [{\"code\": \"dns_resolution_binding_failed\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"public_address_ranges\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"name\": \"my-public-address-range\", \"resource_type\": \"public_address_range\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpc\", \"status\": \"available\"}]}"; + String listVpcsPath = "/vpcs"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpnGatewayConnectionsLocalCidrsOptions model - ListVpnGatewayConnectionsLocalCidrsOptions listVpnGatewayConnectionsLocalCidrsOptionsModel = new ListVpnGatewayConnectionsLocalCidrsOptions.Builder() - .vpnGatewayId("testString") - .id("testString") + // Construct an instance of the ListVpcsOptions model + ListVpcsOptions listVpcsOptionsModel = new ListVpcsOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .classicAccess(true) .build(); - // Invoke listVpnGatewayConnectionsLocalCidrs() with a valid options model and verify the result - Response response = vpcService.listVpnGatewayConnectionsLocalCidrs(listVpnGatewayConnectionsLocalCidrsOptionsModel).execute(); + // Invoke listVpcs() with a valid options model and verify the result + Response response = vpcService.listVpcs(listVpcsOptionsModel).execute(); assertNotNull(response); - VPNGatewayConnectionCIDRs responseObj = response.getResult(); + VPCCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -27806,104 +29358,190 @@ public void testListVpnGatewayConnectionsLocalCidrsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpnGatewayConnectionsLocalCidrsPath); + assertEquals(parsedPath, listVpcsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(Boolean.valueOf(query.get("classic_access")), Boolean.valueOf(true)); } - // Test the listVpnGatewayConnectionsLocalCidrs operation with and without retries enabled + // Test the listVpcs operation with and without retries enabled @Test - public void testListVpnGatewayConnectionsLocalCidrsWRetries() throws Throwable { + public void testListVpcsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpnGatewayConnectionsLocalCidrsWOptions(); + testListVpcsWOptions(); vpcService.disableRetries(); - testListVpnGatewayConnectionsLocalCidrsWOptions(); + testListVpcsWOptions(); } - // Test the listVpnGatewayConnectionsLocalCidrs operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpnGatewayConnectionsLocalCidrsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listVpnGatewayConnectionsLocalCidrs(null).execute(); + // Test the listVpcs operation using the VpcsPager.getNext() method + @Test + public void testListVpcsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"dns\":{\"enable_hub\":false,\"resolution_binding_count\":0,\"resolver\":{\"servers\":[{\"address\":\"192.168.3.4\",\"zone_affinity\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"type\":\"delegated\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}},\"health_reasons\":[{\"code\":\"dns_resolution_binding_failed\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"public_address_ranges\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"name\":\"my-public-address-range\",\"resource_type\":\"public_address_range\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"dns\":{\"enable_hub\":false,\"resolution_binding_count\":0,\"resolver\":{\"servers\":[{\"address\":\"192.168.3.4\",\"zone_affinity\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"type\":\"delegated\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}},\"health_reasons\":[{\"code\":\"dns_resolution_binding_failed\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"public_address_ranges\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"name\":\"my-public-address-range\",\"resource_type\":\"public_address_range\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .classicAccess(true) + .build(); + + List allResults = new ArrayList<>(); + VpcsPager pager = new VpcsPager(vpcService, listVpcsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } + + // Test the listVpcs operation using the VpcsPager.getAll() method + @Test + public void testListVpcsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"dns\":{\"enable_hub\":false,\"resolution_binding_count\":0,\"resolver\":{\"servers\":[{\"address\":\"192.168.3.4\",\"zone_affinity\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"type\":\"delegated\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}},\"health_reasons\":[{\"code\":\"dns_resolution_binding_failed\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"public_address_ranges\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"name\":\"my-public-address-range\",\"resource_type\":\"public_address_range\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpcs\":[{\"classic_access\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"cse_source_ips\":[{\"ip\":{\"address\":\"192.168.3.4\"},\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"default_network_acl\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"id\":\"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\",\"name\":\"my-network-acl\"},\"default_routing_table\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"name\":\"my-routing-table-1\",\"resource_type\":\"routing_table\"},\"default_security_group\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"},\"dns\":{\"enable_hub\":false,\"resolution_binding_count\":0,\"resolver\":{\"servers\":[{\"address\":\"192.168.3.4\",\"zone_affinity\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"type\":\"delegated\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}},\"health_reasons\":[{\"code\":\"dns_resolution_binding_failed\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"public_address_ranges\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"id\":\"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\",\"name\":\"my-public-address-range\",\"resource_type\":\"public_address_range\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpc\",\"status\":\"available\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Test the removeVpnGatewayConnectionsLocalCidr operation with a valid options model parameter + ListVpcsOptions listVpcsOptions = new ListVpcsOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .classicAccess(true) + .build(); + + VpcsPager pager = new VpcsPager(vpcService, listVpcsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createVpc operation with a valid options model parameter @Test - public void testRemoveVpnGatewayConnectionsLocalCidrWOptions() throws Throwable { + public void testCreateVpcWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String removeVpnGatewayConnectionsLocalCidrPath = "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24"; + String mockResponseBody = "{\"classic_access\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"cse_source_ips\": [{\"ip\": {\"address\": \"192.168.3.4\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"default_network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"default_routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"default_security_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}, \"dns\": {\"enable_hub\": false, \"resolution_binding_count\": 0, \"resolver\": {\"servers\": [{\"address\": \"192.168.3.4\", \"zone_affinity\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"type\": \"delegated\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}}, \"health_reasons\": [{\"code\": \"dns_resolution_binding_failed\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"public_address_ranges\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"name\": \"my-public-address-range\", \"resource_type\": \"public_address_range\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpc\", \"status\": \"available\"}"; + String createVpcPath = "/vpcs"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the RemoveVpnGatewayConnectionsLocalCidrOptions model - RemoveVpnGatewayConnectionsLocalCidrOptions removeVpnGatewayConnectionsLocalCidrOptionsModel = new RemoveVpnGatewayConnectionsLocalCidrOptions.Builder() - .vpnGatewayId("testString") - .id("testString") - .cidr("192.168.1.0/24") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Invoke removeVpnGatewayConnectionsLocalCidr() with a valid options model and verify the result - Response response = vpcService.removeVpnGatewayConnectionsLocalCidr(removeVpnGatewayConnectionsLocalCidrOptionsModel).execute(); + // Construct an instance of the DNSServerPrototype model + DNSServerPrototype dnsServerPrototypeModel = new DNSServerPrototype.Builder() + .address("192.168.3.4") + .zoneAffinity(zoneIdentityModel) + .build(); + + // Construct an instance of the VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype model + VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype vpcdnsResolverPrototypeModel = new VPCDNSResolverPrototypeVPCDNSResolverTypeManualPrototype.Builder() + .manualServers(java.util.Arrays.asList(dnsServerPrototypeModel)) + .type("manual") + .build(); + + // Construct an instance of the VPCDNSPrototype model + VPCDNSPrototype vpcdnsPrototypeModel = new VPCDNSPrototype.Builder() + .enableHub(false) + .resolver(vpcdnsResolverPrototypeModel) + .build(); + + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") + .build(); + + // Construct an instance of the CreateVpcOptions model + CreateVpcOptions createVpcOptionsModel = new CreateVpcOptions.Builder() + .addressPrefixManagement("auto") + .classicAccess(false) + .dns(vpcdnsPrototypeModel) + .name("my-vpc") + .resourceGroup(resourceGroupIdentityModel) + .build(); + + // Invoke createVpc() with a valid options model and verify the result + Response response = vpcService.createVpc(createVpcOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + VPC responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, removeVpnGatewayConnectionsLocalCidrPath); + assertEquals(parsedPath, createVpcPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the removeVpnGatewayConnectionsLocalCidr operation with and without retries enabled + // Test the createVpc operation with and without retries enabled @Test - public void testRemoveVpnGatewayConnectionsLocalCidrWRetries() throws Throwable { + public void testCreateVpcWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testRemoveVpnGatewayConnectionsLocalCidrWOptions(); + testCreateVpcWOptions(); vpcService.disableRetries(); - testRemoveVpnGatewayConnectionsLocalCidrWOptions(); - } - - // Test the removeVpnGatewayConnectionsLocalCidr operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRemoveVpnGatewayConnectionsLocalCidrNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.removeVpnGatewayConnectionsLocalCidr(null).execute(); + testCreateVpcWOptions(); } - // Test the checkVpnGatewayConnectionsLocalCidr operation with a valid options model parameter + // Test the deleteVpc operation with a valid options model parameter @Test - public void testCheckVpnGatewayConnectionsLocalCidrWOptions() throws Throwable { + public void testDeleteVpcWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String checkVpnGatewayConnectionsLocalCidrPath = "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24"; + String deleteVpcPath = "/vpcs/testString"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the CheckVpnGatewayConnectionsLocalCidrOptions model - CheckVpnGatewayConnectionsLocalCidrOptions checkVpnGatewayConnectionsLocalCidrOptionsModel = new CheckVpnGatewayConnectionsLocalCidrOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the DeleteVpcOptions model + DeleteVpcOptions deleteVpcOptionsModel = new DeleteVpcOptions.Builder() .id("testString") - .cidr("192.168.1.0/24") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke checkVpnGatewayConnectionsLocalCidr() with a valid options model and verify the result - Response response = vpcService.checkVpnGatewayConnectionsLocalCidr(checkVpnGatewayConnectionsLocalCidrOptionsModel).execute(); + // Invoke deleteVpc() with a valid options model and verify the result + Response response = vpcService.deleteVpc(deleteVpcOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -27911,218 +29549,252 @@ public void testCheckVpnGatewayConnectionsLocalCidrWOptions() throws Throwable { // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, checkVpnGatewayConnectionsLocalCidrPath); + assertEquals(parsedPath, deleteVpcPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the checkVpnGatewayConnectionsLocalCidr operation with and without retries enabled + // Test the deleteVpc operation with and without retries enabled @Test - public void testCheckVpnGatewayConnectionsLocalCidrWRetries() throws Throwable { + public void testDeleteVpcWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCheckVpnGatewayConnectionsLocalCidrWOptions(); + testDeleteVpcWOptions(); vpcService.disableRetries(); - testCheckVpnGatewayConnectionsLocalCidrWOptions(); + testDeleteVpcWOptions(); } - // Test the checkVpnGatewayConnectionsLocalCidr operation with a null options model (negative test) + // Test the deleteVpc operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCheckVpnGatewayConnectionsLocalCidrNoOptions() throws Throwable { + public void testDeleteVpcNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.checkVpnGatewayConnectionsLocalCidr(null).execute(); + vpcService.deleteVpc(null).execute(); } - // Test the addVpnGatewayConnectionsLocalCidr operation with a valid options model parameter + // Test the getVpc operation with a valid options model parameter @Test - public void testAddVpnGatewayConnectionsLocalCidrWOptions() throws Throwable { + public void testGetVpcWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String addVpnGatewayConnectionsLocalCidrPath = "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.1.0%2F24"; + String mockResponseBody = "{\"classic_access\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"cse_source_ips\": [{\"ip\": {\"address\": \"192.168.3.4\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"default_network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"default_routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"default_security_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}, \"dns\": {\"enable_hub\": false, \"resolution_binding_count\": 0, \"resolver\": {\"servers\": [{\"address\": \"192.168.3.4\", \"zone_affinity\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"type\": \"delegated\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}}, \"health_reasons\": [{\"code\": \"dns_resolution_binding_failed\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"public_address_ranges\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"name\": \"my-public-address-range\", \"resource_type\": \"public_address_range\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpc\", \"status\": \"available\"}"; + String getVpcPath = "/vpcs/testString"; server.enqueue(new MockResponse() - .setResponseCode(201) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the AddVpnGatewayConnectionsLocalCidrOptions model - AddVpnGatewayConnectionsLocalCidrOptions addVpnGatewayConnectionsLocalCidrOptionsModel = new AddVpnGatewayConnectionsLocalCidrOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the GetVpcOptions model + GetVpcOptions getVpcOptionsModel = new GetVpcOptions.Builder() .id("testString") - .cidr("192.168.1.0/24") .build(); - // Invoke addVpnGatewayConnectionsLocalCidr() with a valid options model and verify the result - Response response = vpcService.addVpnGatewayConnectionsLocalCidr(addVpnGatewayConnectionsLocalCidrOptionsModel).execute(); + // Invoke getVpc() with a valid options model and verify the result + Response response = vpcService.getVpc(getVpcOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + VPC responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addVpnGatewayConnectionsLocalCidrPath); + assertEquals(parsedPath, getVpcPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the addVpnGatewayConnectionsLocalCidr operation with and without retries enabled + // Test the getVpc operation with and without retries enabled @Test - public void testAddVpnGatewayConnectionsLocalCidrWRetries() throws Throwable { + public void testGetVpcWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testAddVpnGatewayConnectionsLocalCidrWOptions(); + testGetVpcWOptions(); vpcService.disableRetries(); - testAddVpnGatewayConnectionsLocalCidrWOptions(); + testGetVpcWOptions(); } - // Test the addVpnGatewayConnectionsLocalCidr operation with a null options model (negative test) + // Test the getVpc operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddVpnGatewayConnectionsLocalCidrNoOptions() throws Throwable { + public void testGetVpcNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.addVpnGatewayConnectionsLocalCidr(null).execute(); + vpcService.getVpc(null).execute(); } - // Test the listVpnGatewayConnectionsPeerCidrs operation with a valid options model parameter + // Test the updateVpc operation with a valid options model parameter @Test - public void testListVpnGatewayConnectionsPeerCidrsWOptions() throws Throwable { + public void testUpdateVpcWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"cidrs\": [\"192.0.2.0/24\"]}"; - String listVpnGatewayConnectionsPeerCidrsPath = "/vpn_gateways/testString/connections/testString/peer/cidrs"; + String mockResponseBody = "{\"classic_access\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"cse_source_ips\": [{\"ip\": {\"address\": \"192.168.3.4\"}, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"default_network_acl\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"my-network-acl\"}, \"default_routing_table\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"name\": \"my-routing-table-1\", \"resource_type\": \"routing_table\"}, \"default_security_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}, \"dns\": {\"enable_hub\": false, \"resolution_binding_count\": 0, \"resolver\": {\"servers\": [{\"address\": \"192.168.3.4\", \"zone_affinity\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"type\": \"delegated\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}}, \"health_reasons\": [{\"code\": \"dns_resolution_binding_failed\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"public_address_ranges\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::public-address-range:r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/public_address_ranges/r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"id\": \"r006-a4841334-b584-4293-938e-3bc63b4a5b6a\", \"name\": \"my-public-address-range\", \"resource_type\": \"public_address_range\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpc\", \"status\": \"available\"}"; + String updateVpcPath = "/vpcs/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpnGatewayConnectionsPeerCidrsOptions model - ListVpnGatewayConnectionsPeerCidrsOptions listVpnGatewayConnectionsPeerCidrsOptionsModel = new ListVpnGatewayConnectionsPeerCidrsOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + // Construct an instance of the DNSServerPrototype model + DNSServerPrototype dnsServerPrototypeModel = new DNSServerPrototype.Builder() + .address("192.168.3.4") + .zoneAffinity(zoneIdentityModel) + .build(); + + // Construct an instance of the VPCDNSResolverVPCPatchVPCIdentityById model + VPCDNSResolverVPCPatchVPCIdentityById vpcdnsResolverVpcPatchModel = new VPCDNSResolverVPCPatchVPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + // Construct an instance of the VPCDNSResolverPatch model + VPCDNSResolverPatch vpcdnsResolverPatchModel = new VPCDNSResolverPatch.Builder() + .manualServers(java.util.Arrays.asList(dnsServerPrototypeModel)) + .type("delegated") + .vpc(vpcdnsResolverVpcPatchModel) + .build(); + + // Construct an instance of the VPCDNSPatch model + VPCDNSPatch vpcdnsPatchModel = new VPCDNSPatch.Builder() + .enableHub(true) + .resolver(vpcdnsResolverPatchModel) + .build(); + + // Construct an instance of the VPCPatch model + VPCPatch vpcPatchModel = new VPCPatch.Builder() + .dns(vpcdnsPatchModel) + .name("my-vpc") + .build(); + Map vpcPatchModelAsPatch = vpcPatchModel.asPatch(); + + // Construct an instance of the UpdateVpcOptions model + UpdateVpcOptions updateVpcOptionsModel = new UpdateVpcOptions.Builder() .id("testString") + .vpcPatch(vpcPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke listVpnGatewayConnectionsPeerCidrs() with a valid options model and verify the result - Response response = vpcService.listVpnGatewayConnectionsPeerCidrs(listVpnGatewayConnectionsPeerCidrsOptionsModel).execute(); + // Invoke updateVpc() with a valid options model and verify the result + Response response = vpcService.updateVpc(updateVpcOptionsModel).execute(); assertNotNull(response); - VPNGatewayConnectionCIDRs responseObj = response.getResult(); + VPC responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpnGatewayConnectionsPeerCidrsPath); + assertEquals(parsedPath, updateVpcPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listVpnGatewayConnectionsPeerCidrs operation with and without retries enabled + // Test the updateVpc operation with and without retries enabled @Test - public void testListVpnGatewayConnectionsPeerCidrsWRetries() throws Throwable { + public void testUpdateVpcWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpnGatewayConnectionsPeerCidrsWOptions(); + testUpdateVpcWOptions(); vpcService.disableRetries(); - testListVpnGatewayConnectionsPeerCidrsWOptions(); + testUpdateVpcWOptions(); } - // Test the listVpnGatewayConnectionsPeerCidrs operation with a null options model (negative test) + // Test the updateVpc operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpnGatewayConnectionsPeerCidrsNoOptions() throws Throwable { + public void testUpdateVpcNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listVpnGatewayConnectionsPeerCidrs(null).execute(); + vpcService.updateVpc(null).execute(); } - // Test the removeVpnGatewayConnectionsPeerCidr operation with a valid options model parameter + // Test the getVpcDefaultNetworkAcl operation with a valid options model parameter @Test - public void testRemoveVpnGatewayConnectionsPeerCidrWOptions() throws Throwable { + public void testGetVpcDefaultNetworkAclWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String removeVpnGatewayConnectionsPeerCidrPath = "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::network-acl:r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"id\": \"r006-a4e28308-8ee7-46ab-8108-9f881f22bdbf\", \"name\": \"mnemonic-ersatz-eatery-mythology\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"action\": \"allow\", \"before\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"name\": \"my-network-acl-rule\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/network_acls/r006-3217cb8b-5368-452a-9399-a84f14fb539d/rules/r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"id\": \"r006-8daca77a-4980-4d33-8f3e-7038797be8f9\", \"ip_version\": \"ipv4\", \"name\": \"my-network-acl-rule\", \"source\": \"192.168.3.0/24\", \"protocol\": \"any\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getVpcDefaultNetworkAclPath = "/vpcs/testString/default_network_acl"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the RemoveVpnGatewayConnectionsPeerCidrOptions model - RemoveVpnGatewayConnectionsPeerCidrOptions removeVpnGatewayConnectionsPeerCidrOptionsModel = new RemoveVpnGatewayConnectionsPeerCidrOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the GetVpcDefaultNetworkAclOptions model + GetVpcDefaultNetworkAclOptions getVpcDefaultNetworkAclOptionsModel = new GetVpcDefaultNetworkAclOptions.Builder() .id("testString") - .cidr("192.168.1.0/24") .build(); - // Invoke removeVpnGatewayConnectionsPeerCidr() with a valid options model and verify the result - Response response = vpcService.removeVpnGatewayConnectionsPeerCidr(removeVpnGatewayConnectionsPeerCidrOptionsModel).execute(); + // Invoke getVpcDefaultNetworkAcl() with a valid options model and verify the result + Response response = vpcService.getVpcDefaultNetworkAcl(getVpcDefaultNetworkAclOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + DefaultNetworkACL responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, removeVpnGatewayConnectionsPeerCidrPath); + assertEquals(parsedPath, getVpcDefaultNetworkAclPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the removeVpnGatewayConnectionsPeerCidr operation with and without retries enabled + // Test the getVpcDefaultNetworkAcl operation with and without retries enabled @Test - public void testRemoveVpnGatewayConnectionsPeerCidrWRetries() throws Throwable { + public void testGetVpcDefaultNetworkAclWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testRemoveVpnGatewayConnectionsPeerCidrWOptions(); + testGetVpcDefaultNetworkAclWOptions(); vpcService.disableRetries(); - testRemoveVpnGatewayConnectionsPeerCidrWOptions(); + testGetVpcDefaultNetworkAclWOptions(); } - // Test the removeVpnGatewayConnectionsPeerCidr operation with a null options model (negative test) + // Test the getVpcDefaultNetworkAcl operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testRemoveVpnGatewayConnectionsPeerCidrNoOptions() throws Throwable { + public void testGetVpcDefaultNetworkAclNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.removeVpnGatewayConnectionsPeerCidr(null).execute(); + vpcService.getVpcDefaultNetworkAcl(null).execute(); } - // Test the checkVpnGatewayConnectionsPeerCidr operation with a valid options model parameter + // Test the getVpcDefaultRoutingTable operation with a valid options model parameter @Test - public void testCheckVpnGatewayConnectionsPeerCidrWOptions() throws Throwable { + public void testGetVpcDefaultRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String checkVpnGatewayConnectionsPeerCidrPath = "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"milled-easy-equine-machines\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String getVpcDefaultRoutingTablePath = "/vpcs/testString/default_routing_table"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the CheckVpnGatewayConnectionsPeerCidrOptions model - CheckVpnGatewayConnectionsPeerCidrOptions checkVpnGatewayConnectionsPeerCidrOptionsModel = new CheckVpnGatewayConnectionsPeerCidrOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the GetVpcDefaultRoutingTableOptions model + GetVpcDefaultRoutingTableOptions getVpcDefaultRoutingTableOptionsModel = new GetVpcDefaultRoutingTableOptions.Builder() .id("testString") - .cidr("192.168.1.0/24") .build(); - // Invoke checkVpnGatewayConnectionsPeerCidr() with a valid options model and verify the result - Response response = vpcService.checkVpnGatewayConnectionsPeerCidr(checkVpnGatewayConnectionsPeerCidrOptionsModel).execute(); + // Invoke getVpcDefaultRoutingTable() with a valid options model and verify the result + Response response = vpcService.getVpcDefaultRoutingTable(getVpcDefaultRoutingTableOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + DefaultRoutingTable responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -28130,109 +29802,106 @@ public void testCheckVpnGatewayConnectionsPeerCidrWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, checkVpnGatewayConnectionsPeerCidrPath); + assertEquals(parsedPath, getVpcDefaultRoutingTablePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the checkVpnGatewayConnectionsPeerCidr operation with and without retries enabled + // Test the getVpcDefaultRoutingTable operation with and without retries enabled @Test - public void testCheckVpnGatewayConnectionsPeerCidrWRetries() throws Throwable { + public void testGetVpcDefaultRoutingTableWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCheckVpnGatewayConnectionsPeerCidrWOptions(); + testGetVpcDefaultRoutingTableWOptions(); vpcService.disableRetries(); - testCheckVpnGatewayConnectionsPeerCidrWOptions(); + testGetVpcDefaultRoutingTableWOptions(); } - // Test the checkVpnGatewayConnectionsPeerCidr operation with a null options model (negative test) + // Test the getVpcDefaultRoutingTable operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCheckVpnGatewayConnectionsPeerCidrNoOptions() throws Throwable { + public void testGetVpcDefaultRoutingTableNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.checkVpnGatewayConnectionsPeerCidr(null).execute(); + vpcService.getVpcDefaultRoutingTable(null).execute(); } - // Test the addVpnGatewayConnectionsPeerCidr operation with a valid options model parameter + // Test the getVpcDefaultSecurityGroup operation with a valid options model parameter @Test - public void testAddVpnGatewayConnectionsPeerCidrWOptions() throws Throwable { + public void testGetVpcDefaultSecurityGroupWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String addVpnGatewayConnectionsPeerCidrPath = "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.1.0%2F24"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"observant-chip-emphatic-engraver\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"rules\": [{\"direction\": \"inbound\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"id\": \"r006-6f2a6efe-21e2-401c-b237-620aa26ba16a\", \"ip_version\": \"ipv4\", \"local\": {\"address\": \"192.168.3.4\"}, \"name\": \"my-security-group-rule\", \"remote\": {\"address\": \"192.168.3.4\"}, \"resource_type\": \"security_group_rule\", \"protocol\": \"any\"}], \"targets\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/0717-aad10fd7-8a02-4f3e-97f3-b18bd82cf304/network_interfaces/0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"id\": \"0717-da8c43ec-b6ca-4bd2-871e-72e288c66ee6\", \"name\": \"my-bare-metal-server-network-interface\", \"resource_type\": \"network_interface\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getVpcDefaultSecurityGroupPath = "/vpcs/testString/default_security_group"; server.enqueue(new MockResponse() - .setResponseCode(201) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the AddVpnGatewayConnectionsPeerCidrOptions model - AddVpnGatewayConnectionsPeerCidrOptions addVpnGatewayConnectionsPeerCidrOptionsModel = new AddVpnGatewayConnectionsPeerCidrOptions.Builder() - .vpnGatewayId("testString") + // Construct an instance of the GetVpcDefaultSecurityGroupOptions model + GetVpcDefaultSecurityGroupOptions getVpcDefaultSecurityGroupOptionsModel = new GetVpcDefaultSecurityGroupOptions.Builder() .id("testString") - .cidr("192.168.1.0/24") .build(); - // Invoke addVpnGatewayConnectionsPeerCidr() with a valid options model and verify the result - Response response = vpcService.addVpnGatewayConnectionsPeerCidr(addVpnGatewayConnectionsPeerCidrOptionsModel).execute(); + // Invoke getVpcDefaultSecurityGroup() with a valid options model and verify the result + Response response = vpcService.getVpcDefaultSecurityGroup(getVpcDefaultSecurityGroupOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + DefaultSecurityGroup responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addVpnGatewayConnectionsPeerCidrPath); + assertEquals(parsedPath, getVpcDefaultSecurityGroupPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the addVpnGatewayConnectionsPeerCidr operation with and without retries enabled + // Test the getVpcDefaultSecurityGroup operation with and without retries enabled @Test - public void testAddVpnGatewayConnectionsPeerCidrWRetries() throws Throwable { + public void testGetVpcDefaultSecurityGroupWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testAddVpnGatewayConnectionsPeerCidrWOptions(); + testGetVpcDefaultSecurityGroupWOptions(); vpcService.disableRetries(); - testAddVpnGatewayConnectionsPeerCidrWOptions(); + testGetVpcDefaultSecurityGroupWOptions(); } - // Test the addVpnGatewayConnectionsPeerCidr operation with a null options model (negative test) + // Test the getVpcDefaultSecurityGroup operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddVpnGatewayConnectionsPeerCidrNoOptions() throws Throwable { + public void testGetVpcDefaultSecurityGroupNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.addVpnGatewayConnectionsPeerCidr(null).execute(); + vpcService.getVpcDefaultSecurityGroup(null).execute(); } - // Test the listVpnServers operation with a valid options model parameter + // Test the listVpcAddressPrefixes operation with a valid options model parameter @Test - public void testListVpnServersWOptions() throws Throwable { + public void testListVpcAddressPrefixesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"vpn_servers\": [{\"certificate\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"client_authentication\": [{\"method\": \"certificate\", \"identity_provider\": {\"provider_type\": \"iam\"}}], \"client_auto_delete\": true, \"client_auto_delete_timeout\": 1, \"client_dns_server_ips\": [{\"address\": \"192.168.3.4\"}], \"client_idle_timeout\": 600, \"client_ip_pool\": \"172.16.0.0/16\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"enable_split_tunneling\": true, \"health_reasons\": [{\"code\": \"cannot_access_server_certificate\", \"message\": \"Failed to get VPN server's server certificate from Secrets Manager.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}], \"health_state\": \"ok\", \"hostname\": \"a8506291.us-south.vpn-server.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"id\": \"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-server\", \"port\": 443, \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"protocol\": \"tcp\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_server\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}]}"; - String listVpnServersPath = "/vpn_servers"; + String mockResponseBody = "{\"address_prefixes\": [{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"has_subnets\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"id\": \"r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"is_default\": false, \"name\": \"my-vpc-address-prefix-zone-1\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listVpcAddressPrefixesPath = "/vpcs/testString/address_prefixes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpnServersOptions model - ListVpnServersOptions listVpnServersOptionsModel = new ListVpnServersOptions.Builder() - .name("my-name") + // Construct an instance of the ListVpcAddressPrefixesOptions model + ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptionsModel = new ListVpcAddressPrefixesOptions.Builder() + .vpcId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .sort("name") .build(); - // Invoke listVpnServers() with a valid options model and verify the result - Response response = vpcService.listVpnServers(listVpnServersOptionsModel).execute(); + // Invoke listVpcAddressPrefixes() with a valid options model and verify the result + Response response = vpcService.listVpcAddressPrefixes(listVpcAddressPrefixesOptionsModel).execute(); assertNotNull(response); - VPNServerCollection responseObj = response.getResult(); + AddressPrefixCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -28241,35 +29910,39 @@ public void testListVpnServersWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpnServersPath); + assertEquals(parsedPath, listVpcAddressPrefixesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("name"), "my-name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("sort"), "name"); } - // Test the listVpnServers operation with and without retries enabled + // Test the listVpcAddressPrefixes operation with and without retries enabled @Test - public void testListVpnServersWRetries() throws Throwable { + public void testListVpcAddressPrefixesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpnServersWOptions(); + testListVpcAddressPrefixesWOptions(); vpcService.disableRetries(); - testListVpnServersWOptions(); + testListVpcAddressPrefixesWOptions(); } - // Test the listVpnServers operation using the VpnServersPager.getNext() method + // Test the listVpcAddressPrefixes operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListVpcAddressPrefixesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listVpcAddressPrefixes(null).execute(); + } + + // Test the listVpcAddressPrefixes operation using the VpcAddressPrefixesPager.getNext() method @Test - public void testListVpnServersWithPagerGetNext() throws Throwable { + public void testListVpcAddressPrefixesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"enable_split_tunneling\":true,\"health_reasons\":[{\"code\":\"cannot_access_server_certificate\",\"message\":\"Failed to get VPN server's server certificate from Secrets Manager.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}],\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"id\":\"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"tcp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"enable_split_tunneling\":true,\"health_reasons\":[{\"code\":\"cannot_access_server_certificate\",\"message\":\"Failed to get VPN server's server certificate from Secrets Manager.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}],\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"id\":\"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"tcp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"id\":\"r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"is_default\":false,\"name\":\"my-vpc-address-prefix-zone-1\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"id\":\"r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"is_default\":false,\"name\":\"my-vpc-address-prefix-zone-1\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -28283,29 +29956,27 @@ public void testListVpnServersWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() - .name("my-name") + ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() + .vpcId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .sort("name") .build(); - List allResults = new ArrayList<>(); - VpnServersPager pager = new VpnServersPager(vpcService, listVpnServersOptions); + List allResults = new ArrayList<>(); + VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(vpcService, listVpcAddressPrefixesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listVpnServers operation using the VpnServersPager.getAll() method + // Test the listVpcAddressPrefixes operation using the VpcAddressPrefixesPager.getAll() method @Test - public void testListVpnServersWithPagerGetAll() throws Throwable { + public void testListVpcAddressPrefixesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"enable_split_tunneling\":true,\"health_reasons\":[{\"code\":\"cannot_access_server_certificate\",\"message\":\"Failed to get VPN server's server certificate from Secrets Manager.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}],\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"id\":\"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"tcp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"enable_split_tunneling\":true,\"health_reasons\":[{\"code\":\"cannot_access_server_certificate\",\"message\":\"Failed to get VPN server's server certificate from Secrets Manager.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}],\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"id\":\"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"tcp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"id\":\"r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"is_default\":false,\"name\":\"my-vpc-address-prefix-zone-1\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"address_prefixes\":[{\"cidr\":\"192.168.3.0/24\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"has_subnets\":true,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"id\":\"r006-68574057-c5e0-4675-ada4-99377d8f4789\",\"is_default\":false,\"name\":\"my-vpc-address-prefix-zone-1\",\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -28319,86 +29990,46 @@ public void testListVpnServersWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() - .name("my-name") + ListVpcAddressPrefixesOptions listVpcAddressPrefixesOptions = new ListVpcAddressPrefixesOptions.Builder() + .vpcId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .sort("name") .build(); - VpnServersPager pager = new VpnServersPager(vpcService, listVpnServersOptions); - List allResults = pager.getAll(); + VpcAddressPrefixesPager pager = new VpcAddressPrefixesPager(vpcService, listVpcAddressPrefixesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createVpnServer operation with a valid options model parameter + // Test the createVpcAddressPrefix operation with a valid options model parameter @Test - public void testCreateVpnServerWOptions() throws Throwable { + public void testCreateVpcAddressPrefixWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"certificate\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"client_authentication\": [{\"method\": \"certificate\", \"identity_provider\": {\"provider_type\": \"iam\"}}], \"client_auto_delete\": true, \"client_auto_delete_timeout\": 1, \"client_dns_server_ips\": [{\"address\": \"192.168.3.4\"}], \"client_idle_timeout\": 600, \"client_ip_pool\": \"172.16.0.0/16\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"enable_split_tunneling\": true, \"health_reasons\": [{\"code\": \"cannot_access_server_certificate\", \"message\": \"Failed to get VPN server's server certificate from Secrets Manager.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}], \"health_state\": \"ok\", \"hostname\": \"a8506291.us-south.vpn-server.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"id\": \"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-server\", \"port\": 443, \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"protocol\": \"tcp\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_server\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String createVpnServerPath = "/vpn_servers"; + String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"has_subnets\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"id\": \"r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"is_default\": false, \"name\": \"my-vpc-address-prefix-zone-1\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createVpcAddressPrefixPath = "/vpcs/testString/address_prefixes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the CertificateInstanceIdentityByCRN model - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - // Construct an instance of the VPNServerAuthenticationByUsernameIdProviderByIAM model - VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() - .providerType("iam") - .build(); - - // Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() - .method("username") - .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the IP model - IP ipModel = new IP.Builder() - .address("192.168.3.4") - .build(); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Construct an instance of the CreateVpnServerOptions model - CreateVpnServerOptions createVpnServerOptionsModel = new CreateVpnServerOptions.Builder() - .certificate(certificateInstanceIdentityModel) - .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) - .clientIpPool("172.16.0.0/16") - .subnets(java.util.Arrays.asList(subnetIdentityModel)) - .clientDnsServerIps(java.util.Arrays.asList(ipModel)) - .clientIdleTimeout(Long.valueOf("600")) - .enableSplitTunneling(false) - .name("my-vpn-server") - .port(Long.valueOf("443")) - .protocol("udp") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + // Construct an instance of the CreateVpcAddressPrefixOptions model + CreateVpcAddressPrefixOptions createVpcAddressPrefixOptionsModel = new CreateVpcAddressPrefixOptions.Builder() + .vpcId("testString") + .cidr("10.240.0.0/18") + .zone(zoneIdentityModel) + .isDefault(true) + .name("my-vpc-address-prefix-zone-1") .build(); - // Invoke createVpnServer() with a valid options model and verify the result - Response response = vpcService.createVpnServer(createVpnServerOptionsModel).execute(); + // Invoke createVpcAddressPrefix() with a valid options model and verify the result + Response response = vpcService.createVpcAddressPrefix(createVpcAddressPrefixOptionsModel).execute(); assertNotNull(response); - VPNServer responseObj = response.getResult(); + AddressPrefix responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -28407,49 +30038,49 @@ public void testCreateVpnServerWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpnServerPath); + assertEquals(parsedPath, createVpcAddressPrefixPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpnServer operation with and without retries enabled + // Test the createVpcAddressPrefix operation with and without retries enabled @Test - public void testCreateVpnServerWRetries() throws Throwable { + public void testCreateVpcAddressPrefixWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpnServerWOptions(); + testCreateVpcAddressPrefixWOptions(); vpcService.disableRetries(); - testCreateVpnServerWOptions(); + testCreateVpcAddressPrefixWOptions(); } - // Test the createVpnServer operation with a null options model (negative test) + // Test the createVpcAddressPrefix operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpnServerNoOptions() throws Throwable { + public void testCreateVpcAddressPrefixNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpnServer(null).execute(); + vpcService.createVpcAddressPrefix(null).execute(); } - // Test the deleteVpnServer operation with a valid options model parameter + // Test the deleteVpcAddressPrefix operation with a valid options model parameter @Test - public void testDeleteVpnServerWOptions() throws Throwable { + public void testDeleteVpcAddressPrefixWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteVpnServerPath = "/vpn_servers/testString"; + String deleteVpcAddressPrefixPath = "/vpcs/testString/address_prefixes/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpnServerOptions model - DeleteVpnServerOptions deleteVpnServerOptionsModel = new DeleteVpnServerOptions.Builder() + // Construct an instance of the DeleteVpcAddressPrefixOptions model + DeleteVpcAddressPrefixOptions deleteVpcAddressPrefixOptionsModel = new DeleteVpcAddressPrefixOptions.Builder() + .vpcId("testString") .id("testString") - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteVpnServer() with a valid options model and verify the result - Response response = vpcService.deleteVpnServer(deleteVpnServerOptionsModel).execute(); + // Invoke deleteVpcAddressPrefix() with a valid options model and verify the result + Response response = vpcService.deleteVpcAddressPrefix(deleteVpcAddressPrefixOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -28460,51 +30091,52 @@ public void testDeleteVpnServerWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpnServerPath); + assertEquals(parsedPath, deleteVpcAddressPrefixPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpnServer operation with and without retries enabled + // Test the deleteVpcAddressPrefix operation with and without retries enabled @Test - public void testDeleteVpnServerWRetries() throws Throwable { + public void testDeleteVpcAddressPrefixWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpnServerWOptions(); + testDeleteVpcAddressPrefixWOptions(); vpcService.disableRetries(); - testDeleteVpnServerWOptions(); + testDeleteVpcAddressPrefixWOptions(); } - // Test the deleteVpnServer operation with a null options model (negative test) + // Test the deleteVpcAddressPrefix operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpnServerNoOptions() throws Throwable { + public void testDeleteVpcAddressPrefixNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpnServer(null).execute(); + vpcService.deleteVpcAddressPrefix(null).execute(); } - // Test the getVpnServer operation with a valid options model parameter + // Test the getVpcAddressPrefix operation with a valid options model parameter @Test - public void testGetVpnServerWOptions() throws Throwable { + public void testGetVpcAddressPrefixWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"certificate\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"client_authentication\": [{\"method\": \"certificate\", \"identity_provider\": {\"provider_type\": \"iam\"}}], \"client_auto_delete\": true, \"client_auto_delete_timeout\": 1, \"client_dns_server_ips\": [{\"address\": \"192.168.3.4\"}], \"client_idle_timeout\": 600, \"client_ip_pool\": \"172.16.0.0/16\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"enable_split_tunneling\": true, \"health_reasons\": [{\"code\": \"cannot_access_server_certificate\", \"message\": \"Failed to get VPN server's server certificate from Secrets Manager.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}], \"health_state\": \"ok\", \"hostname\": \"a8506291.us-south.vpn-server.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"id\": \"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-server\", \"port\": 443, \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"protocol\": \"tcp\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_server\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getVpnServerPath = "/vpn_servers/testString"; + String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"has_subnets\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"id\": \"r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"is_default\": false, \"name\": \"my-vpc-address-prefix-zone-1\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getVpcAddressPrefixPath = "/vpcs/testString/address_prefixes/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpnServerOptions model - GetVpnServerOptions getVpnServerOptionsModel = new GetVpnServerOptions.Builder() + // Construct an instance of the GetVpcAddressPrefixOptions model + GetVpcAddressPrefixOptions getVpcAddressPrefixOptionsModel = new GetVpcAddressPrefixOptions.Builder() + .vpcId("testString") .id("testString") .build(); - // Invoke getVpnServer() with a valid options model and verify the result - Response response = vpcService.getVpnServer(getVpnServerOptionsModel).execute(); + // Invoke getVpcAddressPrefix() with a valid options model and verify the result + Response response = vpcService.getVpcAddressPrefix(getVpcAddressPrefixOptionsModel).execute(); assertNotNull(response); - VPNServer responseObj = response.getResult(); + AddressPrefix responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -28513,94 +30145,60 @@ public void testGetVpnServerWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpnServerPath); + assertEquals(parsedPath, getVpcAddressPrefixPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpnServer operation with and without retries enabled + // Test the getVpcAddressPrefix operation with and without retries enabled @Test - public void testGetVpnServerWRetries() throws Throwable { + public void testGetVpcAddressPrefixWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpnServerWOptions(); + testGetVpcAddressPrefixWOptions(); vpcService.disableRetries(); - testGetVpnServerWOptions(); + testGetVpcAddressPrefixWOptions(); } - // Test the getVpnServer operation with a null options model (negative test) + // Test the getVpcAddressPrefix operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpnServerNoOptions() throws Throwable { + public void testGetVpcAddressPrefixNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpnServer(null).execute(); + vpcService.getVpcAddressPrefix(null).execute(); } - // Test the updateVpnServer operation with a valid options model parameter + // Test the updateVpcAddressPrefix operation with a valid options model parameter @Test - public void testUpdateVpnServerWOptions() throws Throwable { + public void testUpdateVpcAddressPrefixWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"certificate\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"client_authentication\": [{\"method\": \"certificate\", \"identity_provider\": {\"provider_type\": \"iam\"}}], \"client_auto_delete\": true, \"client_auto_delete_timeout\": 1, \"client_dns_server_ips\": [{\"address\": \"192.168.3.4\"}], \"client_idle_timeout\": 600, \"client_ip_pool\": \"172.16.0.0/16\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"enable_split_tunneling\": true, \"health_reasons\": [{\"code\": \"cannot_access_server_certificate\", \"message\": \"Failed to get VPN server's server certificate from Secrets Manager.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}], \"health_state\": \"ok\", \"hostname\": \"a8506291.us-south.vpn-server.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"id\": \"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-server\", \"port\": 443, \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"protocol\": \"tcp\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_server\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String updateVpnServerPath = "/vpn_servers/testString"; + String mockResponseBody = "{\"cidr\": \"192.168.3.0/24\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"has_subnets\": true, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/address_prefixes/r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"id\": \"r006-68574057-c5e0-4675-ada4-99377d8f4789\", \"is_default\": false, \"name\": \"my-vpc-address-prefix-zone-1\", \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateVpcAddressPrefixPath = "/vpcs/testString/address_prefixes/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the CertificateInstanceIdentityByCRN model - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - // Construct an instance of the VPNServerAuthenticationByUsernameIdProviderByIAM model - VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() - .providerType("iam") - .build(); - - // Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model - VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() - .method("username") - .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) - .build(); - - // Construct an instance of the IP model - IP ipModel = new IP.Builder() - .address("192.168.3.4") - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the VPNServerPatch model - VPNServerPatch vpnServerPatchModel = new VPNServerPatch.Builder() - .certificate(certificateInstanceIdentityModel) - .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) - .clientDnsServerIps(java.util.Arrays.asList(ipModel)) - .clientIdleTimeout(Long.valueOf("600")) - .clientIpPool("172.16.0.0/16") - .enableSplitTunneling(true) - .name("my-vpn-server-updated") - .port(Long.valueOf("443")) - .protocol("tcp") - .subnets(java.util.Arrays.asList(subnetIdentityModel)) + // Construct an instance of the AddressPrefixPatch model + AddressPrefixPatch addressPrefixPatchModel = new AddressPrefixPatch.Builder() + .isDefault(false) + .name("my-vpc-address-prefix-updated") .build(); - Map vpnServerPatchModelAsPatch = vpnServerPatchModel.asPatch(); + Map addressPrefixPatchModelAsPatch = addressPrefixPatchModel.asPatch(); - // Construct an instance of the UpdateVpnServerOptions model - UpdateVpnServerOptions updateVpnServerOptionsModel = new UpdateVpnServerOptions.Builder() + // Construct an instance of the UpdateVpcAddressPrefixOptions model + UpdateVpcAddressPrefixOptions updateVpcAddressPrefixOptionsModel = new UpdateVpcAddressPrefixOptions.Builder() + .vpcId("testString") .id("testString") - .vpnServerPatch(vpnServerPatchModelAsPatch) - .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") + .addressPrefixPatch(addressPrefixPatchModelAsPatch) .build(); - // Invoke updateVpnServer() with a valid options model and verify the result - Response response = vpcService.updateVpnServer(updateVpnServerOptionsModel).execute(); + // Invoke updateVpcAddressPrefix() with a valid options model and verify the result + Response response = vpcService.updateVpcAddressPrefix(updateVpcAddressPrefixOptionsModel).execute(); assertNotNull(response); - VPNServer responseObj = response.getResult(); + AddressPrefix responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -28609,107 +30207,58 @@ public void testUpdateVpnServerWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpnServerPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the updateVpnServer operation with and without retries enabled - @Test - public void testUpdateVpnServerWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testUpdateVpnServerWOptions(); - - vpcService.disableRetries(); - testUpdateVpnServerWOptions(); - } - - // Test the updateVpnServer operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpnServerNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.updateVpnServer(null).execute(); - } - - // Test the getVpnServerClientConfiguration operation with a valid options model parameter - @Test - public void testGetVpnServerClientConfigurationWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "\"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n\""; - String getVpnServerClientConfigurationPath = "/vpn_servers/testString/client_configuration"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "text/plain") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetVpnServerClientConfigurationOptions model - GetVpnServerClientConfigurationOptions getVpnServerClientConfigurationOptionsModel = new GetVpnServerClientConfigurationOptions.Builder() - .id("testString") - .build(); - - // Invoke getVpnServerClientConfiguration() with a valid options model and verify the result - Response response = vpcService.getVpnServerClientConfiguration(getVpnServerClientConfigurationOptionsModel).execute(); - assertNotNull(response); - String responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpnServerClientConfigurationPath); + assertEquals(parsedPath, updateVpcAddressPrefixPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpnServerClientConfiguration operation with and without retries enabled + // Test the updateVpcAddressPrefix operation with and without retries enabled @Test - public void testGetVpnServerClientConfigurationWRetries() throws Throwable { + public void testUpdateVpcAddressPrefixWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpnServerClientConfigurationWOptions(); + testUpdateVpcAddressPrefixWOptions(); vpcService.disableRetries(); - testGetVpnServerClientConfigurationWOptions(); + testUpdateVpcAddressPrefixWOptions(); } - // Test the getVpnServerClientConfiguration operation with a null options model (negative test) + // Test the updateVpcAddressPrefix operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpnServerClientConfigurationNoOptions() throws Throwable { + public void testUpdateVpcAddressPrefixNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpnServerClientConfiguration(null).execute(); + vpcService.updateVpcAddressPrefix(null).execute(); } - // Test the listVpnServerClients operation with a valid options model parameter + // Test the listVpcDnsResolutionBindings operation with a valid options model parameter @Test - public void testListVpnServerClientsWOptions() throws Throwable { + public void testListVpcDnsResolutionBindingsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"clients\": [{\"client_ip\": {\"address\": \"192.168.3.4\"}, \"common_name\": \"commonName\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"disconnected_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\", \"id\": \"r006-b37832e2-7abe-4b20-a292-c70b007569c6\", \"remote_ip\": {\"address\": \"192.168.3.4\"}, \"remote_port\": 22, \"resource_type\": \"vpn_server_client\", \"status\": \"connected\", \"username\": \"username\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listVpnServerClientsPath = "/vpn_servers/testString/clients"; + String mockResponseBody = "{\"dns_resolution_bindings\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listVpcDnsResolutionBindingsPath = "/vpcs/testString/dns_resolution_bindings"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpnServerClientsOptions model - ListVpnServerClientsOptions listVpnServerClientsOptionsModel = new ListVpnServerClientsOptions.Builder() - .vpnServerId("testString") + // Construct an instance of the ListVpcDnsResolutionBindingsOptions model + ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptionsModel = new ListVpcDnsResolutionBindingsOptions.Builder() + .vpcId("testString") + .sort("name") .start("testString") .limit(Long.valueOf("10")) - .sort("created_at") + .name("my-name") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - // Invoke listVpnServerClients() with a valid options model and verify the result - Response response = vpcService.listVpnServerClients(listVpnServerClientsOptionsModel).execute(); + // Invoke listVpcDnsResolutionBindings() with a valid options model and verify the result + Response response = vpcService.listVpcDnsResolutionBindings(listVpcDnsResolutionBindingsOptionsModel).execute(); assertNotNull(response); - VPNServerClientCollection responseObj = response.getResult(); + VPCDNSResolutionBindingCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -28718,40 +30267,44 @@ public void testListVpnServerClientsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpnServerClientsPath); + assertEquals(parsedPath, listVpcDnsResolutionBindingsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("sort"), "name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("sort"), "created_at"); + assertEquals(query.get("name"), "my-name"); + assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + assertEquals(query.get("vpc.name"), "my-vpc"); + assertEquals(query.get("account.id"), "bb1b52262f7441a586f49068482f1e60"); } - // Test the listVpnServerClients operation with and without retries enabled + // Test the listVpcDnsResolutionBindings operation with and without retries enabled @Test - public void testListVpnServerClientsWRetries() throws Throwable { + public void testListVpcDnsResolutionBindingsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpnServerClientsWOptions(); + testListVpcDnsResolutionBindingsWOptions(); vpcService.disableRetries(); - testListVpnServerClientsWOptions(); + testListVpcDnsResolutionBindingsWOptions(); } - // Test the listVpnServerClients operation with a null options model (negative test) + // Test the listVpcDnsResolutionBindings operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpnServerClientsNoOptions() throws Throwable { + public void testListVpcDnsResolutionBindingsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listVpnServerClients(null).execute(); + vpcService.listVpcDnsResolutionBindings(null).execute(); } - // Test the listVpnServerClients operation using the VpnServerClientsPager.getNext() method + // Test the listVpcDnsResolutionBindings operation using the VpcDnsResolutionBindingsPager.getNext() method @Test - public void testListVpnServerClientsWithPagerGetNext() throws Throwable { + public void testListVpcDnsResolutionBindingsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"id\":\"r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"id\":\"r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"dns_resolution_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"endpoint_gateways\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"endpoint_gateway\"}],\"health_reasons\":[{\"code\":\"disconnected_from_bound_vpc\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"id\":\"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"lifecycle_state\":\"stable\",\"name\":\"my-dns-resolution-binding\",\"resource_type\":\"vpc_dns_resolution_binding\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"dns_resolution_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"endpoint_gateways\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"endpoint_gateway\"}],\"health_reasons\":[{\"code\":\"disconnected_from_bound_vpc\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"id\":\"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"lifecycle_state\":\"stable\",\"name\":\"my-dns-resolution-binding\",\"resource_type\":\"vpc_dns_resolution_binding\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -28765,28 +30318,32 @@ public void testListVpnServerClientsWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() - .vpnServerId("testString") + ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptions = new ListVpcDnsResolutionBindingsOptions.Builder() + .vpcId("testString") + .sort("name") .limit(Long.valueOf("10")) - .sort("created_at") + .name("my-name") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - List allResults = new ArrayList<>(); - VpnServerClientsPager pager = new VpnServerClientsPager(vpcService, listVpnServerClientsOptions); + List allResults = new ArrayList<>(); + VpcDnsResolutionBindingsPager pager = new VpcDnsResolutionBindingsPager(vpcService, listVpcDnsResolutionBindingsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listVpnServerClients operation using the VpnServerClientsPager.getAll() method + // Test the listVpcDnsResolutionBindings operation using the VpcDnsResolutionBindingsPager.getAll() method @Test - public void testListVpnServerClientsWithPagerGetAll() throws Throwable { + public void testListVpcDnsResolutionBindingsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"id\":\"r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"id\":\"r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"dns_resolution_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"endpoint_gateways\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"endpoint_gateway\"}],\"health_reasons\":[{\"code\":\"disconnected_from_bound_vpc\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"id\":\"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"lifecycle_state\":\"stable\",\"name\":\"my-dns-resolution-binding\",\"resource_type\":\"vpc_dns_resolution_binding\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"dns_resolution_bindings\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"endpoint_gateways\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"endpoint_gateway\"}],\"health_reasons\":[{\"code\":\"disconnected_from_bound_vpc\",\"message\":\"The VPC specified in the DNS resolution binding has been disconnected.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"id\":\"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\",\"lifecycle_state\":\"stable\",\"name\":\"my-dns-resolution-binding\",\"resource_type\":\"vpc_dns_resolution_binding\",\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"vpc\"}}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -28800,39 +30357,104 @@ public void testListVpnServerClientsWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() - .vpnServerId("testString") + ListVpcDnsResolutionBindingsOptions listVpcDnsResolutionBindingsOptions = new ListVpcDnsResolutionBindingsOptions.Builder() + .vpcId("testString") + .sort("name") .limit(Long.valueOf("10")) - .sort("created_at") + .name("my-name") + .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .vpcName("my-vpc") + .accountId("bb1b52262f7441a586f49068482f1e60") .build(); - VpnServerClientsPager pager = new VpnServerClientsPager(vpcService, listVpnServerClientsOptions); - List allResults = pager.getAll(); + VpcDnsResolutionBindingsPager pager = new VpcDnsResolutionBindingsPager(vpcService, listVpcDnsResolutionBindingsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the deleteVpnServerClient operation with a valid options model parameter + // Test the createVpcDnsResolutionBinding operation with a valid options model parameter @Test - public void testDeleteVpnServerClientWOptions() throws Throwable { + public void testCreateVpcDnsResolutionBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteVpnServerClientPath = "/vpn_servers/testString/clients/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}"; + String createVpcDnsResolutionBindingPath = "/vpcs/testString/dns_resolution_bindings"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(201) + .setBody(mockResponseBody)); + + // Construct an instance of the VPCIdentityById model + VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() + .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + .build(); + + // Construct an instance of the CreateVpcDnsResolutionBindingOptions model + CreateVpcDnsResolutionBindingOptions createVpcDnsResolutionBindingOptionsModel = new CreateVpcDnsResolutionBindingOptions.Builder() + .vpcId("testString") + .vpc(vpcIdentityModel) + .name("my-dns-resolution-binding") + .build(); + + // Invoke createVpcDnsResolutionBinding() with a valid options model and verify the result + Response response = vpcService.createVpcDnsResolutionBinding(createVpcDnsResolutionBindingOptionsModel).execute(); + assertNotNull(response); + VPCDNSResolutionBinding responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createVpcDnsResolutionBindingPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createVpcDnsResolutionBinding operation with and without retries enabled + @Test + public void testCreateVpcDnsResolutionBindingWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateVpcDnsResolutionBindingWOptions(); + + vpcService.disableRetries(); + testCreateVpcDnsResolutionBindingWOptions(); + } + + // Test the createVpcDnsResolutionBinding operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateVpcDnsResolutionBindingNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createVpcDnsResolutionBinding(null).execute(); + } + + // Test the deleteVpcDnsResolutionBinding operation with a valid options model parameter + @Test + public void testDeleteVpcDnsResolutionBindingWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}"; + String deleteVpcDnsResolutionBindingPath = "/vpcs/testString/dns_resolution_bindings/testString"; server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpnServerClientOptions model - DeleteVpnServerClientOptions deleteVpnServerClientOptionsModel = new DeleteVpnServerClientOptions.Builder() - .vpnServerId("testString") + // Construct an instance of the DeleteVpcDnsResolutionBindingOptions model + DeleteVpcDnsResolutionBindingOptions deleteVpcDnsResolutionBindingOptionsModel = new DeleteVpcDnsResolutionBindingOptions.Builder() + .vpcId("testString") .id("testString") .build(); - // Invoke deleteVpnServerClient() with a valid options model and verify the result - Response response = vpcService.deleteVpnServerClient(deleteVpnServerClientOptionsModel).execute(); + // Invoke deleteVpcDnsResolutionBinding() with a valid options model and verify the result + Response response = vpcService.deleteVpcDnsResolutionBinding(deleteVpcDnsResolutionBindingOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + VPCDNSResolutionBinding responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -28840,52 +30462,52 @@ public void testDeleteVpnServerClientWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpnServerClientPath); + assertEquals(parsedPath, deleteVpcDnsResolutionBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpnServerClient operation with and without retries enabled + // Test the deleteVpcDnsResolutionBinding operation with and without retries enabled @Test - public void testDeleteVpnServerClientWRetries() throws Throwable { + public void testDeleteVpcDnsResolutionBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpnServerClientWOptions(); + testDeleteVpcDnsResolutionBindingWOptions(); vpcService.disableRetries(); - testDeleteVpnServerClientWOptions(); + testDeleteVpcDnsResolutionBindingWOptions(); } - // Test the deleteVpnServerClient operation with a null options model (negative test) + // Test the deleteVpcDnsResolutionBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpnServerClientNoOptions() throws Throwable { + public void testDeleteVpcDnsResolutionBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpnServerClient(null).execute(); + vpcService.deleteVpcDnsResolutionBinding(null).execute(); } - // Test the getVpnServerClient operation with a valid options model parameter + // Test the getVpcDnsResolutionBinding operation with a valid options model parameter @Test - public void testGetVpnServerClientWOptions() throws Throwable { + public void testGetVpcDnsResolutionBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"client_ip\": {\"address\": \"192.168.3.4\"}, \"common_name\": \"commonName\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"disconnected_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\", \"id\": \"r006-b37832e2-7abe-4b20-a292-c70b007569c6\", \"remote_ip\": {\"address\": \"192.168.3.4\"}, \"remote_port\": 22, \"resource_type\": \"vpn_server_client\", \"status\": \"connected\", \"username\": \"username\"}"; - String getVpnServerClientPath = "/vpn_servers/testString/clients/testString"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}"; + String getVpcDnsResolutionBindingPath = "/vpcs/testString/dns_resolution_bindings/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpnServerClientOptions model - GetVpnServerClientOptions getVpnServerClientOptionsModel = new GetVpnServerClientOptions.Builder() - .vpnServerId("testString") + // Construct an instance of the GetVpcDnsResolutionBindingOptions model + GetVpcDnsResolutionBindingOptions getVpcDnsResolutionBindingOptionsModel = new GetVpcDnsResolutionBindingOptions.Builder() + .vpcId("testString") .id("testString") .build(); - // Invoke getVpnServerClient() with a valid options model and verify the result - Response response = vpcService.getVpnServerClient(getVpnServerClientOptionsModel).execute(); + // Invoke getVpcDnsResolutionBinding() with a valid options model and verify the result + Response response = vpcService.getVpcDnsResolutionBinding(getVpcDnsResolutionBindingOptionsModel).execute(); assertNotNull(response); - VPNServerClient responseObj = response.getResult(); + VPCDNSResolutionBinding responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -28894,107 +30516,115 @@ public void testGetVpnServerClientWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpnServerClientPath); + assertEquals(parsedPath, getVpcDnsResolutionBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpnServerClient operation with and without retries enabled + // Test the getVpcDnsResolutionBinding operation with and without retries enabled @Test - public void testGetVpnServerClientWRetries() throws Throwable { + public void testGetVpcDnsResolutionBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpnServerClientWOptions(); + testGetVpcDnsResolutionBindingWOptions(); vpcService.disableRetries(); - testGetVpnServerClientWOptions(); + testGetVpcDnsResolutionBindingWOptions(); } - // Test the getVpnServerClient operation with a null options model (negative test) + // Test the getVpcDnsResolutionBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpnServerClientNoOptions() throws Throwable { + public void testGetVpcDnsResolutionBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpnServerClient(null).execute(); + vpcService.getVpcDnsResolutionBinding(null).execute(); } - // Test the disconnectVpnClient operation with a valid options model parameter + // Test the updateVpcDnsResolutionBinding operation with a valid options model parameter @Test - public void testDisconnectVpnClientWOptions() throws Throwable { + public void testUpdateVpcDnsResolutionBindingWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String disconnectVpnClientPath = "/vpn_servers/testString/clients/testString/disconnect"; + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"endpoint_gateways\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"endpoint_gateway\"}], \"health_reasons\": [{\"code\": \"disconnected_from_bound_vpc\", \"message\": \"The VPC specified in the DNS resolution binding has been disconnected.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshoot-hub-1\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-982d72b7-db1b-4606-afb2-ed6bd4b0bed1/dns_resolution_bindings/r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"id\": \"r006-8a524686-fcf6-4947-a59b-188c1ed78ad1\", \"lifecycle_state\": \"stable\", \"name\": \"my-dns-resolution-binding\", \"resource_type\": \"vpc_dns_resolution_binding\", \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"vpc\"}}"; + String updateVpcDnsResolutionBindingPath = "/vpcs/testString/dns_resolution_bindings/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DisconnectVpnClientOptions model - DisconnectVpnClientOptions disconnectVpnClientOptionsModel = new DisconnectVpnClientOptions.Builder() - .vpnServerId("testString") + // Construct an instance of the VPCDNSResolutionBindingPatch model + VPCDNSResolutionBindingPatch vpcdnsResolutionBindingPatchModel = new VPCDNSResolutionBindingPatch.Builder() + .name("my-dns-resolution-binding-updated") + .build(); + Map vpcdnsResolutionBindingPatchModelAsPatch = vpcdnsResolutionBindingPatchModel.asPatch(); + + // Construct an instance of the UpdateVpcDnsResolutionBindingOptions model + UpdateVpcDnsResolutionBindingOptions updateVpcDnsResolutionBindingOptionsModel = new UpdateVpcDnsResolutionBindingOptions.Builder() + .vpcId("testString") .id("testString") + .vpcdnsResolutionBindingPatch(vpcdnsResolutionBindingPatchModelAsPatch) .build(); - // Invoke disconnectVpnClient() with a valid options model and verify the result - Response response = vpcService.disconnectVpnClient(disconnectVpnClientOptionsModel).execute(); + // Invoke updateVpcDnsResolutionBinding() with a valid options model and verify the result + Response response = vpcService.updateVpcDnsResolutionBinding(updateVpcDnsResolutionBindingOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + VPCDNSResolutionBinding responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, disconnectVpnClientPath); + assertEquals(parsedPath, updateVpcDnsResolutionBindingPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the disconnectVpnClient operation with and without retries enabled + // Test the updateVpcDnsResolutionBinding operation with and without retries enabled @Test - public void testDisconnectVpnClientWRetries() throws Throwable { + public void testUpdateVpcDnsResolutionBindingWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDisconnectVpnClientWOptions(); + testUpdateVpcDnsResolutionBindingWOptions(); vpcService.disableRetries(); - testDisconnectVpnClientWOptions(); + testUpdateVpcDnsResolutionBindingWOptions(); } - // Test the disconnectVpnClient operation with a null options model (negative test) + // Test the updateVpcDnsResolutionBinding operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDisconnectVpnClientNoOptions() throws Throwable { + public void testUpdateVpcDnsResolutionBindingNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.disconnectVpnClient(null).execute(); + vpcService.updateVpcDnsResolutionBinding(null).execute(); } - // Test the listVpnServerRoutes operation with a valid options model parameter + // Test the listVpcRoutes operation with a valid options model parameter @Test - public void testListVpnServerRoutesWOptions() throws Throwable { + public void testListVpcRoutesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"routes\": [{\"action\": \"deliver\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"health_reasons\": [{\"code\": \"internal_error\", \"message\": \"Internal error (contact IBM support).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-route-1\", \"resource_type\": \"vpn_server_route\"}], \"total_count\": 132}"; - String listVpnServerRoutesPath = "/vpn_servers/testString/routes"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"routes\": [{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String listVpcRoutesPath = "/vpcs/testString/routes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListVpnServerRoutesOptions model - ListVpnServerRoutesOptions listVpnServerRoutesOptionsModel = new ListVpnServerRoutesOptions.Builder() - .vpnServerId("testString") + // Construct an instance of the ListVpcRoutesOptions model + ListVpcRoutesOptions listVpcRoutesOptionsModel = new ListVpcRoutesOptions.Builder() + .vpcId("testString") + .zoneName("us-south-1") .start("testString") .limit(Long.valueOf("10")) - .sort("name") .build(); - // Invoke listVpnServerRoutes() with a valid options model and verify the result - Response response = vpcService.listVpnServerRoutes(listVpnServerRoutesOptionsModel).execute(); + // Invoke listVpcRoutes() with a valid options model and verify the result + Response response = vpcService.listVpcRoutes(listVpcRoutesOptionsModel).execute(); assertNotNull(response); - VPNServerRouteCollection responseObj = response.getResult(); + RouteCollectionVPCContext responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -29003,40 +30633,40 @@ public void testListVpnServerRoutesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listVpnServerRoutesPath); + assertEquals(parsedPath, listVpcRoutesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("zone.name"), "us-south-1"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("sort"), "name"); } - // Test the listVpnServerRoutes operation with and without retries enabled + // Test the listVpcRoutes operation with and without retries enabled @Test - public void testListVpnServerRoutesWRetries() throws Throwable { + public void testListVpcRoutesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListVpnServerRoutesWOptions(); + testListVpcRoutesWOptions(); vpcService.disableRetries(); - testListVpnServerRoutesWOptions(); + testListVpcRoutesWOptions(); } - // Test the listVpnServerRoutes operation with a null options model (negative test) + // Test the listVpcRoutes operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListVpnServerRoutesNoOptions() throws Throwable { + public void testListVpcRoutesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listVpnServerRoutes(null).execute(); + vpcService.listVpcRoutes(null).execute(); } - // Test the listVpnServerRoutes operation using the VpnServerRoutesPager.getNext() method + // Test the listVpcRoutes operation using the VpcRoutesPager.getNext() method @Test - public void testListVpnServerRoutesWithPagerGetNext() throws Throwable { + public void testListVpcRoutesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"health_reasons\":[{\"code\":\"internal_error\",\"message\":\"Internal error (contact IBM support).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"health_reasons\":[{\"code\":\"internal_error\",\"message\":\"Internal error (contact IBM support).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -29050,28 +30680,28 @@ public void testListVpnServerRoutesWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() - .vpnServerId("testString") + ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() + .vpcId("testString") + .zoneName("us-south-1") .limit(Long.valueOf("10")) - .sort("name") .build(); - List allResults = new ArrayList<>(); - VpnServerRoutesPager pager = new VpnServerRoutesPager(vpcService, listVpnServerRoutesOptions); + List allResults = new ArrayList<>(); + VpcRoutesPager pager = new VpcRoutesPager(vpcService, listVpcRoutesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listVpnServerRoutes operation using the VpnServerRoutesPager.getAll() method + // Test the listVpcRoutes operation using the VpcRoutesPager.getAll() method @Test - public void testListVpnServerRoutesWithPagerGetAll() throws Throwable { + public void testListVpcRoutesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"health_reasons\":[{\"code\":\"internal_error\",\"message\":\"Internal error (contact IBM support).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"health_reasons\":[{\"code\":\"internal_error\",\"message\":\"Internal error (contact IBM support).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -29085,41 +30715,55 @@ public void testListVpnServerRoutesWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() - .vpnServerId("testString") + ListVpcRoutesOptions listVpcRoutesOptions = new ListVpcRoutesOptions.Builder() + .vpcId("testString") + .zoneName("us-south-1") .limit(Long.valueOf("10")) - .sort("name") .build(); - VpnServerRoutesPager pager = new VpnServerRoutesPager(vpcService, listVpnServerRoutesOptions); - List allResults = pager.getAll(); + VpcRoutesPager pager = new VpcRoutesPager(vpcService, listVpcRoutesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createVpnServerRoute operation with a valid options model parameter + // Test the createVpcRoute operation with a valid options model parameter @Test - public void testCreateVpnServerRouteWOptions() throws Throwable { + public void testCreateVpcRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"deliver\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"health_reasons\": [{\"code\": \"internal_error\", \"message\": \"Internal error (contact IBM support).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-route-1\", \"resource_type\": \"vpn_server_route\"}"; - String createVpnServerRoutePath = "/vpn_servers/testString/routes"; + String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createVpcRoutePath = "/vpcs/testString/routes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the CreateVpnServerRouteOptions model - CreateVpnServerRouteOptions createVpnServerRouteOptionsModel = new CreateVpnServerRouteOptions.Builder() - .vpnServerId("testString") - .destination("172.16.0.0/16") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") + .build(); + + // Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model + RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("0.0.0.0") + .build(); + + // Construct an instance of the CreateVpcRouteOptions model + CreateVpcRouteOptions createVpcRouteOptionsModel = new CreateVpcRouteOptions.Builder() + .vpcId("testString") + .destination("192.168.3.0/24") + .zone(zoneIdentityModel) .action("deliver") - .name("my-vpn-route-2") + .advertise(false) + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPrototypeModel) + .priority(Long.valueOf("1")) .build(); - // Invoke createVpnServerRoute() with a valid options model and verify the result - Response response = vpcService.createVpnServerRoute(createVpnServerRouteOptionsModel).execute(); + // Invoke createVpcRoute() with a valid options model and verify the result + Response response = vpcService.createVpcRoute(createVpcRouteOptionsModel).execute(); assertNotNull(response); - VPNServerRoute responseObj = response.getResult(); + Route responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -29128,49 +30772,49 @@ public void testCreateVpnServerRouteWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createVpnServerRoutePath); + assertEquals(parsedPath, createVpcRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createVpnServerRoute operation with and without retries enabled + // Test the createVpcRoute operation with and without retries enabled @Test - public void testCreateVpnServerRouteWRetries() throws Throwable { + public void testCreateVpcRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateVpnServerRouteWOptions(); + testCreateVpcRouteWOptions(); vpcService.disableRetries(); - testCreateVpnServerRouteWOptions(); + testCreateVpcRouteWOptions(); } - // Test the createVpnServerRoute operation with a null options model (negative test) + // Test the createVpcRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateVpnServerRouteNoOptions() throws Throwable { + public void testCreateVpcRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createVpnServerRoute(null).execute(); + vpcService.createVpcRoute(null).execute(); } - // Test the deleteVpnServerRoute operation with a valid options model parameter + // Test the deleteVpcRoute operation with a valid options model parameter @Test - public void testDeleteVpnServerRouteWOptions() throws Throwable { + public void testDeleteVpcRouteWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteVpnServerRoutePath = "/vpn_servers/testString/routes/testString"; + String deleteVpcRoutePath = "/vpcs/testString/routes/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteVpnServerRouteOptions model - DeleteVpnServerRouteOptions deleteVpnServerRouteOptionsModel = new DeleteVpnServerRouteOptions.Builder() - .vpnServerId("testString") + // Construct an instance of the DeleteVpcRouteOptions model + DeleteVpcRouteOptions deleteVpcRouteOptionsModel = new DeleteVpcRouteOptions.Builder() + .vpcId("testString") .id("testString") .build(); - // Invoke deleteVpnServerRoute() with a valid options model and verify the result - Response response = vpcService.deleteVpnServerRoute(deleteVpnServerRouteOptionsModel).execute(); + // Invoke deleteVpcRoute() with a valid options model and verify the result + Response response = vpcService.deleteVpcRoute(deleteVpcRouteOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -29181,52 +30825,52 @@ public void testDeleteVpnServerRouteWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteVpnServerRoutePath); + assertEquals(parsedPath, deleteVpcRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteVpnServerRoute operation with and without retries enabled + // Test the deleteVpcRoute operation with and without retries enabled @Test - public void testDeleteVpnServerRouteWRetries() throws Throwable { + public void testDeleteVpcRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteVpnServerRouteWOptions(); + testDeleteVpcRouteWOptions(); vpcService.disableRetries(); - testDeleteVpnServerRouteWOptions(); + testDeleteVpcRouteWOptions(); } - // Test the deleteVpnServerRoute operation with a null options model (negative test) + // Test the deleteVpcRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteVpnServerRouteNoOptions() throws Throwable { + public void testDeleteVpcRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteVpnServerRoute(null).execute(); + vpcService.deleteVpcRoute(null).execute(); } - // Test the getVpnServerRoute operation with a valid options model parameter + // Test the getVpcRoute operation with a valid options model parameter @Test - public void testGetVpnServerRouteWOptions() throws Throwable { + public void testGetVpcRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"deliver\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"health_reasons\": [{\"code\": \"internal_error\", \"message\": \"Internal error (contact IBM support).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-route-1\", \"resource_type\": \"vpn_server_route\"}"; - String getVpnServerRoutePath = "/vpn_servers/testString/routes/testString"; + String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getVpcRoutePath = "/vpcs/testString/routes/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetVpnServerRouteOptions model - GetVpnServerRouteOptions getVpnServerRouteOptionsModel = new GetVpnServerRouteOptions.Builder() - .vpnServerId("testString") + // Construct an instance of the GetVpcRouteOptions model + GetVpcRouteOptions getVpcRouteOptionsModel = new GetVpcRouteOptions.Builder() + .vpcId("testString") .id("testString") .build(); - // Invoke getVpnServerRoute() with a valid options model and verify the result - Response response = vpcService.getVpnServerRoute(getVpnServerRouteOptionsModel).execute(); + // Invoke getVpcRoute() with a valid options model and verify the result + Response response = vpcService.getVpcRoute(getVpcRouteOptionsModel).execute(); assertNotNull(response); - VPNServerRoute responseObj = response.getResult(); + Route responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -29235,59 +30879,67 @@ public void testGetVpnServerRouteWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getVpnServerRoutePath); + assertEquals(parsedPath, getVpcRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getVpnServerRoute operation with and without retries enabled + // Test the getVpcRoute operation with and without retries enabled @Test - public void testGetVpnServerRouteWRetries() throws Throwable { + public void testGetVpcRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetVpnServerRouteWOptions(); + testGetVpcRouteWOptions(); vpcService.disableRetries(); - testGetVpnServerRouteWOptions(); + testGetVpcRouteWOptions(); } - // Test the getVpnServerRoute operation with a null options model (negative test) + // Test the getVpcRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetVpnServerRouteNoOptions() throws Throwable { + public void testGetVpcRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getVpnServerRoute(null).execute(); + vpcService.getVpcRoute(null).execute(); } - // Test the updateVpnServerRoute operation with a valid options model parameter + // Test the updateVpcRoute operation with a valid options model parameter @Test - public void testUpdateVpnServerRouteWOptions() throws Throwable { + public void testUpdateVpcRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"deliver\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"health_reasons\": [{\"code\": \"internal_error\", \"message\": \"Internal error (contact IBM support).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-route-1\", \"resource_type\": \"vpn_server_route\"}"; - String updateVpnServerRoutePath = "/vpn_servers/testString/routes/testString"; + String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateVpcRoutePath = "/vpcs/testString/routes/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the VPNServerRoutePatch model - VPNServerRoutePatch vpnServerRoutePatchModel = new VPNServerRoutePatch.Builder() - .name("my-vpn-server-route-updated") + // Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model + RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPatchModel = new RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("10.240.0.12") .build(); - Map vpnServerRoutePatchModelAsPatch = vpnServerRoutePatchModel.asPatch(); - // Construct an instance of the UpdateVpnServerRouteOptions model - UpdateVpnServerRouteOptions updateVpnServerRouteOptionsModel = new UpdateVpnServerRouteOptions.Builder() - .vpnServerId("testString") + // Construct an instance of the RoutePatch model + RoutePatch routePatchModel = new RoutePatch.Builder() + .advertise(true) + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPatchModel) + .priority(Long.valueOf("1")) + .build(); + Map routePatchModelAsPatch = routePatchModel.asPatch(); + + // Construct an instance of the UpdateVpcRouteOptions model + UpdateVpcRouteOptions updateVpcRouteOptionsModel = new UpdateVpcRouteOptions.Builder() + .vpcId("testString") .id("testString") - .vpnServerRoutePatch(vpnServerRoutePatchModelAsPatch) + .routePatch(routePatchModelAsPatch) .build(); - // Invoke updateVpnServerRoute() with a valid options model and verify the result - Response response = vpcService.updateVpnServerRoute(updateVpnServerRouteOptionsModel).execute(); + // Invoke updateVpcRoute() with a valid options model and verify the result + Response response = vpcService.updateVpcRoute(updateVpcRouteOptionsModel).execute(); assertNotNull(response); - VPNServerRoute responseObj = response.getResult(); + Route responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -29296,52 +30948,54 @@ public void testUpdateVpnServerRouteWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateVpnServerRoutePath); + assertEquals(parsedPath, updateVpcRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateVpnServerRoute operation with and without retries enabled + // Test the updateVpcRoute operation with and without retries enabled @Test - public void testUpdateVpnServerRouteWRetries() throws Throwable { + public void testUpdateVpcRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateVpnServerRouteWOptions(); + testUpdateVpcRouteWOptions(); vpcService.disableRetries(); - testUpdateVpnServerRouteWOptions(); + testUpdateVpcRouteWOptions(); } - // Test the updateVpnServerRoute operation with a null options model (negative test) + // Test the updateVpcRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateVpnServerRouteNoOptions() throws Throwable { + public void testUpdateVpcRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateVpnServerRoute(null).execute(); + vpcService.updateVpcRoute(null).execute(); } - // Test the listLoadBalancerProfiles operation with a valid options model parameter + // Test the listVpcRoutingTables operation with a valid options model parameter @Test - public void testListLoadBalancerProfilesWOptions() throws Throwable { + public void testListVpcRoutingTablesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"profiles\": [{\"access_modes\": {\"type\": \"enum\", \"values\": [\"private\"]}, \"availability\": {\"type\": \"fixed\", \"value\": \"region\"}, \"failsafe_policy_actions\": {\"default\": \"fail\", \"type\": \"enum\", \"values\": [\"forward\"]}, \"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"instance_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"logging_supported\": {\"type\": \"fixed\", \"value\": [\"datapath\"]}, \"name\": \"network-fixed\", \"route_mode_supported\": {\"type\": \"fixed\", \"value\": true}, \"security_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"source_ip_session_persistence_supported\": {\"type\": \"fixed\", \"value\": true}, \"targetable_load_balancer_profiles\": [{\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}], \"udp_supported\": {\"type\": \"fixed\", \"value\": true}}], \"total_count\": 132}"; - String listLoadBalancerProfilesPath = "/load_balancer/profiles"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"routing_tables\": [{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}], \"total_count\": 132}"; + String listVpcRoutingTablesPath = "/vpcs/testString/routing_tables"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListLoadBalancerProfilesOptions model - ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptionsModel = new ListLoadBalancerProfilesOptions.Builder() + // Construct an instance of the ListVpcRoutingTablesOptions model + ListVpcRoutingTablesOptions listVpcRoutingTablesOptionsModel = new ListVpcRoutingTablesOptions.Builder() + .vpcId("testString") .start("testString") .limit(Long.valueOf("10")) + .isDefault(true) .build(); - // Invoke listLoadBalancerProfiles() with a valid options model and verify the result - Response response = vpcService.listLoadBalancerProfiles(listLoadBalancerProfilesOptionsModel).execute(); + // Invoke listVpcRoutingTables() with a valid options model and verify the result + Response response = vpcService.listVpcRoutingTables(listVpcRoutingTablesOptionsModel).execute(); assertNotNull(response); - LoadBalancerProfileCollection responseObj = response.getResult(); + RoutingTableCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -29350,196 +31004,40 @@ public void testListLoadBalancerProfilesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listLoadBalancerProfilesPath); + assertEquals(parsedPath, listVpcRoutingTablesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(Boolean.valueOf(query.get("is_default")), Boolean.valueOf(true)); } - // Test the listLoadBalancerProfiles operation with and without retries enabled - @Test - public void testListLoadBalancerProfilesWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListLoadBalancerProfilesWOptions(); - - vpcService.disableRetries(); - testListLoadBalancerProfilesWOptions(); - } - - // Test the listLoadBalancerProfiles operation using the LoadBalancerProfilesPager.getNext() method - @Test - public void testListLoadBalancerProfilesWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"access_modes\":{\"type\":\"enum\",\"values\":[\"private\"]},\"availability\":{\"type\":\"fixed\",\"value\":\"region\"},\"failsafe_policy_actions\":{\"default\":\"fail\",\"type\":\"enum\",\"values\":[\"forward\"]},\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"instance_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"source_ip_session_persistence_supported\":{\"type\":\"fixed\",\"value\":true},\"targetable_load_balancer_profiles\":[{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"}],\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"access_modes\":{\"type\":\"enum\",\"values\":[\"private\"]},\"availability\":{\"type\":\"fixed\",\"value\":\"region\"},\"failsafe_policy_actions\":{\"default\":\"fail\",\"type\":\"enum\",\"values\":[\"forward\"]},\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"instance_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"source_ip_session_persistence_supported\":{\"type\":\"fixed\",\"value\":true},\"targetable_load_balancer_profiles\":[{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"}],\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .build(); - - List allResults = new ArrayList<>(); - LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(vpcService, listLoadBalancerProfilesOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); - } - - // Test the listLoadBalancerProfiles operation using the LoadBalancerProfilesPager.getAll() method - @Test - public void testListLoadBalancerProfilesWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"profiles\":[{\"access_modes\":{\"type\":\"enum\",\"values\":[\"private\"]},\"availability\":{\"type\":\"fixed\",\"value\":\"region\"},\"failsafe_policy_actions\":{\"default\":\"fail\",\"type\":\"enum\",\"values\":[\"forward\"]},\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"instance_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"source_ip_session_persistence_supported\":{\"type\":\"fixed\",\"value\":true},\"targetable_load_balancer_profiles\":[{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"}],\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"profiles\":[{\"access_modes\":{\"type\":\"enum\",\"values\":[\"private\"]},\"availability\":{\"type\":\"fixed\",\"value\":\"region\"},\"failsafe_policy_actions\":{\"default\":\"fail\",\"type\":\"enum\",\"values\":[\"forward\"]},\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"instance_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"logging_supported\":{\"type\":\"fixed\",\"value\":[\"datapath\"]},\"name\":\"network-fixed\",\"route_mode_supported\":{\"type\":\"fixed\",\"value\":true},\"security_groups_supported\":{\"type\":\"fixed\",\"value\":true},\"source_ip_session_persistence_supported\":{\"type\":\"fixed\",\"value\":true},\"targetable_load_balancer_profiles\":[{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"}],\"udp_supported\":{\"type\":\"fixed\",\"value\":true}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListLoadBalancerProfilesOptions listLoadBalancerProfilesOptions = new ListLoadBalancerProfilesOptions.Builder() - .limit(Long.valueOf("10")) - .build(); - - LoadBalancerProfilesPager pager = new LoadBalancerProfilesPager(vpcService, listLoadBalancerProfilesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the getLoadBalancerProfile operation with a valid options model parameter - @Test - public void testGetLoadBalancerProfileWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"access_modes\": {\"type\": \"enum\", \"values\": [\"private\"]}, \"availability\": {\"type\": \"fixed\", \"value\": \"region\"}, \"failsafe_policy_actions\": {\"default\": \"fail\", \"type\": \"enum\", \"values\": [\"forward\"]}, \"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"instance_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"logging_supported\": {\"type\": \"fixed\", \"value\": [\"datapath\"]}, \"name\": \"network-fixed\", \"route_mode_supported\": {\"type\": \"fixed\", \"value\": true}, \"security_groups_supported\": {\"type\": \"fixed\", \"value\": true}, \"source_ip_session_persistence_supported\": {\"type\": \"fixed\", \"value\": true}, \"targetable_load_balancer_profiles\": [{\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}], \"udp_supported\": {\"type\": \"fixed\", \"value\": true}}"; - String getLoadBalancerProfilePath = "/load_balancer/profiles/network-fixed"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetLoadBalancerProfileOptions model - GetLoadBalancerProfileOptions getLoadBalancerProfileOptionsModel = new GetLoadBalancerProfileOptions.Builder() - .name("network-fixed") - .build(); - - // Invoke getLoadBalancerProfile() with a valid options model and verify the result - Response response = vpcService.getLoadBalancerProfile(getLoadBalancerProfileOptionsModel).execute(); - assertNotNull(response); - LoadBalancerProfile responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getLoadBalancerProfilePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the getLoadBalancerProfile operation with and without retries enabled + // Test the listVpcRoutingTables operation with and without retries enabled @Test - public void testGetLoadBalancerProfileWRetries() throws Throwable { + public void testListVpcRoutingTablesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetLoadBalancerProfileWOptions(); + testListVpcRoutingTablesWOptions(); vpcService.disableRetries(); - testGetLoadBalancerProfileWOptions(); - } - - // Test the getLoadBalancerProfile operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetLoadBalancerProfileNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getLoadBalancerProfile(null).execute(); - } - - // Test the listLoadBalancers operation with a valid options model parameter - @Test - public void testListLoadBalancersWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"load_balancers\": [{\"access_mode\": \"private\", \"attached_load_balancer_pool_members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"availability\": \"region\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"failsafe_policy_actions\": [\"forward\"], \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": true, \"is_private_path\": true, \"is_public\": true, \"listeners\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}], \"logging\": {\"datapath\": {\"active\": true}}, \"name\": \"my-load-balancer\", \"operating_status\": \"offline\", \"pools\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}], \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}, \"provisioning_status\": \"active\", \"public_ips\": [{\"address\": \"192.168.3.4\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"load_balancer\", \"route_mode\": true, \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"source_ip_session_persistence_supported\": true, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}], \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listLoadBalancersPath = "/load_balancers"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListLoadBalancersOptions model - ListLoadBalancersOptions listLoadBalancersOptionsModel = new ListLoadBalancersOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .build(); - - // Invoke listLoadBalancers() with a valid options model and verify the result - Response response = vpcService.listLoadBalancers(listLoadBalancersOptionsModel).execute(); - assertNotNull(response); - LoadBalancerCollection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listLoadBalancersPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - } - - // Test the listLoadBalancers operation with and without retries enabled - @Test - public void testListLoadBalancersWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListLoadBalancersWOptions(); + testListVpcRoutingTablesWOptions(); + } - vpcService.disableRetries(); - testListLoadBalancersWOptions(); + // Test the listVpcRoutingTables operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListVpcRoutingTablesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listVpcRoutingTables(null).execute(); } - // Test the listLoadBalancers operation using the LoadBalancersPager.getNext() method + // Test the listVpcRoutingTables operation using the VpcRoutingTablesPager.getNext() method @Test - public void testListLoadBalancersWithPagerGetNext() throws Throwable { + public void testListVpcRoutingTablesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"access_mode\":\"private\",\"attached_load_balancer_pool_members\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\",\"id\":\"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}],\"availability\":\"region\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"failsafe_policy_actions\":[\"forward\"],\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":true,\"is_private_path\":true,\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\",\"id\":\"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"source_ip_session_persistence_supported\":true,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"access_mode\":\"private\",\"attached_load_balancer_pool_members\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\",\"id\":\"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}],\"availability\":\"region\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"failsafe_policy_actions\":[\"forward\"],\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":true,\"is_private_path\":true,\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\",\"id\":\"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"source_ip_session_persistence_supported\":true,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_server\"}],\"advertise_routes_to\":[\"transit_gateway\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_internet_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"name\":\"my-vpc-routing-table-route\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_server\"}],\"advertise_routes_to\":[\"transit_gateway\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_internet_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"name\":\"my-vpc-routing-table-route\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -29553,26 +31051,28 @@ public void testListLoadBalancersWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() + ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() + .vpcId("testString") .limit(Long.valueOf("10")) + .isDefault(true) .build(); - List allResults = new ArrayList<>(); - LoadBalancersPager pager = new LoadBalancersPager(vpcService, listLoadBalancersOptions); + List allResults = new ArrayList<>(); + VpcRoutingTablesPager pager = new VpcRoutingTablesPager(vpcService, listVpcRoutingTablesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listLoadBalancers operation using the LoadBalancersPager.getAll() method + // Test the listVpcRoutingTables operation using the VpcRoutingTablesPager.getAll() method @Test - public void testListLoadBalancersWithPagerGetAll() throws Throwable { + public void testListVpcRoutingTablesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"access_mode\":\"private\",\"attached_load_balancer_pool_members\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\",\"id\":\"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}],\"availability\":\"region\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"failsafe_policy_actions\":[\"forward\"],\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":true,\"is_private_path\":true,\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\",\"id\":\"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"source_ip_session_persistence_supported\":true,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"load_balancers\":[{\"access_mode\":\"private\",\"attached_load_balancer_pool_members\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\",\"id\":\"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}],\"availability\":\"region\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"dns\":{\"instance\":{\"crn\":\"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"},\"zone\":{\"id\":\"d66662cc-aa23-4fe1-9987-858487a61f45\"}},\"failsafe_policy_actions\":[\"forward\"],\"hostname\":\"6b88d615-us-south.lb.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"instance_groups_supported\":true,\"is_private_path\":true,\"is_public\":true,\"listeners\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\",\"id\":\"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}],\"logging\":{\"datapath\":{\"active\":true}},\"name\":\"my-load-balancer\",\"operating_status\":\"offline\",\"pools\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"id\":\"r006-70294e14-4e61-11e8-bcf4-0242ac110004\",\"name\":\"my-load-balancer-pool\"}],\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"profile\":{\"family\":\"application\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\",\"name\":\"network-fixed\"},\"provisioning_status\":\"active\",\"public_ips\":[{\"address\":\"192.168.3.4\"}],\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"load_balancer\",\"route_mode\":true,\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"security_groups_supported\":false,\"source_ip_session_persistence_supported\":true,\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"udp_supported\":true}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_server\"}],\"advertise_routes_to\":[\"transit_gateway\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_internet_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"name\":\"my-vpc-routing-table-route\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routing_tables\":[{\"accept_routes_from\":[{\"resource_type\":\"vpn_server\"}],\"advertise_routes_to\":[\"transit_gateway\"],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"id\":\"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\",\"is_default\":false,\"lifecycle_state\":\"stable\",\"name\":\"my-routing-table-1\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"routing_table\",\"route_direct_link_ingress\":true,\"route_internet_ingress\":true,\"route_transit_gateway_ingress\":true,\"route_vpc_zone_ingress\":false,\"routes\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"name\":\"my-vpc-routing-table-route\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}]}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -29586,167 +31086,72 @@ public void testListLoadBalancersWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListLoadBalancersOptions listLoadBalancersOptions = new ListLoadBalancersOptions.Builder() + ListVpcRoutingTablesOptions listVpcRoutingTablesOptions = new ListVpcRoutingTablesOptions.Builder() + .vpcId("testString") .limit(Long.valueOf("10")) + .isDefault(true) .build(); - LoadBalancersPager pager = new LoadBalancersPager(vpcService, listLoadBalancersOptions); - List allResults = pager.getAll(); + VpcRoutingTablesPager pager = new VpcRoutingTablesPager(vpcService, listVpcRoutingTablesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createLoadBalancer operation with a valid options model parameter + // Test the createVpcRoutingTable operation with a valid options model parameter @Test - public void testCreateLoadBalancerWOptions() throws Throwable { + public void testCreateVpcRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_mode\": \"private\", \"attached_load_balancer_pool_members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"availability\": \"region\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"failsafe_policy_actions\": [\"forward\"], \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": true, \"is_private_path\": true, \"is_public\": true, \"listeners\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}], \"logging\": {\"datapath\": {\"active\": true}}, \"name\": \"my-load-balancer\", \"operating_status\": \"offline\", \"pools\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}], \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}, \"provisioning_status\": \"active\", \"public_ips\": [{\"address\": \"192.168.3.4\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"load_balancer\", \"route_mode\": true, \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"source_ip_session_persistence_supported\": true, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; - String createLoadBalancerPath = "/load_balancers"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String createVpcRoutingTablePath = "/vpcs/testString/routing_tables"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") - .build(); - - // Construct an instance of the DNSInstanceIdentityByCRN model - DNSInstanceIdentityByCRN dnsInstanceIdentityModel = new DNSInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::") - .build(); - - // Construct an instance of the DNSZoneIdentityById model - DNSZoneIdentityById dnsZoneIdentityModel = new DNSZoneIdentityById.Builder() - .id("d66662cc-aa23-4fe1-9987-858487a61f45") - .build(); - - // Construct an instance of the LoadBalancerDNSPrototype model - LoadBalancerDNSPrototype loadBalancerDnsPrototypeModel = new LoadBalancerDNSPrototype.Builder() - .instance(dnsInstanceIdentityModel) - .zone(dnsZoneIdentityModel) - .build(); - - // Construct an instance of the CertificateInstanceIdentityByCRN model - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - // Construct an instance of the LoadBalancerPoolIdentityByName model - LoadBalancerPoolIdentityByName loadBalancerPoolIdentityByNameModel = new LoadBalancerPoolIdentityByName.Builder() - .name("my-load-balancer-pool") - .build(); - - // Construct an instance of the LoadBalancerListenerIdentityById model - LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() - .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") - .build(); - - // Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model - LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() - .httpStatusCode(Long.valueOf("301")) - .listener(loadBalancerListenerIdentityModel) - .uri("/example?doc=get") - .build(); - - // Construct an instance of the LoadBalancerListenerPrototypeLoadBalancerContext model - LoadBalancerListenerPrototypeLoadBalancerContext loadBalancerListenerPrototypeLoadBalancerContextModel = new LoadBalancerListenerPrototypeLoadBalancerContext.Builder() - .acceptProxyProtocol(true) - .certificateInstance(certificateInstanceIdentityModel) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerPoolIdentityByNameModel) - .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) - .idleConnectionTimeout(Long.valueOf("100")) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) - .protocol("http") - .build(); - - // Construct an instance of the LoadBalancerLoggingDatapathPrototype model - LoadBalancerLoggingDatapathPrototype loadBalancerLoggingDatapathPrototypeModel = new LoadBalancerLoggingDatapathPrototype.Builder() - .active(true) - .build(); - - // Construct an instance of the LoadBalancerLoggingPrototype model - LoadBalancerLoggingPrototype loadBalancerLoggingPrototypeModel = new LoadBalancerLoggingPrototype.Builder() - .datapath(loadBalancerLoggingDatapathPrototypeModel) - .build(); - - // Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model - LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("tcp") - .build(); - - // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") - .build(); - - // Construct an instance of the LoadBalancerPoolMemberPrototype model - LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); - - // Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model - LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") - .build(); - - // Construct an instance of the LoadBalancerPoolPrototypeLoadBalancerContext model - LoadBalancerPoolPrototypeLoadBalancerContext loadBalancerPoolPrototypeLoadBalancerContextModel = new LoadBalancerPoolPrototypeLoadBalancerContext.Builder() - .algorithm("least_connections") - .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) - .name("my-load-balancer-pool") - .protocol("http") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + // Construct an instance of the ResourceFilter model + ResourceFilter resourceFilterModel = new ResourceFilter.Builder() + .resourceType("vpn_server") .build(); - // Construct an instance of the LoadBalancerProfileIdentityByName model - LoadBalancerProfileIdentityByName loadBalancerProfileIdentityModel = new LoadBalancerProfileIdentityByName.Builder() - .name("network-fixed") + // Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model + RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("0.0.0.0") .build(); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + // Construct an instance of the RoutePrototype model + RoutePrototype routePrototypeModel = new RoutePrototype.Builder() + .action("deliver") + .advertise(false) + .destination("192.168.3.0/24") + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPrototypeModel) + .priority(Long.valueOf("1")) + .zone(zoneIdentityModel) .build(); - // Construct an instance of the CreateLoadBalancerOptions model - CreateLoadBalancerOptions createLoadBalancerOptionsModel = new CreateLoadBalancerOptions.Builder() - .isPublic(true) - .subnets(java.util.Arrays.asList(subnetIdentityModel)) - .dns(loadBalancerDnsPrototypeModel) - .isPrivatePath(true) - .listeners(java.util.Arrays.asList(loadBalancerListenerPrototypeLoadBalancerContextModel)) - .logging(loadBalancerLoggingPrototypeModel) - .name("my-load-balancer") - .pools(java.util.Arrays.asList(loadBalancerPoolPrototypeLoadBalancerContextModel)) - .profile(loadBalancerProfileIdentityModel) - .resourceGroup(resourceGroupIdentityModel) - .routeMode(true) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + // Construct an instance of the CreateVpcRoutingTableOptions model + CreateVpcRoutingTableOptions createVpcRoutingTableOptionsModel = new CreateVpcRoutingTableOptions.Builder() + .vpcId("testString") + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) + .advertiseRoutesTo(java.util.Arrays.asList()) + .name("my-routing-table-1") + .routeDirectLinkIngress(false) + .routeInternetIngress(false) + .routeTransitGatewayIngress(false) + .routeVpcZoneIngress(false) + .routes(java.util.Arrays.asList(routePrototypeModel)) .build(); - // Invoke createLoadBalancer() with a valid options model and verify the result - Response response = vpcService.createLoadBalancer(createLoadBalancerOptionsModel).execute(); + // Invoke createVpcRoutingTable() with a valid options model and verify the result + Response response = vpcService.createVpcRoutingTable(createVpcRoutingTableOptionsModel).execute(); assertNotNull(response); - LoadBalancer responseObj = response.getResult(); + RoutingTable responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -29755,49 +31160,50 @@ public void testCreateLoadBalancerWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createLoadBalancerPath); + assertEquals(parsedPath, createVpcRoutingTablePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createLoadBalancer operation with and without retries enabled + // Test the createVpcRoutingTable operation with and without retries enabled @Test - public void testCreateLoadBalancerWRetries() throws Throwable { + public void testCreateVpcRoutingTableWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateLoadBalancerWOptions(); + testCreateVpcRoutingTableWOptions(); vpcService.disableRetries(); - testCreateLoadBalancerWOptions(); + testCreateVpcRoutingTableWOptions(); } - // Test the createLoadBalancer operation with a null options model (negative test) + // Test the createVpcRoutingTable operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateLoadBalancerNoOptions() throws Throwable { + public void testCreateVpcRoutingTableNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createLoadBalancer(null).execute(); + vpcService.createVpcRoutingTable(null).execute(); } - // Test the deleteLoadBalancer operation with a valid options model parameter + // Test the deleteVpcRoutingTable operation with a valid options model parameter @Test - public void testDeleteLoadBalancerWOptions() throws Throwable { + public void testDeleteVpcRoutingTableWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteLoadBalancerPath = "/load_balancers/testString"; + String deleteVpcRoutingTablePath = "/vpcs/testString/routing_tables/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteLoadBalancerOptions model - DeleteLoadBalancerOptions deleteLoadBalancerOptionsModel = new DeleteLoadBalancerOptions.Builder() + // Construct an instance of the DeleteVpcRoutingTableOptions model + DeleteVpcRoutingTableOptions deleteVpcRoutingTableOptionsModel = new DeleteVpcRoutingTableOptions.Builder() + .vpcId("testString") .id("testString") .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deleteLoadBalancer() with a valid options model and verify the result - Response response = vpcService.deleteLoadBalancer(deleteLoadBalancerOptionsModel).execute(); + // Invoke deleteVpcRoutingTable() with a valid options model and verify the result + Response response = vpcService.deleteVpcRoutingTable(deleteVpcRoutingTableOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -29808,51 +31214,52 @@ public void testDeleteLoadBalancerWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteLoadBalancerPath); + assertEquals(parsedPath, deleteVpcRoutingTablePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteLoadBalancer operation with and without retries enabled + // Test the deleteVpcRoutingTable operation with and without retries enabled @Test - public void testDeleteLoadBalancerWRetries() throws Throwable { + public void testDeleteVpcRoutingTableWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteLoadBalancerWOptions(); + testDeleteVpcRoutingTableWOptions(); vpcService.disableRetries(); - testDeleteLoadBalancerWOptions(); + testDeleteVpcRoutingTableWOptions(); } - // Test the deleteLoadBalancer operation with a null options model (negative test) + // Test the deleteVpcRoutingTable operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteLoadBalancerNoOptions() throws Throwable { + public void testDeleteVpcRoutingTableNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteLoadBalancer(null).execute(); + vpcService.deleteVpcRoutingTable(null).execute(); } - // Test the getLoadBalancer operation with a valid options model parameter + // Test the getVpcRoutingTable operation with a valid options model parameter @Test - public void testGetLoadBalancerWOptions() throws Throwable { + public void testGetVpcRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_mode\": \"private\", \"attached_load_balancer_pool_members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"availability\": \"region\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"failsafe_policy_actions\": [\"forward\"], \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": true, \"is_private_path\": true, \"is_public\": true, \"listeners\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}], \"logging\": {\"datapath\": {\"active\": true}}, \"name\": \"my-load-balancer\", \"operating_status\": \"offline\", \"pools\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}], \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}, \"provisioning_status\": \"active\", \"public_ips\": [{\"address\": \"192.168.3.4\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"load_balancer\", \"route_mode\": true, \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"source_ip_session_persistence_supported\": true, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; - String getLoadBalancerPath = "/load_balancers/testString"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String getVpcRoutingTablePath = "/vpcs/testString/routing_tables/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetLoadBalancerOptions model - GetLoadBalancerOptions getLoadBalancerOptionsModel = new GetLoadBalancerOptions.Builder() + // Construct an instance of the GetVpcRoutingTableOptions model + GetVpcRoutingTableOptions getVpcRoutingTableOptionsModel = new GetVpcRoutingTableOptions.Builder() + .vpcId("testString") .id("testString") .build(); - // Invoke getLoadBalancer() with a valid options model and verify the result - Response response = vpcService.getLoadBalancer(getLoadBalancerOptionsModel).execute(); + // Invoke getVpcRoutingTable() with a valid options model and verify the result + Response response = vpcService.getVpcRoutingTable(getVpcRoutingTableOptionsModel).execute(); assertNotNull(response); - LoadBalancer responseObj = response.getResult(); + RoutingTable responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -29861,93 +31268,71 @@ public void testGetLoadBalancerWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getLoadBalancerPath); + assertEquals(parsedPath, getVpcRoutingTablePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getLoadBalancer operation with and without retries enabled + // Test the getVpcRoutingTable operation with and without retries enabled @Test - public void testGetLoadBalancerWRetries() throws Throwable { + public void testGetVpcRoutingTableWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetLoadBalancerWOptions(); + testGetVpcRoutingTableWOptions(); vpcService.disableRetries(); - testGetLoadBalancerWOptions(); + testGetVpcRoutingTableWOptions(); } - // Test the getLoadBalancer operation with a null options model (negative test) + // Test the getVpcRoutingTable operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetLoadBalancerNoOptions() throws Throwable { + public void testGetVpcRoutingTableNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getLoadBalancer(null).execute(); + vpcService.getVpcRoutingTable(null).execute(); } - // Test the updateLoadBalancer operation with a valid options model parameter + // Test the updateVpcRoutingTable operation with a valid options model parameter @Test - public void testUpdateLoadBalancerWOptions() throws Throwable { + public void testUpdateVpcRoutingTableWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_mode\": \"private\", \"attached_load_balancer_pool_members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"availability\": \"region\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"dns\": {\"instance\": {\"crn\": \"crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::\"}, \"zone\": {\"id\": \"d66662cc-aa23-4fe1-9987-858487a61f45\"}}, \"failsafe_policy_actions\": [\"forward\"], \"hostname\": \"6b88d615-us-south.lb.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"instance_groups_supported\": true, \"is_private_path\": true, \"is_public\": true, \"listeners\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}], \"logging\": {\"datapath\": {\"active\": true}}, \"name\": \"my-load-balancer\", \"operating_status\": \"offline\", \"pools\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}], \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"profile\": {\"family\": \"application\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed\", \"name\": \"network-fixed\"}, \"provisioning_status\": \"active\", \"public_ips\": [{\"address\": \"192.168.3.4\"}], \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"load_balancer\", \"route_mode\": true, \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"security_groups_supported\": false, \"source_ip_session_persistence_supported\": true, \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"udp_supported\": true}"; - String updateLoadBalancerPath = "/load_balancers/testString"; + String mockResponseBody = "{\"accept_routes_from\": [{\"resource_type\": \"vpn_server\"}], \"advertise_routes_to\": [\"transit_gateway\"], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc-routing-table:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"id\": \"r006-6885e83f-03b2-4603-8a86-db2a0f55c840\", \"is_default\": false, \"lifecycle_state\": \"stable\", \"name\": \"my-routing-table-1\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"routing_table\", \"route_direct_link_ingress\": true, \"route_internet_ingress\": true, \"route_transit_gateway_ingress\": true, \"route_vpc_zone_ingress\": false, \"routes\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"name\": \"my-vpc-routing-table-route\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}]}"; + String updateVpcRoutingTablePath = "/vpcs/testString/routing_tables/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DNSInstanceIdentityByCRN model - DNSInstanceIdentityByCRN dnsInstanceIdentityModel = new DNSInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:dns-svcs:global:a/bb1b52262f7441a586f49068482f1e60:f761b566-030a-4696-8649-cc9d09889e88::") - .build(); - - // Construct an instance of the DNSZoneIdentityById model - DNSZoneIdentityById dnsZoneIdentityModel = new DNSZoneIdentityById.Builder() - .id("d66662cc-aa23-4fe1-9987-858487a61f45") - .build(); - - // Construct an instance of the LoadBalancerDNSPatch model - LoadBalancerDNSPatch loadBalancerDnsPatchModel = new LoadBalancerDNSPatch.Builder() - .instance(dnsInstanceIdentityModel) - .zone(dnsZoneIdentityModel) - .build(); - - // Construct an instance of the LoadBalancerLoggingDatapathPatch model - LoadBalancerLoggingDatapathPatch loadBalancerLoggingDatapathPatchModel = new LoadBalancerLoggingDatapathPatch.Builder() - .active(true) - .build(); - - // Construct an instance of the LoadBalancerLoggingPatch model - LoadBalancerLoggingPatch loadBalancerLoggingPatchModel = new LoadBalancerLoggingPatch.Builder() - .datapath(loadBalancerLoggingDatapathPatchModel) - .build(); - - // Construct an instance of the SubnetIdentityById model - SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() - .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + // Construct an instance of the ResourceFilter model + ResourceFilter resourceFilterModel = new ResourceFilter.Builder() + .resourceType("vpn_server") .build(); - // Construct an instance of the LoadBalancerPatch model - LoadBalancerPatch loadBalancerPatchModel = new LoadBalancerPatch.Builder() - .dns(loadBalancerDnsPatchModel) - .logging(loadBalancerLoggingPatchModel) - .name("my-load-balancer") - .subnets(java.util.Arrays.asList(subnetIdentityModel)) + // Construct an instance of the RoutingTablePatch model + RoutingTablePatch routingTablePatchModel = new RoutingTablePatch.Builder() + .acceptRoutesFrom(java.util.Arrays.asList(resourceFilterModel)) + .advertiseRoutesTo(java.util.Arrays.asList("transit_gateway")) + .name("my-routing-table-2") + .routeDirectLinkIngress(true) + .routeInternetIngress(true) + .routeTransitGatewayIngress(true) + .routeVpcZoneIngress(true) .build(); - Map loadBalancerPatchModelAsPatch = loadBalancerPatchModel.asPatch(); + Map routingTablePatchModelAsPatch = routingTablePatchModel.asPatch(); - // Construct an instance of the UpdateLoadBalancerOptions model - UpdateLoadBalancerOptions updateLoadBalancerOptionsModel = new UpdateLoadBalancerOptions.Builder() + // Construct an instance of the UpdateVpcRoutingTableOptions model + UpdateVpcRoutingTableOptions updateVpcRoutingTableOptionsModel = new UpdateVpcRoutingTableOptions.Builder() + .vpcId("testString") .id("testString") - .loadBalancerPatch(loadBalancerPatchModelAsPatch) + .routingTablePatch(routingTablePatchModelAsPatch) .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updateLoadBalancer() with a valid options model and verify the result - Response response = vpcService.updateLoadBalancer(updateLoadBalancerOptionsModel).execute(); + // Invoke updateVpcRoutingTable() with a valid options model and verify the result + Response response = vpcService.updateVpcRoutingTable(updateVpcRoutingTableOptionsModel).execute(); assertNotNull(response); - LoadBalancer responseObj = response.getResult(); + RoutingTable responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -29956,51 +31341,54 @@ public void testUpdateLoadBalancerWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateLoadBalancerPath); + assertEquals(parsedPath, updateVpcRoutingTablePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateLoadBalancer operation with and without retries enabled + // Test the updateVpcRoutingTable operation with and without retries enabled @Test - public void testUpdateLoadBalancerWRetries() throws Throwable { + public void testUpdateVpcRoutingTableWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateLoadBalancerWOptions(); + testUpdateVpcRoutingTableWOptions(); vpcService.disableRetries(); - testUpdateLoadBalancerWOptions(); + testUpdateVpcRoutingTableWOptions(); } - // Test the updateLoadBalancer operation with a null options model (negative test) + // Test the updateVpcRoutingTable operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateLoadBalancerNoOptions() throws Throwable { + public void testUpdateVpcRoutingTableNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateLoadBalancer(null).execute(); + vpcService.updateVpcRoutingTable(null).execute(); } - // Test the getLoadBalancerStatistics operation with a valid options model parameter + // Test the listVpcRoutingTableRoutes operation with a valid options model parameter @Test - public void testGetLoadBalancerStatisticsWOptions() throws Throwable { + public void testListVpcRoutingTableRoutesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active_connections\": 797, \"connection_rate\": 91.121, \"data_processed_this_month\": 10093173145, \"throughput\": 167.278}"; - String getLoadBalancerStatisticsPath = "/load_balancers/testString/statistics"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"routes\": [{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}], \"total_count\": 132}"; + String listVpcRoutingTableRoutesPath = "/vpcs/testString/routing_tables/testString/routes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetLoadBalancerStatisticsOptions model - GetLoadBalancerStatisticsOptions getLoadBalancerStatisticsOptionsModel = new GetLoadBalancerStatisticsOptions.Builder() - .id("testString") + // Construct an instance of the ListVpcRoutingTableRoutesOptions model + ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptionsModel = new ListVpcRoutingTableRoutesOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke getLoadBalancerStatistics() with a valid options model and verify the result - Response response = vpcService.getLoadBalancerStatistics(getLoadBalancerStatisticsOptionsModel).execute(); + // Invoke listVpcRoutingTableRoutes() with a valid options model and verify the result + Response response = vpcService.listVpcRoutingTableRoutes(listVpcRoutingTableRoutesOptionsModel).execute(); assertNotNull(response); - LoadBalancerStatistics responseObj = response.getResult(); + RouteCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -30009,159 +31397,137 @@ public void testGetLoadBalancerStatisticsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getLoadBalancerStatisticsPath); + assertEquals(parsedPath, listVpcRoutingTableRoutesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the getLoadBalancerStatistics operation with and without retries enabled + // Test the listVpcRoutingTableRoutes operation with and without retries enabled @Test - public void testGetLoadBalancerStatisticsWRetries() throws Throwable { + public void testListVpcRoutingTableRoutesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetLoadBalancerStatisticsWOptions(); + testListVpcRoutingTableRoutesWOptions(); vpcService.disableRetries(); - testGetLoadBalancerStatisticsWOptions(); + testListVpcRoutingTableRoutesWOptions(); } - // Test the getLoadBalancerStatistics operation with a null options model (negative test) + // Test the listVpcRoutingTableRoutes operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetLoadBalancerStatisticsNoOptions() throws Throwable { + public void testListVpcRoutingTableRoutesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getLoadBalancerStatistics(null).execute(); + vpcService.listVpcRoutingTableRoutes(null).execute(); } - // Test the listLoadBalancerListeners operation with a valid options model parameter + // Test the listVpcRoutingTableRoutes operation using the VpcRoutingTableRoutesPager.getNext() method @Test - public void testListLoadBalancerListenersWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"listeners\": [{\"accept_proxy_protocol\": true, \"certificate_instance\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"connection_limit\": 2000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"default_pool\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"https_redirect\": {\"http_status_code\": 301, \"listener\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}, \"uri\": \"/example?doc=get\"}, \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"idle_connection_timeout\": 100, \"policies\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\"}], \"port\": 443, \"port_max\": 499, \"port_min\": 443, \"protocol\": \"http\", \"provisioning_status\": \"active\"}]}"; - String listLoadBalancerListenersPath = "/load_balancers/testString/listeners"; + public void testListVpcRoutingTableRoutesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the ListLoadBalancerListenersOptions model - ListLoadBalancerListenersOptions listLoadBalancerListenersOptionsModel = new ListLoadBalancerListenersOptions.Builder() - .loadBalancerId("testString") + ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke listLoadBalancerListeners() with a valid options model and verify the result - Response response = vpcService.listLoadBalancerListeners(listLoadBalancerListenersOptionsModel).execute(); - assertNotNull(response); - LoadBalancerListenerCollection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listLoadBalancerListenersPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + List allResults = new ArrayList<>(); + VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(vpcService, listVpcRoutingTableRoutesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } - - // Test the listLoadBalancerListeners operation with and without retries enabled + + // Test the listVpcRoutingTableRoutes operation using the VpcRoutingTableRoutesPager.getAll() method @Test - public void testListLoadBalancerListenersWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testListLoadBalancerListenersWOptions(); + public void testListVpcRoutingTableRoutesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"delegate\",\"advertise\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"name\":\"my-vpn-gateway\",\"resource_type\":\"vpn_gateway\"},\"destination\":\"192.168.3.0/24\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"id\":\"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\",\"lifecycle_state\":\"stable\",\"name\":\"my-vpc-routing-table-route\",\"next_hop\":{\"address\":\"192.168.3.4\"},\"origin\":\"service\",\"priority\":1,\"zone\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\",\"name\":\"us-south-1\"}}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testListLoadBalancerListenersWOptions(); - } + ListVpcRoutingTableRoutesOptions listVpcRoutingTableRoutesOptions = new ListVpcRoutingTableRoutesOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .limit(Long.valueOf("10")) + .build(); - // Test the listLoadBalancerListeners operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListLoadBalancerListenersNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listLoadBalancerListeners(null).execute(); + VpcRoutingTableRoutesPager pager = new VpcRoutingTableRoutesPager(vpcService, listVpcRoutingTableRoutesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the createLoadBalancerListener operation with a valid options model parameter + + // Test the createVpcRoutingTableRoute operation with a valid options model parameter @Test - public void testCreateLoadBalancerListenerWOptions() throws Throwable { + public void testCreateVpcRoutingTableRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_proxy_protocol\": true, \"certificate_instance\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"connection_limit\": 2000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"default_pool\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"https_redirect\": {\"http_status_code\": 301, \"listener\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}, \"uri\": \"/example?doc=get\"}, \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"idle_connection_timeout\": 100, \"policies\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\"}], \"port\": 443, \"port_max\": 499, \"port_min\": 443, \"protocol\": \"http\", \"provisioning_status\": \"active\"}"; - String createLoadBalancerListenerPath = "/load_balancers/testString/listeners"; + String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String createVpcRoutingTableRoutePath = "/vpcs/testString/routing_tables/testString/routes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the CertificateInstanceIdentityByCRN model - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - // Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - // Construct an instance of the LoadBalancerListenerIdentityById model - LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() - .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") - .build(); - - // Construct an instance of the LoadBalancerListenerHTTPSRedirectPrototype model - LoadBalancerListenerHTTPSRedirectPrototype loadBalancerListenerHttpsRedirectPrototypeModel = new LoadBalancerListenerHTTPSRedirectPrototype.Builder() - .httpStatusCode(Long.valueOf("301")) - .listener(loadBalancerListenerIdentityModel) - .uri("/example?doc=get") - .build(); - - // Construct an instance of the LoadBalancerListenerPolicyRulePrototype model - LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("testString") - .build(); - - // Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + // Construct an instance of the ZoneIdentityByName model + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() + .name("us-south-1") .build(); - // Construct an instance of the LoadBalancerListenerPolicyPrototype model - LoadBalancerListenerPolicyPrototype loadBalancerListenerPolicyPrototypeModel = new LoadBalancerListenerPolicyPrototype.Builder() - .action("forward_to_listener") - .name("my-load-balancer-listener-policy") - .priority(Long.valueOf("5")) - .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) - .target(loadBalancerListenerPolicyTargetPrototypeModel) + // Construct an instance of the RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP model + RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPrototypeModel = new RouteNextHopPrototypeRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("0.0.0.0") .build(); - // Construct an instance of the CreateLoadBalancerListenerOptions model - CreateLoadBalancerListenerOptions createLoadBalancerListenerOptionsModel = new CreateLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") - .protocol("http") - .acceptProxyProtocol(true) - .certificateInstance(certificateInstanceIdentityModel) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerPoolIdentityModel) - .httpsRedirect(loadBalancerListenerHttpsRedirectPrototypeModel) - .idleConnectionTimeout(Long.valueOf("100")) - .policies(java.util.Arrays.asList(loadBalancerListenerPolicyPrototypeModel)) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) + // Construct an instance of the CreateVpcRoutingTableRouteOptions model + CreateVpcRoutingTableRouteOptions createVpcRoutingTableRouteOptionsModel = new CreateVpcRoutingTableRouteOptions.Builder() + .vpcId("testString") + .routingTableId("testString") + .destination("192.168.3.0/24") + .zone(zoneIdentityModel) + .action("deliver") + .advertise(false) + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPrototypeModel) + .priority(Long.valueOf("1")) .build(); - // Invoke createLoadBalancerListener() with a valid options model and verify the result - Response response = vpcService.createLoadBalancerListener(createLoadBalancerListenerOptionsModel).execute(); + // Invoke createVpcRoutingTableRoute() with a valid options model and verify the result + Response response = vpcService.createVpcRoutingTableRoute(createVpcRoutingTableRouteOptionsModel).execute(); assertNotNull(response); - LoadBalancerListener responseObj = response.getResult(); + Route responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -30170,49 +31536,50 @@ public void testCreateLoadBalancerListenerWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createLoadBalancerListenerPath); + assertEquals(parsedPath, createVpcRoutingTableRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createLoadBalancerListener operation with and without retries enabled + // Test the createVpcRoutingTableRoute operation with and without retries enabled @Test - public void testCreateLoadBalancerListenerWRetries() throws Throwable { + public void testCreateVpcRoutingTableRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateLoadBalancerListenerWOptions(); + testCreateVpcRoutingTableRouteWOptions(); vpcService.disableRetries(); - testCreateLoadBalancerListenerWOptions(); + testCreateVpcRoutingTableRouteWOptions(); } - // Test the createLoadBalancerListener operation with a null options model (negative test) + // Test the createVpcRoutingTableRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateLoadBalancerListenerNoOptions() throws Throwable { + public void testCreateVpcRoutingTableRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createLoadBalancerListener(null).execute(); + vpcService.createVpcRoutingTableRoute(null).execute(); } - // Test the deleteLoadBalancerListener operation with a valid options model parameter + // Test the deleteVpcRoutingTableRoute operation with a valid options model parameter @Test - public void testDeleteLoadBalancerListenerWOptions() throws Throwable { + public void testDeleteVpcRoutingTableRouteWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteLoadBalancerListenerPath = "/load_balancers/testString/listeners/testString"; + String deleteVpcRoutingTableRoutePath = "/vpcs/testString/routing_tables/testString/routes/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteLoadBalancerListenerOptions model - DeleteLoadBalancerListenerOptions deleteLoadBalancerListenerOptionsModel = new DeleteLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") + // Construct an instance of the DeleteVpcRoutingTableRouteOptions model + DeleteVpcRoutingTableRouteOptions deleteVpcRoutingTableRouteOptionsModel = new DeleteVpcRoutingTableRouteOptions.Builder() + .vpcId("testString") + .routingTableId("testString") .id("testString") .build(); - // Invoke deleteLoadBalancerListener() with a valid options model and verify the result - Response response = vpcService.deleteLoadBalancerListener(deleteLoadBalancerListenerOptionsModel).execute(); + // Invoke deleteVpcRoutingTableRoute() with a valid options model and verify the result + Response response = vpcService.deleteVpcRoutingTableRoute(deleteVpcRoutingTableRouteOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -30223,52 +31590,53 @@ public void testDeleteLoadBalancerListenerWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteLoadBalancerListenerPath); + assertEquals(parsedPath, deleteVpcRoutingTableRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteLoadBalancerListener operation with and without retries enabled + // Test the deleteVpcRoutingTableRoute operation with and without retries enabled @Test - public void testDeleteLoadBalancerListenerWRetries() throws Throwable { + public void testDeleteVpcRoutingTableRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteLoadBalancerListenerWOptions(); + testDeleteVpcRoutingTableRouteWOptions(); vpcService.disableRetries(); - testDeleteLoadBalancerListenerWOptions(); + testDeleteVpcRoutingTableRouteWOptions(); } - // Test the deleteLoadBalancerListener operation with a null options model (negative test) + // Test the deleteVpcRoutingTableRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteLoadBalancerListenerNoOptions() throws Throwable { + public void testDeleteVpcRoutingTableRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteLoadBalancerListener(null).execute(); + vpcService.deleteVpcRoutingTableRoute(null).execute(); } - // Test the getLoadBalancerListener operation with a valid options model parameter + // Test the getVpcRoutingTableRoute operation with a valid options model parameter @Test - public void testGetLoadBalancerListenerWOptions() throws Throwable { + public void testGetVpcRoutingTableRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_proxy_protocol\": true, \"certificate_instance\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"connection_limit\": 2000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"default_pool\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"https_redirect\": {\"http_status_code\": 301, \"listener\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}, \"uri\": \"/example?doc=get\"}, \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"idle_connection_timeout\": 100, \"policies\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\"}], \"port\": 443, \"port_max\": 499, \"port_min\": 443, \"protocol\": \"http\", \"provisioning_status\": \"active\"}"; - String getLoadBalancerListenerPath = "/load_balancers/testString/listeners/testString"; + String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String getVpcRoutingTableRoutePath = "/vpcs/testString/routing_tables/testString/routes/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetLoadBalancerListenerOptions model - GetLoadBalancerListenerOptions getLoadBalancerListenerOptionsModel = new GetLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") + // Construct an instance of the GetVpcRoutingTableRouteOptions model + GetVpcRoutingTableRouteOptions getVpcRoutingTableRouteOptionsModel = new GetVpcRoutingTableRouteOptions.Builder() + .vpcId("testString") + .routingTableId("testString") .id("testString") .build(); - // Invoke getLoadBalancerListener() with a valid options model and verify the result - Response response = vpcService.getLoadBalancerListener(getLoadBalancerListenerOptionsModel).execute(); + // Invoke getVpcRoutingTableRoute() with a valid options model and verify the result + Response response = vpcService.getVpcRoutingTableRoute(getVpcRoutingTableRouteOptionsModel).execute(); assertNotNull(response); - LoadBalancerListener responseObj = response.getResult(); + Route responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -30277,90 +31645,68 @@ public void testGetLoadBalancerListenerWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getLoadBalancerListenerPath); + assertEquals(parsedPath, getVpcRoutingTableRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getLoadBalancerListener operation with and without retries enabled + // Test the getVpcRoutingTableRoute operation with and without retries enabled @Test - public void testGetLoadBalancerListenerWRetries() throws Throwable { + public void testGetVpcRoutingTableRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetLoadBalancerListenerWOptions(); + testGetVpcRoutingTableRouteWOptions(); vpcService.disableRetries(); - testGetLoadBalancerListenerWOptions(); + testGetVpcRoutingTableRouteWOptions(); } - // Test the getLoadBalancerListener operation with a null options model (negative test) + // Test the getVpcRoutingTableRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetLoadBalancerListenerNoOptions() throws Throwable { + public void testGetVpcRoutingTableRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getLoadBalancerListener(null).execute(); + vpcService.getVpcRoutingTableRoute(null).execute(); } - // Test the updateLoadBalancerListener operation with a valid options model parameter + // Test the updateVpcRoutingTableRoute operation with a valid options model parameter @Test - public void testUpdateLoadBalancerListenerWOptions() throws Throwable { + public void testUpdateVpcRoutingTableRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"accept_proxy_protocol\": true, \"certificate_instance\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"connection_limit\": 2000, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"default_pool\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"https_redirect\": {\"http_status_code\": 301, \"listener\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\"}, \"uri\": \"/example?doc=get\"}, \"id\": \"r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091\", \"idle_connection_timeout\": 100, \"policies\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\"}], \"port\": 443, \"port_max\": 499, \"port_min\": 443, \"protocol\": \"http\", \"provisioning_status\": \"active\"}"; - String updateLoadBalancerListenerPath = "/load_balancers/testString/listeners/testString"; + String mockResponseBody = "{\"action\": \"delegate\", \"advertise\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"name\": \"my-vpn-gateway\", \"resource_type\": \"vpn_gateway\"}, \"destination\": \"192.168.3.0/24\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b/routing_tables/r006-6885e83f-03b2-4603-8a86-db2a0f55c840/routes/r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"id\": \"r006-67b7b783-9a0f-41c1-a7f7-eccff87fb8f1\", \"lifecycle_state\": \"stable\", \"name\": \"my-vpc-routing-table-route\", \"next_hop\": {\"address\": \"192.168.3.4\"}, \"origin\": \"service\", \"priority\": 1, \"zone\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1\", \"name\": \"us-south-1\"}}"; + String updateVpcRoutingTableRoutePath = "/vpcs/testString/routing_tables/testString/routes/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the CertificateInstanceIdentityByCRN model - CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() - .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") - .build(); - - // Construct an instance of the LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById model - LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById loadBalancerListenerDefaultPoolPatchModel = new LoadBalancerListenerDefaultPoolPatchLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - // Construct an instance of the LoadBalancerListenerIdentityById model - LoadBalancerListenerIdentityById loadBalancerListenerIdentityModel = new LoadBalancerListenerIdentityById.Builder() - .id("r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091") - .build(); - - // Construct an instance of the LoadBalancerListenerHTTPSRedirectPatch model - LoadBalancerListenerHTTPSRedirectPatch loadBalancerListenerHttpsRedirectPatchModel = new LoadBalancerListenerHTTPSRedirectPatch.Builder() - .httpStatusCode(Long.valueOf("301")) - .listener(loadBalancerListenerIdentityModel) - .uri("/example?doc=get") + // Construct an instance of the RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP model + RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP routeNextHopPatchModel = new RouteNextHopPatchRouteNextHopIPRouteNextHopIPSentinelIP.Builder() + .address("0.0.0.0") .build(); - // Construct an instance of the LoadBalancerListenerPatch model - LoadBalancerListenerPatch loadBalancerListenerPatchModel = new LoadBalancerListenerPatch.Builder() - .acceptProxyProtocol(true) - .certificateInstance(certificateInstanceIdentityModel) - .connectionLimit(Long.valueOf("2000")) - .defaultPool(loadBalancerListenerDefaultPoolPatchModel) - .httpsRedirect(loadBalancerListenerHttpsRedirectPatchModel) - .idleConnectionTimeout(Long.valueOf("100")) - .port(Long.valueOf("443")) - .portMax(Long.valueOf("499")) - .portMin(Long.valueOf("443")) - .protocol("http") + // Construct an instance of the RoutePatch model + RoutePatch routePatchModel = new RoutePatch.Builder() + .advertise(false) + .name("my-vpc-routing-table-route") + .nextHop(routeNextHopPatchModel) + .priority(Long.valueOf("1")) .build(); - Map loadBalancerListenerPatchModelAsPatch = loadBalancerListenerPatchModel.asPatch(); + Map routePatchModelAsPatch = routePatchModel.asPatch(); - // Construct an instance of the UpdateLoadBalancerListenerOptions model - UpdateLoadBalancerListenerOptions updateLoadBalancerListenerOptionsModel = new UpdateLoadBalancerListenerOptions.Builder() - .loadBalancerId("testString") + // Construct an instance of the UpdateVpcRoutingTableRouteOptions model + UpdateVpcRoutingTableRouteOptions updateVpcRoutingTableRouteOptionsModel = new UpdateVpcRoutingTableRouteOptions.Builder() + .vpcId("testString") + .routingTableId("testString") .id("testString") - .loadBalancerListenerPatch(loadBalancerListenerPatchModelAsPatch) + .routePatch(routePatchModelAsPatch) .build(); - // Invoke updateLoadBalancerListener() with a valid options model and verify the result - Response response = vpcService.updateLoadBalancerListener(updateLoadBalancerListenerOptionsModel).execute(); + // Invoke updateVpcRoutingTableRoute() with a valid options model and verify the result + Response response = vpcService.updateVpcRoutingTableRoute(updateVpcRoutingTableRouteOptionsModel).execute(); assertNotNull(response); - LoadBalancerListener responseObj = response.getResult(); + Route responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -30369,52 +31715,52 @@ public void testUpdateLoadBalancerListenerWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateLoadBalancerListenerPath); + assertEquals(parsedPath, updateVpcRoutingTableRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateLoadBalancerListener operation with and without retries enabled + // Test the updateVpcRoutingTableRoute operation with and without retries enabled @Test - public void testUpdateLoadBalancerListenerWRetries() throws Throwable { + public void testUpdateVpcRoutingTableRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateLoadBalancerListenerWOptions(); + testUpdateVpcRoutingTableRouteWOptions(); vpcService.disableRetries(); - testUpdateLoadBalancerListenerWOptions(); + testUpdateVpcRoutingTableRouteWOptions(); } - // Test the updateLoadBalancerListener operation with a null options model (negative test) + // Test the updateVpcRoutingTableRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateLoadBalancerListenerNoOptions() throws Throwable { + public void testUpdateVpcRoutingTableRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateLoadBalancerListener(null).execute(); + vpcService.updateVpcRoutingTableRoute(null).execute(); } - // Test the listLoadBalancerListenerPolicies operation with a valid options model parameter + // Test the listIkePolicies operation with a valid options model parameter @Test - public void testListLoadBalancerListenerPoliciesWOptions() throws Throwable { + public void testListIkePoliciesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"policies\": [{\"action\": \"forward_to_listener\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\", \"priority\": 5, \"provisioning_status\": \"active\", \"rules\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\"}], \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}]}"; - String listLoadBalancerListenerPoliciesPath = "/load_balancers/testString/listeners/testString/policies"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ike_policies\": [{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dh_group\": 14, \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"ike_version\": 1, \"key_lifetime\": 28800, \"name\": \"my-ike-policy\", \"negotiation_mode\": \"main\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ike_policy\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listIkePoliciesPath = "/ike_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListLoadBalancerListenerPoliciesOptions model - ListLoadBalancerListenerPoliciesOptions listLoadBalancerListenerPoliciesOptionsModel = new ListLoadBalancerListenerPoliciesOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") + // Construct an instance of the ListIkePoliciesOptions model + ListIkePoliciesOptions listIkePoliciesOptionsModel = new ListIkePoliciesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke listLoadBalancerListenerPolicies() with a valid options model and verify the result - Response response = vpcService.listLoadBalancerListenerPolicies(listLoadBalancerListenerPoliciesOptionsModel).execute(); + // Invoke listIkePolicies() with a valid options model and verify the result + Response response = vpcService.listIkePolicies(listIkePoliciesOptionsModel).execute(); assertNotNull(response); - LoadBalancerListenerPolicyCollection responseObj = response.getResult(); + IKEPolicyCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -30423,70 +31769,119 @@ public void testListLoadBalancerListenerPoliciesWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listLoadBalancerListenerPoliciesPath); + assertEquals(parsedPath, listIkePoliciesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the listLoadBalancerListenerPolicies operation with and without retries enabled + // Test the listIkePolicies operation with and without retries enabled @Test - public void testListLoadBalancerListenerPoliciesWRetries() throws Throwable { + public void testListIkePoliciesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListLoadBalancerListenerPoliciesWOptions(); + testListIkePoliciesWOptions(); vpcService.disableRetries(); - testListLoadBalancerListenerPoliciesWOptions(); + testListIkePoliciesWOptions(); } - // Test the listLoadBalancerListenerPolicies operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListLoadBalancerListenerPoliciesNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.listLoadBalancerListenerPolicies(null).execute(); + // Test the listIkePolicies operation using the IkePoliciesPager.getNext() method + @Test + public void testListIkePoliciesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + IkePoliciesPager pager = new IkePoliciesPager(vpcService, listIkePoliciesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } + + // Test the listIkePolicies operation using the IkePoliciesPager.getAll() method + @Test + public void testListIkePoliciesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + String mockResponsePage2 = "{\"total_count\":2,\"ike_policies\":[{\"authentication_algorithm\":\"md5\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dh_group\":14,\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"ike_version\":1,\"key_lifetime\":28800,\"name\":\"my-ike-policy\",\"negotiation_mode\":\"main\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ike_policy\"}],\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Test the createLoadBalancerListenerPolicy operation with a valid options model parameter + ListIkePoliciesOptions listIkePoliciesOptions = new ListIkePoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + IkePoliciesPager pager = new IkePoliciesPager(vpcService, listIkePoliciesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createIkePolicy operation with a valid options model parameter @Test - public void testCreateLoadBalancerListenerPolicyWOptions() throws Throwable { + public void testCreateIkePolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"forward_to_listener\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\", \"priority\": 5, \"provisioning_status\": \"active\", \"rules\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\"}], \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}"; - String createLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies"; + String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dh_group\": 14, \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"ike_version\": 1, \"key_lifetime\": 28800, \"name\": \"my-ike-policy\", \"negotiation_mode\": \"main\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ike_policy\"}"; + String createIkePolicyPath = "/ike_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerListenerPolicyRulePrototype model - LoadBalancerListenerPolicyRulePrototype loadBalancerListenerPolicyRulePrototypeModel = new LoadBalancerListenerPolicyRulePrototype.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("testString") - .build(); - - // Construct an instance of the LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPrototypeModel = new LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the CreateLoadBalancerListenerPolicyOptions model - CreateLoadBalancerListenerPolicyOptions createLoadBalancerListenerPolicyOptionsModel = new CreateLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .action("forward_to_listener") - .priority(Long.valueOf("5")) - .name("my-load-balancer-listener-policy") - .rules(java.util.Arrays.asList(loadBalancerListenerPolicyRulePrototypeModel)) - .target(loadBalancerListenerPolicyTargetPrototypeModel) + // Construct an instance of the CreateIkePolicyOptions model + CreateIkePolicyOptions createIkePolicyOptionsModel = new CreateIkePolicyOptions.Builder() + .authenticationAlgorithm("sha256") + .dhGroup(Long.valueOf("14")) + .encryptionAlgorithm("aes128") + .ikeVersion(Long.valueOf("1")) + .keyLifetime(Long.valueOf("28800")) + .name("my-ike-policy") + .resourceGroup(resourceGroupIdentityModel) .build(); - // Invoke createLoadBalancerListenerPolicy() with a valid options model and verify the result - Response response = vpcService.createLoadBalancerListenerPolicy(createLoadBalancerListenerPolicyOptionsModel).execute(); + // Invoke createIkePolicy() with a valid options model and verify the result + Response response = vpcService.createIkePolicy(createIkePolicyOptionsModel).execute(); assertNotNull(response); - LoadBalancerListenerPolicy responseObj = response.getResult(); + IKEPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -30495,50 +31890,48 @@ public void testCreateLoadBalancerListenerPolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createLoadBalancerListenerPolicyPath); + assertEquals(parsedPath, createIkePolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createLoadBalancerListenerPolicy operation with and without retries enabled + // Test the createIkePolicy operation with and without retries enabled @Test - public void testCreateLoadBalancerListenerPolicyWRetries() throws Throwable { + public void testCreateIkePolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateLoadBalancerListenerPolicyWOptions(); + testCreateIkePolicyWOptions(); vpcService.disableRetries(); - testCreateLoadBalancerListenerPolicyWOptions(); + testCreateIkePolicyWOptions(); } - // Test the createLoadBalancerListenerPolicy operation with a null options model (negative test) + // Test the createIkePolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateLoadBalancerListenerPolicyNoOptions() throws Throwable { + public void testCreateIkePolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createLoadBalancerListenerPolicy(null).execute(); + vpcService.createIkePolicy(null).execute(); } - // Test the deleteLoadBalancerListenerPolicy operation with a valid options model parameter + // Test the deleteIkePolicy operation with a valid options model parameter @Test - public void testDeleteLoadBalancerListenerPolicyWOptions() throws Throwable { + public void testDeleteIkePolicyWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies/testString"; + String deleteIkePolicyPath = "/ike_policies/testString"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteLoadBalancerListenerPolicyOptions model - DeleteLoadBalancerListenerPolicyOptions deleteLoadBalancerListenerPolicyOptionsModel = new DeleteLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") + // Construct an instance of the DeleteIkePolicyOptions model + DeleteIkePolicyOptions deleteIkePolicyOptionsModel = new DeleteIkePolicyOptions.Builder() .id("testString") .build(); - // Invoke deleteLoadBalancerListenerPolicy() with a valid options model and verify the result - Response response = vpcService.deleteLoadBalancerListenerPolicy(deleteLoadBalancerListenerPolicyOptionsModel).execute(); + // Invoke deleteIkePolicy() with a valid options model and verify the result + Response response = vpcService.deleteIkePolicy(deleteIkePolicyOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -30549,466 +31942,516 @@ public void testDeleteLoadBalancerListenerPolicyWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteLoadBalancerListenerPolicyPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the deleteLoadBalancerListenerPolicy operation with and without retries enabled - @Test - public void testDeleteLoadBalancerListenerPolicyWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testDeleteLoadBalancerListenerPolicyWOptions(); - - vpcService.disableRetries(); - testDeleteLoadBalancerListenerPolicyWOptions(); - } - - // Test the deleteLoadBalancerListenerPolicy operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteLoadBalancerListenerPolicyNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.deleteLoadBalancerListenerPolicy(null).execute(); - } - - // Test the getLoadBalancerListenerPolicy operation with a valid options model parameter - @Test - public void testGetLoadBalancerListenerPolicyWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"action\": \"forward_to_listener\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\", \"priority\": 5, \"provisioning_status\": \"active\", \"rules\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\"}], \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}"; - String getLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies/testString"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetLoadBalancerListenerPolicyOptions model - GetLoadBalancerListenerPolicyOptions getLoadBalancerListenerPolicyOptionsModel = new GetLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .id("testString") - .build(); - - // Invoke getLoadBalancerListenerPolicy() with a valid options model and verify the result - Response response = vpcService.getLoadBalancerListenerPolicy(getLoadBalancerListenerPolicyOptionsModel).execute(); - assertNotNull(response); - LoadBalancerListenerPolicy responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getLoadBalancerListenerPolicyPath); + assertEquals(parsedPath, deleteIkePolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getLoadBalancerListenerPolicy operation with and without retries enabled + // Test the deleteIkePolicy operation with and without retries enabled @Test - public void testGetLoadBalancerListenerPolicyWRetries() throws Throwable { + public void testDeleteIkePolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetLoadBalancerListenerPolicyWOptions(); + testDeleteIkePolicyWOptions(); vpcService.disableRetries(); - testGetLoadBalancerListenerPolicyWOptions(); + testDeleteIkePolicyWOptions(); } - // Test the getLoadBalancerListenerPolicy operation with a null options model (negative test) + // Test the deleteIkePolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetLoadBalancerListenerPolicyNoOptions() throws Throwable { + public void testDeleteIkePolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getLoadBalancerListenerPolicy(null).execute(); + vpcService.deleteIkePolicy(null).execute(); } - // Test the updateLoadBalancerListenerPolicy operation with a valid options model parameter + // Test the getIkePolicy operation with a valid options model parameter @Test - public void testUpdateLoadBalancerListenerPolicyWOptions() throws Throwable { + public void testGetIkePolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"action\": \"forward_to_listener\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"id\": \"r006-0b00a37f-a3d7-43ca-8187-f1e88d659245\", \"name\": \"my-load-balancer-listener-policy\", \"priority\": 5, \"provisioning_status\": \"active\", \"rules\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\"}], \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}"; - String updateLoadBalancerListenerPolicyPath = "/load_balancers/testString/listeners/testString/policies/testString"; + String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dh_group\": 14, \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"ike_version\": 1, \"key_lifetime\": 28800, \"name\": \"my-ike-policy\", \"negotiation_mode\": \"main\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ike_policy\"}"; + String getIkePolicyPath = "/ike_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerListenerPolicyTargetPatchModel = new LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - // Construct an instance of the LoadBalancerListenerPolicyPatch model - LoadBalancerListenerPolicyPatch loadBalancerListenerPolicyPatchModel = new LoadBalancerListenerPolicyPatch.Builder() - .name("my-load-balancer-listener-policy-updated") - .priority(Long.valueOf("5")) - .target(loadBalancerListenerPolicyTargetPatchModel) - .build(); - Map loadBalancerListenerPolicyPatchModelAsPatch = loadBalancerListenerPolicyPatchModel.asPatch(); - - // Construct an instance of the UpdateLoadBalancerListenerPolicyOptions model - UpdateLoadBalancerListenerPolicyOptions updateLoadBalancerListenerPolicyOptionsModel = new UpdateLoadBalancerListenerPolicyOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") + // Construct an instance of the GetIkePolicyOptions model + GetIkePolicyOptions getIkePolicyOptionsModel = new GetIkePolicyOptions.Builder() .id("testString") - .loadBalancerListenerPolicyPatch(loadBalancerListenerPolicyPatchModelAsPatch) .build(); - // Invoke updateLoadBalancerListenerPolicy() with a valid options model and verify the result - Response response = vpcService.updateLoadBalancerListenerPolicy(updateLoadBalancerListenerPolicyOptionsModel).execute(); + // Invoke getIkePolicy() with a valid options model and verify the result + Response response = vpcService.getIkePolicy(getIkePolicyOptionsModel).execute(); assertNotNull(response); - LoadBalancerListenerPolicy responseObj = response.getResult(); + IKEPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateLoadBalancerListenerPolicyPath); + assertEquals(parsedPath, getIkePolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateLoadBalancerListenerPolicy operation with and without retries enabled + // Test the getIkePolicy operation with and without retries enabled @Test - public void testUpdateLoadBalancerListenerPolicyWRetries() throws Throwable { + public void testGetIkePolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateLoadBalancerListenerPolicyWOptions(); + testGetIkePolicyWOptions(); vpcService.disableRetries(); - testUpdateLoadBalancerListenerPolicyWOptions(); + testGetIkePolicyWOptions(); } - // Test the updateLoadBalancerListenerPolicy operation with a null options model (negative test) + // Test the getIkePolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateLoadBalancerListenerPolicyNoOptions() throws Throwable { + public void testGetIkePolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateLoadBalancerListenerPolicy(null).execute(); + vpcService.getIkePolicy(null).execute(); } - // Test the listLoadBalancerListenerPolicyRules operation with a valid options model parameter + // Test the updateIkePolicy operation with a valid options model parameter @Test - public void testListLoadBalancerListenerPolicyRulesWOptions() throws Throwable { + public void testUpdateIkePolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"rules\": [{\"condition\": \"contains\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"field\": \"MY-APP-HEADER\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"provisioning_status\": \"active\", \"type\": \"body\", \"value\": \"value\"}]}"; - String listLoadBalancerListenerPolicyRulesPath = "/load_balancers/testString/listeners/testString/policies/testString/rules"; + String mockResponseBody = "{\"authentication_algorithm\": \"md5\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dh_group\": 14, \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"ike_version\": 1, \"key_lifetime\": 28800, \"name\": \"my-ike-policy\", \"negotiation_mode\": \"main\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ike_policy\"}"; + String updateIkePolicyPath = "/ike_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListLoadBalancerListenerPolicyRulesOptions model - ListLoadBalancerListenerPolicyRulesOptions listLoadBalancerListenerPolicyRulesOptionsModel = new ListLoadBalancerListenerPolicyRulesOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") + // Construct an instance of the IKEPolicyPatch model + IKEPolicyPatch ikePolicyPatchModel = new IKEPolicyPatch.Builder() + .authenticationAlgorithm("sha256") + .dhGroup(Long.valueOf("14")) + .encryptionAlgorithm("aes128") + .ikeVersion(Long.valueOf("1")) + .keyLifetime(Long.valueOf("86400")) + .name("my-ike-policy") .build(); + Map ikePolicyPatchModelAsPatch = ikePolicyPatchModel.asPatch(); - // Invoke listLoadBalancerListenerPolicyRules() with a valid options model and verify the result - Response response = vpcService.listLoadBalancerListenerPolicyRules(listLoadBalancerListenerPolicyRulesOptionsModel).execute(); + // Construct an instance of the UpdateIkePolicyOptions model + UpdateIkePolicyOptions updateIkePolicyOptionsModel = new UpdateIkePolicyOptions.Builder() + .id("testString") + .ikePolicyPatch(ikePolicyPatchModelAsPatch) + .build(); + + // Invoke updateIkePolicy() with a valid options model and verify the result + Response response = vpcService.updateIkePolicy(updateIkePolicyOptionsModel).execute(); assertNotNull(response); - LoadBalancerListenerPolicyRuleCollection responseObj = response.getResult(); + IKEPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listLoadBalancerListenerPolicyRulesPath); + assertEquals(parsedPath, updateIkePolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listLoadBalancerListenerPolicyRules operation with and without retries enabled + // Test the updateIkePolicy operation with and without retries enabled @Test - public void testListLoadBalancerListenerPolicyRulesWRetries() throws Throwable { + public void testUpdateIkePolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListLoadBalancerListenerPolicyRulesWOptions(); + testUpdateIkePolicyWOptions(); vpcService.disableRetries(); - testListLoadBalancerListenerPolicyRulesWOptions(); + testUpdateIkePolicyWOptions(); } - // Test the listLoadBalancerListenerPolicyRules operation with a null options model (negative test) + // Test the updateIkePolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListLoadBalancerListenerPolicyRulesNoOptions() throws Throwable { + public void testUpdateIkePolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listLoadBalancerListenerPolicyRules(null).execute(); + vpcService.updateIkePolicy(null).execute(); } - // Test the createLoadBalancerListenerPolicyRule operation with a valid options model parameter + // Test the listIkePolicyConnections operation with a valid options model parameter @Test - public void testCreateLoadBalancerListenerPolicyRuleWOptions() throws Throwable { + public void testListIkePolicyConnectionsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"condition\": \"contains\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"field\": \"MY-APP-HEADER\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"provisioning_status\": \"active\", \"type\": \"body\", \"value\": \"value\"}"; - String createLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules"; + String mockResponseBody = "{\"connections\": [{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listIkePolicyConnectionsPath = "/ike_policies/testString/connections"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the CreateLoadBalancerListenerPolicyRuleOptions model - CreateLoadBalancerListenerPolicyRuleOptions createLoadBalancerListenerPolicyRuleOptionsModel = new CreateLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .condition("contains") - .type("body") - .value("testString") - .field("MY-APP-HEADER") + // Construct an instance of the ListIkePolicyConnectionsOptions model + ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptionsModel = new ListIkePolicyConnectionsOptions.Builder() + .id("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke createLoadBalancerListenerPolicyRule() with a valid options model and verify the result - Response response = vpcService.createLoadBalancerListenerPolicyRule(createLoadBalancerListenerPolicyRuleOptionsModel).execute(); + // Invoke listIkePolicyConnections() with a valid options model and verify the result + Response response = vpcService.listIkePolicyConnections(listIkePolicyConnectionsOptionsModel).execute(); assertNotNull(response); - LoadBalancerListenerPolicyRule responseObj = response.getResult(); + IKEPolicyConnectionCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createLoadBalancerListenerPolicyRulePath); + assertEquals(parsedPath, listIkePolicyConnectionsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the createLoadBalancerListenerPolicyRule operation with and without retries enabled + // Test the listIkePolicyConnections operation with and without retries enabled @Test - public void testCreateLoadBalancerListenerPolicyRuleWRetries() throws Throwable { + public void testListIkePolicyConnectionsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateLoadBalancerListenerPolicyRuleWOptions(); + testListIkePolicyConnectionsWOptions(); vpcService.disableRetries(); - testCreateLoadBalancerListenerPolicyRuleWOptions(); + testListIkePolicyConnectionsWOptions(); } - // Test the createLoadBalancerListenerPolicyRule operation with a null options model (negative test) + // Test the listIkePolicyConnections operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateLoadBalancerListenerPolicyRuleNoOptions() throws Throwable { + public void testListIkePolicyConnectionsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createLoadBalancerListenerPolicyRule(null).execute(); + vpcService.listIkePolicyConnections(null).execute(); } - // Test the deleteLoadBalancerListenerPolicyRule operation with a valid options model parameter + // Test the listIkePolicyConnections operation using the IkePolicyConnectionsPager.getNext() method @Test - public void testDeleteLoadBalancerListenerPolicyRuleWOptions() throws Throwable { + public void testListIkePolicyConnectionsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions = new ListIkePolicyConnectionsOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + IkePolicyConnectionsPager pager = new IkePolicyConnectionsPager(vpcService, listIkePolicyConnectionsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listIkePolicyConnections operation using the IkePolicyConnectionsPager.getAll() method + @Test + public void testListIkePolicyConnectionsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIkePolicyConnectionsOptions listIkePolicyConnectionsOptions = new ListIkePolicyConnectionsOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); + + IkePolicyConnectionsPager pager = new IkePolicyConnectionsPager(vpcService, listIkePolicyConnectionsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the listIpsecPolicies operation with a valid options model parameter + @Test + public void testListIpsecPoliciesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ipsec_policies\": [{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listIpsecPoliciesPath = "/ipsec_policies"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteLoadBalancerListenerPolicyRuleOptions model - DeleteLoadBalancerListenerPolicyRuleOptions deleteLoadBalancerListenerPolicyRuleOptionsModel = new DeleteLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .id("testString") + // Construct an instance of the ListIpsecPoliciesOptions model + ListIpsecPoliciesOptions listIpsecPoliciesOptionsModel = new ListIpsecPoliciesOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke deleteLoadBalancerListenerPolicyRule() with a valid options model and verify the result - Response response = vpcService.deleteLoadBalancerListenerPolicyRule(deleteLoadBalancerListenerPolicyRuleOptionsModel).execute(); + // Invoke listIpsecPolicies() with a valid options model and verify the result + Response response = vpcService.listIpsecPolicies(listIpsecPoliciesOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + IPsecPolicyCollection responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteLoadBalancerListenerPolicyRulePath); + assertEquals(parsedPath, listIpsecPoliciesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the deleteLoadBalancerListenerPolicyRule operation with and without retries enabled + // Test the listIpsecPolicies operation with and without retries enabled @Test - public void testDeleteLoadBalancerListenerPolicyRuleWRetries() throws Throwable { + public void testListIpsecPoliciesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteLoadBalancerListenerPolicyRuleWOptions(); + testListIpsecPoliciesWOptions(); vpcService.disableRetries(); - testDeleteLoadBalancerListenerPolicyRuleWOptions(); + testListIpsecPoliciesWOptions(); } - // Test the deleteLoadBalancerListenerPolicyRule operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteLoadBalancerListenerPolicyRuleNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.deleteLoadBalancerListenerPolicyRule(null).execute(); + // Test the listIpsecPolicies operation using the IpsecPoliciesPager.getNext() method + @Test + public void testListIpsecPoliciesWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + IpsecPoliciesPager pager = new IpsecPoliciesPager(vpcService, listIpsecPoliciesOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } + + // Test the listIpsecPolicies operation using the IpsecPoliciesPager.getAll() method + @Test + public void testListIpsecPoliciesWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"ipsec_policies\":[{\"authentication_algorithm\":\"disabled\",\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"encapsulation_mode\":\"tunnel\",\"encryption_algorithm\":\"aes128\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"key_lifetime\":3600,\"name\":\"my-ipsec-policy\",\"pfs\":\"disabled\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"ipsec_policy\",\"transform_protocol\":\"esp\"}],\"total_count\":2,\"limit\":1}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Test the getLoadBalancerListenerPolicyRule operation with a valid options model parameter + ListIpsecPoliciesOptions listIpsecPoliciesOptions = new ListIpsecPoliciesOptions.Builder() + .limit(Long.valueOf("10")) + .build(); + + IpsecPoliciesPager pager = new IpsecPoliciesPager(vpcService, listIpsecPoliciesOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createIpsecPolicy operation with a valid options model parameter @Test - public void testGetLoadBalancerListenerPolicyRuleWOptions() throws Throwable { + public void testCreateIpsecPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"condition\": \"contains\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"field\": \"MY-APP-HEADER\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"provisioning_status\": \"active\", \"type\": \"body\", \"value\": \"value\"}"; - String getLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"; + String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; + String createIpsecPolicyPath = "/ipsec_policies"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the GetLoadBalancerListenerPolicyRuleOptions model - GetLoadBalancerListenerPolicyRuleOptions getLoadBalancerListenerPolicyRuleOptionsModel = new GetLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") - .id("testString") + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Invoke getLoadBalancerListenerPolicyRule() with a valid options model and verify the result - Response response = vpcService.getLoadBalancerListenerPolicyRule(getLoadBalancerListenerPolicyRuleOptionsModel).execute(); + // Construct an instance of the CreateIpsecPolicyOptions model + CreateIpsecPolicyOptions createIpsecPolicyOptionsModel = new CreateIpsecPolicyOptions.Builder() + .authenticationAlgorithm("disabled") + .encryptionAlgorithm("aes128") + .pfs("disabled") + .keyLifetime(Long.valueOf("3600")) + .name("my-ipsec-policy") + .resourceGroup(resourceGroupIdentityModel) + .build(); + + // Invoke createIpsecPolicy() with a valid options model and verify the result + Response response = vpcService.createIpsecPolicy(createIpsecPolicyOptionsModel).execute(); assertNotNull(response); - LoadBalancerListenerPolicyRule responseObj = response.getResult(); + IPsecPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getLoadBalancerListenerPolicyRulePath); + assertEquals(parsedPath, createIpsecPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getLoadBalancerListenerPolicyRule operation with and without retries enabled + // Test the createIpsecPolicy operation with and without retries enabled @Test - public void testGetLoadBalancerListenerPolicyRuleWRetries() throws Throwable { + public void testCreateIpsecPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetLoadBalancerListenerPolicyRuleWOptions(); + testCreateIpsecPolicyWOptions(); vpcService.disableRetries(); - testGetLoadBalancerListenerPolicyRuleWOptions(); + testCreateIpsecPolicyWOptions(); } - // Test the getLoadBalancerListenerPolicyRule operation with a null options model (negative test) + // Test the createIpsecPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetLoadBalancerListenerPolicyRuleNoOptions() throws Throwable { + public void testCreateIpsecPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getLoadBalancerListenerPolicyRule(null).execute(); + vpcService.createIpsecPolicy(null).execute(); } - // Test the updateLoadBalancerListenerPolicyRule operation with a valid options model parameter + // Test the deleteIpsecPolicy operation with a valid options model parameter @Test - public void testUpdateLoadBalancerListenerPolicyRuleWOptions() throws Throwable { + public void testDeleteIpsecPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"condition\": \"contains\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"field\": \"MY-APP-HEADER\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/r006-97c05c26-4748-4db8-ac3f-d8a9c79a7091/policies/r006-0b00a37f-a3d7-43ca-8187-f1e88d659245/rules/r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"id\": \"r006-d2da2832-9751-4e29-ad1d-4b19c1c83c7b\", \"provisioning_status\": \"active\", \"type\": \"body\", \"value\": \"value\"}"; - String updateLoadBalancerListenerPolicyRulePath = "/load_balancers/testString/listeners/testString/policies/testString/rules/testString"; + String mockResponseBody = ""; + String deleteIpsecPolicyPath = "/ipsec_policies/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerListenerPolicyRulePatch model - LoadBalancerListenerPolicyRulePatch loadBalancerListenerPolicyRulePatchModel = new LoadBalancerListenerPolicyRulePatch.Builder() - .condition("contains") - .field("MY-APP-HEADER") - .type("body") - .value("my-example-hostname-updated") - .build(); - Map loadBalancerListenerPolicyRulePatchModelAsPatch = loadBalancerListenerPolicyRulePatchModel.asPatch(); - - // Construct an instance of the UpdateLoadBalancerListenerPolicyRuleOptions model - UpdateLoadBalancerListenerPolicyRuleOptions updateLoadBalancerListenerPolicyRuleOptionsModel = new UpdateLoadBalancerListenerPolicyRuleOptions.Builder() - .loadBalancerId("testString") - .listenerId("testString") - .policyId("testString") + // Construct an instance of the DeleteIpsecPolicyOptions model + DeleteIpsecPolicyOptions deleteIpsecPolicyOptionsModel = new DeleteIpsecPolicyOptions.Builder() .id("testString") - .loadBalancerListenerPolicyRulePatch(loadBalancerListenerPolicyRulePatchModelAsPatch) .build(); - // Invoke updateLoadBalancerListenerPolicyRule() with a valid options model and verify the result - Response response = vpcService.updateLoadBalancerListenerPolicyRule(updateLoadBalancerListenerPolicyRuleOptionsModel).execute(); + // Invoke deleteIpsecPolicy() with a valid options model and verify the result + Response response = vpcService.deleteIpsecPolicy(deleteIpsecPolicyOptionsModel).execute(); assertNotNull(response); - LoadBalancerListenerPolicyRule responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateLoadBalancerListenerPolicyRulePath); + assertEquals(parsedPath, deleteIpsecPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateLoadBalancerListenerPolicyRule operation with and without retries enabled + // Test the deleteIpsecPolicy operation with and without retries enabled @Test - public void testUpdateLoadBalancerListenerPolicyRuleWRetries() throws Throwable { + public void testDeleteIpsecPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateLoadBalancerListenerPolicyRuleWOptions(); + testDeleteIpsecPolicyWOptions(); vpcService.disableRetries(); - testUpdateLoadBalancerListenerPolicyRuleWOptions(); + testDeleteIpsecPolicyWOptions(); } - // Test the updateLoadBalancerListenerPolicyRule operation with a null options model (negative test) + // Test the deleteIpsecPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateLoadBalancerListenerPolicyRuleNoOptions() throws Throwable { + public void testDeleteIpsecPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateLoadBalancerListenerPolicyRule(null).execute(); + vpcService.deleteIpsecPolicy(null).execute(); } - // Test the listLoadBalancerPools operation with a valid options model parameter + // Test the getIpsecPolicy operation with a valid options model parameter @Test - public void testListLoadBalancerPoolsWOptions() throws Throwable { + public void testGetIpsecPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"pools\": [{\"algorithm\": \"least_connections\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"failsafe_policy\": {\"action\": \"forward\", \"healthy_member_threshold_count\": 0, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}, \"health_monitor\": {\"delay\": 5, \"max_retries\": 2, \"port\": 22, \"timeout\": 2, \"type\": \"tcp\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"name\": \"my-load-balancer-pool\", \"protocol\": \"http\", \"provisioning_status\": \"active\", \"proxy_protocol\": \"disabled\", \"session_persistence\": {\"cookie_name\": \"my-cookie-name\", \"type\": \"app_cookie\"}}]}"; - String listLoadBalancerPoolsPath = "/load_balancers/testString/pools"; + String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; + String getIpsecPolicyPath = "/ipsec_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListLoadBalancerPoolsOptions model - ListLoadBalancerPoolsOptions listLoadBalancerPoolsOptionsModel = new ListLoadBalancerPoolsOptions.Builder() - .loadBalancerId("testString") + // Construct an instance of the GetIpsecPolicyOptions model + GetIpsecPolicyOptions getIpsecPolicyOptionsModel = new GetIpsecPolicyOptions.Builder() + .id("testString") .build(); - // Invoke listLoadBalancerPools() with a valid options model and verify the result - Response response = vpcService.listLoadBalancerPools(listLoadBalancerPoolsOptionsModel).execute(); + // Invoke getIpsecPolicy() with a valid options model and verify the result + Response response = vpcService.getIpsecPolicy(getIpsecPolicyOptionsModel).execute(); assertNotNull(response); - LoadBalancerPoolCollection responseObj = response.getResult(); + IPsecPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -31017,204 +32460,240 @@ public void testListLoadBalancerPoolsWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listLoadBalancerPoolsPath); + assertEquals(parsedPath, getIpsecPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listLoadBalancerPools operation with and without retries enabled + // Test the getIpsecPolicy operation with and without retries enabled @Test - public void testListLoadBalancerPoolsWRetries() throws Throwable { + public void testGetIpsecPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListLoadBalancerPoolsWOptions(); + testGetIpsecPolicyWOptions(); vpcService.disableRetries(); - testListLoadBalancerPoolsWOptions(); + testGetIpsecPolicyWOptions(); } - // Test the listLoadBalancerPools operation with a null options model (negative test) + // Test the getIpsecPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListLoadBalancerPoolsNoOptions() throws Throwable { + public void testGetIpsecPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listLoadBalancerPools(null).execute(); + vpcService.getIpsecPolicy(null).execute(); } - // Test the createLoadBalancerPool operation with a valid options model parameter + // Test the updateIpsecPolicy operation with a valid options model parameter @Test - public void testCreateLoadBalancerPoolWOptions() throws Throwable { + public void testUpdateIpsecPolicyWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"algorithm\": \"least_connections\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"failsafe_policy\": {\"action\": \"forward\", \"healthy_member_threshold_count\": 0, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}, \"health_monitor\": {\"delay\": 5, \"max_retries\": 2, \"port\": 22, \"timeout\": 2, \"type\": \"tcp\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"name\": \"my-load-balancer-pool\", \"protocol\": \"http\", \"provisioning_status\": \"active\", \"proxy_protocol\": \"disabled\", \"session_persistence\": {\"cookie_name\": \"my-cookie-name\", \"type\": \"app_cookie\"}}"; - String createLoadBalancerPoolPath = "/load_balancers/testString/pools"; + String mockResponseBody = "{\"authentication_algorithm\": \"disabled\", \"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"encapsulation_mode\": \"tunnel\", \"encryption_algorithm\": \"aes128\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"key_lifetime\": 3600, \"name\": \"my-ipsec-policy\", \"pfs\": \"disabled\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"ipsec_policy\", \"transform_protocol\": \"esp\"}"; + String updateIpsecPolicyPath = "/ipsec_policies/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype model - LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype loadBalancerPoolHealthMonitorPrototypeModel = new LoadBalancerPoolHealthMonitorPrototypeLoadBalancerPoolHealthMonitorTypeTCPPrototype.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("tcp") - .build(); - - // Construct an instance of the LoadBalancerPoolIdentityLoadBalancerPoolIdentityById model - LoadBalancerPoolIdentityLoadBalancerPoolIdentityById loadBalancerPoolIdentityModel = new LoadBalancerPoolIdentityLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") - .build(); - - // Construct an instance of the LoadBalancerPoolFailsafePolicyPrototype model - LoadBalancerPoolFailsafePolicyPrototype loadBalancerPoolFailsafePolicyPrototypeModel = new LoadBalancerPoolFailsafePolicyPrototype.Builder() - .action("forward") - .target(loadBalancerPoolIdentityModel) - .build(); - - // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") - .build(); - - // Construct an instance of the LoadBalancerPoolMemberPrototype model - LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); - - // Construct an instance of the LoadBalancerPoolSessionPersistencePrototype model - LoadBalancerPoolSessionPersistencePrototype loadBalancerPoolSessionPersistencePrototypeModel = new LoadBalancerPoolSessionPersistencePrototype.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") + // Construct an instance of the IPsecPolicyPatch model + IPsecPolicyPatch iPsecPolicyPatchModel = new IPsecPolicyPatch.Builder() + .authenticationAlgorithm("disabled") + .encryptionAlgorithm("aes128") + .keyLifetime(Long.valueOf("3600")) + .name("my-ipsec-policy") + .pfs("disabled") .build(); + Map iPsecPolicyPatchModelAsPatch = iPsecPolicyPatchModel.asPatch(); - // Construct an instance of the CreateLoadBalancerPoolOptions model - CreateLoadBalancerPoolOptions createLoadBalancerPoolOptionsModel = new CreateLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .algorithm("least_connections") - .healthMonitor(loadBalancerPoolHealthMonitorPrototypeModel) - .protocol("http") - .failsafePolicy(loadBalancerPoolFailsafePolicyPrototypeModel) - .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) - .name("my-load-balancer-pool") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePrototypeModel) + // Construct an instance of the UpdateIpsecPolicyOptions model + UpdateIpsecPolicyOptions updateIpsecPolicyOptionsModel = new UpdateIpsecPolicyOptions.Builder() + .id("testString") + .iPsecPolicyPatch(iPsecPolicyPatchModelAsPatch) .build(); - // Invoke createLoadBalancerPool() with a valid options model and verify the result - Response response = vpcService.createLoadBalancerPool(createLoadBalancerPoolOptionsModel).execute(); + // Invoke updateIpsecPolicy() with a valid options model and verify the result + Response response = vpcService.updateIpsecPolicy(updateIpsecPolicyOptionsModel).execute(); assertNotNull(response); - LoadBalancerPool responseObj = response.getResult(); + IPsecPolicy responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createLoadBalancerPoolPath); + assertEquals(parsedPath, updateIpsecPolicyPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createLoadBalancerPool operation with and without retries enabled + // Test the updateIpsecPolicy operation with and without retries enabled @Test - public void testCreateLoadBalancerPoolWRetries() throws Throwable { + public void testUpdateIpsecPolicyWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateLoadBalancerPoolWOptions(); + testUpdateIpsecPolicyWOptions(); vpcService.disableRetries(); - testCreateLoadBalancerPoolWOptions(); + testUpdateIpsecPolicyWOptions(); } - // Test the createLoadBalancerPool operation with a null options model (negative test) + // Test the updateIpsecPolicy operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateLoadBalancerPoolNoOptions() throws Throwable { + public void testUpdateIpsecPolicyNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createLoadBalancerPool(null).execute(); + vpcService.updateIpsecPolicy(null).execute(); } - // Test the deleteLoadBalancerPool operation with a valid options model parameter + // Test the listIpsecPolicyConnections operation with a valid options model parameter @Test - public void testDeleteLoadBalancerPoolWOptions() throws Throwable { + public void testListIpsecPolicyConnectionsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String deleteLoadBalancerPoolPath = "/load_balancers/testString/pools/testString"; + String mockResponseBody = "{\"connections\": [{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listIpsecPolicyConnectionsPath = "/ipsec_policies/testString/connections"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the DeleteLoadBalancerPoolOptions model - DeleteLoadBalancerPoolOptions deleteLoadBalancerPoolOptionsModel = new DeleteLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") + // Construct an instance of the ListIpsecPolicyConnectionsOptions model + ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptionsModel = new ListIpsecPolicyConnectionsOptions.Builder() .id("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke deleteLoadBalancerPool() with a valid options model and verify the result - Response response = vpcService.deleteLoadBalancerPool(deleteLoadBalancerPoolOptionsModel).execute(); + // Invoke listIpsecPolicyConnections() with a valid options model and verify the result + Response response = vpcService.listIpsecPolicyConnections(listIpsecPolicyConnectionsOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + IPsecPolicyConnectionCollection responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteLoadBalancerPoolPath); + assertEquals(parsedPath, listIpsecPolicyConnectionsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the deleteLoadBalancerPool operation with and without retries enabled + // Test the listIpsecPolicyConnections operation with and without retries enabled @Test - public void testDeleteLoadBalancerPoolWRetries() throws Throwable { + public void testListIpsecPolicyConnectionsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteLoadBalancerPoolWOptions(); + testListIpsecPolicyConnectionsWOptions(); vpcService.disableRetries(); - testDeleteLoadBalancerPoolWOptions(); + testListIpsecPolicyConnectionsWOptions(); } - // Test the deleteLoadBalancerPool operation with a null options model (negative test) + // Test the listIpsecPolicyConnections operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteLoadBalancerPoolNoOptions() throws Throwable { + public void testListIpsecPolicyConnectionsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteLoadBalancerPool(null).execute(); + vpcService.listIpsecPolicyConnections(null).execute(); } - // Test the getLoadBalancerPool operation with a valid options model parameter + // Test the listIpsecPolicyConnections operation using the IpsecPolicyConnectionsPager.getNext() method @Test - public void testGetLoadBalancerPoolWOptions() throws Throwable { + public void testListIpsecPolicyConnectionsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions = new ListIpsecPolicyConnectionsOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); + + List allResults = new ArrayList<>(); + IpsecPolicyConnectionsPager pager = new IpsecPolicyConnectionsPager(vpcService, listIpsecPolicyConnectionsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listIpsecPolicyConnections operation using the IpsecPolicyConnectionsPager.getAll() method + @Test + public void testListIpsecPolicyConnectionsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListIpsecPolicyConnectionsOptions listIpsecPolicyConnectionsOptions = new ListIpsecPolicyConnectionsOptions.Builder() + .id("testString") + .limit(Long.valueOf("10")) + .build(); + + IpsecPolicyConnectionsPager pager = new IpsecPolicyConnectionsPager(vpcService, listIpsecPolicyConnectionsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the listVpnGateways operation with a valid options model parameter + @Test + public void testListVpnGatewaysWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"algorithm\": \"least_connections\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"failsafe_policy\": {\"action\": \"forward\", \"healthy_member_threshold_count\": 0, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}, \"health_monitor\": {\"delay\": 5, \"max_retries\": 2, \"port\": 22, \"timeout\": 2, \"type\": \"tcp\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"name\": \"my-load-balancer-pool\", \"protocol\": \"http\", \"provisioning_status\": \"active\", \"proxy_protocol\": \"disabled\", \"session_persistence\": {\"cookie_name\": \"my-cookie-name\", \"type\": \"app_cookie\"}}"; - String getLoadBalancerPoolPath = "/load_balancers/testString/pools/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"vpn_gateways\": [{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"members\": [{\"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"private_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"policy\"}]}"; + String listVpnGatewaysPath = "/vpn_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetLoadBalancerPoolOptions model - GetLoadBalancerPoolOptions getLoadBalancerPoolOptionsModel = new GetLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") - .id("testString") + // Construct an instance of the ListVpnGatewaysOptions model + ListVpnGatewaysOptions listVpnGatewaysOptionsModel = new ListVpnGatewaysOptions.Builder() + .start("testString") + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("policy") .build(); - // Invoke getLoadBalancerPool() with a valid options model and verify the result - Response response = vpcService.getLoadBalancerPool(getLoadBalancerPoolOptionsModel).execute(); + // Invoke listVpnGateways() with a valid options model and verify the result + Response response = vpcService.listVpnGateways(listVpnGatewaysOptionsModel).execute(); assertNotNull(response); - LoadBalancerPool responseObj = response.getResult(); + VPNGatewayCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -31223,146 +32702,242 @@ public void testGetLoadBalancerPoolWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getLoadBalancerPoolPath); + assertEquals(parsedPath, listVpnGatewaysPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); + assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("sort"), "name"); + assertEquals(query.get("mode"), "policy"); } - // Test the getLoadBalancerPool operation with and without retries enabled + // Test the listVpnGateways operation with and without retries enabled @Test - public void testGetLoadBalancerPoolWRetries() throws Throwable { + public void testListVpnGatewaysWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetLoadBalancerPoolWOptions(); + testListVpnGatewaysWOptions(); vpcService.disableRetries(); - testGetLoadBalancerPoolWOptions(); + testListVpnGatewaysWOptions(); } - // Test the getLoadBalancerPool operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetLoadBalancerPoolNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getLoadBalancerPool(null).execute(); + // Test the listVpnGateways operation using the VpnGatewaysPager.getNext() method + @Test + public void testListVpnGatewaysWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"members\":[{\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"private_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"policy\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"members\":[{\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"private_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"policy\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("policy") + .build(); + + List allResults = new ArrayList<>(); + VpnGatewaysPager pager = new VpnGatewaysPager(vpcService, listVpnGatewaysOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); } + + // Test the listVpnGateways operation using the VpnGatewaysPager.getAll() method + @Test + public void testListVpnGatewaysWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"members\":[{\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"private_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"policy\"}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"vpn_gateways\":[{\"connections\":[{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"name\":\"my-vpn-gateway-connection\",\"resource_type\":\"vpn_gateway_connection\"}],\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"id\":\"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"members\":[{\"health_reasons\":[{\"code\":\"cannot_reserve_ip_address\",\"message\":\"IP address exhaustion (release addresses on the VPN's subnet).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}],\"health_state\":\"ok\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"private_ip\":{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"},\"public_ip\":{\"address\":\"192.168.3.4\"},\"role\":\"active\"}],\"name\":\"my-vpn-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_gateway\",\"subnet\":{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"mode\":\"policy\"}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Test the updateLoadBalancerPool operation with a valid options model parameter + ListVpnGatewaysOptions listVpnGatewaysOptions = new ListVpnGatewaysOptions.Builder() + .limit(Long.valueOf("10")) + .resourceGroupId("testString") + .sort("name") + .mode("policy") + .build(); + + VpnGatewaysPager pager = new VpnGatewaysPager(vpcService, listVpnGatewaysOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the createVpnGateway operation with a valid options model parameter @Test - public void testUpdateLoadBalancerPoolWOptions() throws Throwable { + public void testCreateVpnGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"algorithm\": \"least_connections\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"failsafe_policy\": {\"action\": \"forward\", \"healthy_member_threshold_count\": 0, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"name\": \"my-load-balancer-pool\"}}, \"health_monitor\": {\"delay\": 5, \"max_retries\": 2, \"port\": 22, \"timeout\": 2, \"type\": \"tcp\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"id\": \"r006-70294e14-4e61-11e8-bcf4-0242ac110004\", \"instance_group\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instance_groups/r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"id\": \"r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60\", \"name\": \"my-instance-group\"}, \"members\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\"}], \"name\": \"my-load-balancer-pool\", \"protocol\": \"http\", \"provisioning_status\": \"active\", \"proxy_protocol\": \"disabled\", \"session_persistence\": {\"cookie_name\": \"my-cookie-name\", \"type\": \"app_cookie\"}}"; - String updateLoadBalancerPoolPath = "/load_balancers/testString/pools/testString"; + String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"members\": [{\"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"private_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"policy\"}"; + String createVpnGatewayPath = "/vpn_gateways"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById model - LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById loadBalancerPoolFailsafePolicyTargetPatchModel = new LoadBalancerPoolFailsafePolicyTargetPatchLoadBalancerPoolIdentityById.Builder() - .id("r006-70294e14-4e61-11e8-bcf4-0242ac110004") + // Construct an instance of the ResourceGroupIdentityById model + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() + .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the LoadBalancerPoolFailsafePolicyPatch model - LoadBalancerPoolFailsafePolicyPatch loadBalancerPoolFailsafePolicyPatchModel = new LoadBalancerPoolFailsafePolicyPatch.Builder() - .action("forward") - .target(loadBalancerPoolFailsafePolicyTargetPatchModel) + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") .build(); - // Construct an instance of the LoadBalancerPoolHealthMonitorPatch model - LoadBalancerPoolHealthMonitorPatch loadBalancerPoolHealthMonitorPatchModel = new LoadBalancerPoolHealthMonitorPatch.Builder() - .delay(Long.valueOf("5")) - .maxRetries(Long.valueOf("2")) - .port(Long.valueOf("22")) - .timeout(Long.valueOf("2")) - .type("http") - .urlPath("/") + // Construct an instance of the VPNGatewayPrototypeVPNGatewayRouteModePrototype model + VPNGatewayPrototypeVPNGatewayRouteModePrototype vpnGatewayPrototypeModel = new VPNGatewayPrototypeVPNGatewayRouteModePrototype.Builder() + .name("my-vpn-gateway") + .resourceGroup(resourceGroupIdentityModel) + .subnet(subnetIdentityModel) + .advertisedCidrs(java.util.Arrays.asList("192.168.3.0/24")) + .localAsn(Long.valueOf("64520")) + .mode("route") .build(); - // Construct an instance of the LoadBalancerPoolSessionPersistencePatch model - LoadBalancerPoolSessionPersistencePatch loadBalancerPoolSessionPersistencePatchModel = new LoadBalancerPoolSessionPersistencePatch.Builder() - .cookieName("my-cookie-name") - .type("app_cookie") + // Construct an instance of the CreateVpnGatewayOptions model + CreateVpnGatewayOptions createVpnGatewayOptionsModel = new CreateVpnGatewayOptions.Builder() + .vpnGatewayPrototype(vpnGatewayPrototypeModel) .build(); - // Construct an instance of the LoadBalancerPoolPatch model - LoadBalancerPoolPatch loadBalancerPoolPatchModel = new LoadBalancerPoolPatch.Builder() - .algorithm("weighted_round_robin") - .failsafePolicy(loadBalancerPoolFailsafePolicyPatchModel) - .healthMonitor(loadBalancerPoolHealthMonitorPatchModel) - .name("my-load-balancer-pool") - .protocol("http") - .proxyProtocol("disabled") - .sessionPersistence(loadBalancerPoolSessionPersistencePatchModel) - .build(); - Map loadBalancerPoolPatchModelAsPatch = loadBalancerPoolPatchModel.asPatch(); + // Invoke createVpnGateway() with a valid options model and verify the result + Response response = vpcService.createVpnGateway(createVpnGatewayOptionsModel).execute(); + assertNotNull(response); + VPNGateway responseObj = response.getResult(); + assertNotNull(responseObj); - // Construct an instance of the UpdateLoadBalancerPoolOptions model - UpdateLoadBalancerPoolOptions updateLoadBalancerPoolOptionsModel = new UpdateLoadBalancerPoolOptions.Builder() - .loadBalancerId("testString") + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createVpnGatewayPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the createVpnGateway operation with and without retries enabled + @Test + public void testCreateVpnGatewayWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testCreateVpnGatewayWOptions(); + + vpcService.disableRetries(); + testCreateVpnGatewayWOptions(); + } + + // Test the createVpnGateway operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateVpnGatewayNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.createVpnGateway(null).execute(); + } + + // Test the deleteVpnGateway operation with a valid options model parameter + @Test + public void testDeleteVpnGatewayWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = ""; + String deleteVpnGatewayPath = "/vpn_gateways/testString"; + server.enqueue(new MockResponse() + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the DeleteVpnGatewayOptions model + DeleteVpnGatewayOptions deleteVpnGatewayOptionsModel = new DeleteVpnGatewayOptions.Builder() .id("testString") - .loadBalancerPoolPatch(loadBalancerPoolPatchModelAsPatch) .build(); - // Invoke updateLoadBalancerPool() with a valid options model and verify the result - Response response = vpcService.updateLoadBalancerPool(updateLoadBalancerPoolOptionsModel).execute(); + // Invoke deleteVpnGateway() with a valid options model and verify the result + Response response = vpcService.deleteVpnGateway(deleteVpnGatewayOptionsModel).execute(); assertNotNull(response); - LoadBalancerPool responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateLoadBalancerPoolPath); + assertEquals(parsedPath, deleteVpnGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateLoadBalancerPool operation with and without retries enabled + // Test the deleteVpnGateway operation with and without retries enabled @Test - public void testUpdateLoadBalancerPoolWRetries() throws Throwable { + public void testDeleteVpnGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateLoadBalancerPoolWOptions(); + testDeleteVpnGatewayWOptions(); vpcService.disableRetries(); - testUpdateLoadBalancerPoolWOptions(); + testDeleteVpnGatewayWOptions(); } - // Test the updateLoadBalancerPool operation with a null options model (negative test) + // Test the deleteVpnGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateLoadBalancerPoolNoOptions() throws Throwable { + public void testDeleteVpnGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateLoadBalancerPool(null).execute(); + vpcService.deleteVpnGateway(null).execute(); } - // Test the listLoadBalancerPoolMembers operation with a valid options model parameter + // Test the getVpnGateway operation with a valid options model parameter @Test - public void testListLoadBalancerPoolMembersWOptions() throws Throwable { + public void testGetVpnGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"members\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}]}"; - String listLoadBalancerPoolMembersPath = "/load_balancers/testString/pools/testString/members"; + String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"members\": [{\"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"private_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"policy\"}"; + String getVpnGatewayPath = "/vpn_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListLoadBalancerPoolMembersOptions model - ListLoadBalancerPoolMembersOptions listLoadBalancerPoolMembersOptionsModel = new ListLoadBalancerPoolMembersOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") + // Construct an instance of the GetVpnGatewayOptions model + GetVpnGatewayOptions getVpnGatewayOptionsModel = new GetVpnGatewayOptions.Builder() + .id("testString") .build(); - // Invoke listLoadBalancerPoolMembers() with a valid options model and verify the result - Response response = vpcService.listLoadBalancerPoolMembers(listLoadBalancerPoolMembersOptionsModel).execute(); + // Invoke getVpnGateway() with a valid options model and verify the result + Response response = vpcService.getVpnGateway(getVpnGatewayOptionsModel).execute(); assertNotNull(response); - LoadBalancerPoolMemberCollection responseObj = response.getResult(); + VPNGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -31371,179 +32946,163 @@ public void testListLoadBalancerPoolMembersWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listLoadBalancerPoolMembersPath); + assertEquals(parsedPath, getVpnGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the listLoadBalancerPoolMembers operation with and without retries enabled + // Test the getVpnGateway operation with and without retries enabled @Test - public void testListLoadBalancerPoolMembersWRetries() throws Throwable { + public void testGetVpnGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListLoadBalancerPoolMembersWOptions(); + testGetVpnGatewayWOptions(); vpcService.disableRetries(); - testListLoadBalancerPoolMembersWOptions(); + testGetVpnGatewayWOptions(); } - // Test the listLoadBalancerPoolMembers operation with a null options model (negative test) + // Test the getVpnGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListLoadBalancerPoolMembersNoOptions() throws Throwable { + public void testGetVpnGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listLoadBalancerPoolMembers(null).execute(); + vpcService.getVpnGateway(null).execute(); } - // Test the createLoadBalancerPoolMember operation with a valid options model parameter + // Test the updateVpnGateway operation with a valid options model parameter @Test - public void testCreateLoadBalancerPoolMemberWOptions() throws Throwable { + public void testUpdateVpnGatewayWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}"; - String createLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members"; + String mockResponseBody = "{\"connections\": [{\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"name\": \"my-vpn-gateway-connection\", \"resource_type\": \"vpn_gateway_connection\"}], \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn:0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"id\": \"0717-ddf51bec-3424-11e8-b467-0ed5f89f718b\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"members\": [{\"health_reasons\": [{\"code\": \"cannot_reserve_ip_address\", \"message\": \"IP address exhaustion (release addresses on the VPN's subnet).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}], \"health_state\": \"ok\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"private_ip\": {\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}, \"public_ip\": {\"address\": \"192.168.3.4\"}, \"role\": \"active\"}], \"name\": \"my-vpn-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_gateway\", \"subnet\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"mode\": \"policy\"}"; + String updateVpnGatewayPath = "/vpn_gateways/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") + // Construct an instance of the VPNGatewayPatch model + VPNGatewayPatch vpnGatewayPatchModel = new VPNGatewayPatch.Builder() + .localAsn(Long.valueOf("64520")) + .name("my-vpn-gateway-updated") .build(); + Map vpnGatewayPatchModelAsPatch = vpnGatewayPatchModel.asPatch(); - // Construct an instance of the CreateLoadBalancerPoolMemberOptions model - CreateLoadBalancerPoolMemberOptions createLoadBalancerPoolMemberOptionsModel = new CreateLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) + // Construct an instance of the UpdateVpnGatewayOptions model + UpdateVpnGatewayOptions updateVpnGatewayOptionsModel = new UpdateVpnGatewayOptions.Builder() + .id("testString") + .vpnGatewayPatch(vpnGatewayPatchModelAsPatch) .build(); - // Invoke createLoadBalancerPoolMember() with a valid options model and verify the result - Response response = vpcService.createLoadBalancerPoolMember(createLoadBalancerPoolMemberOptionsModel).execute(); + // Invoke updateVpnGateway() with a valid options model and verify the result + Response response = vpcService.updateVpnGateway(updateVpnGatewayOptionsModel).execute(); assertNotNull(response); - LoadBalancerPoolMember responseObj = response.getResult(); + VPNGateway responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createLoadBalancerPoolMemberPath); + assertEquals(parsedPath, updateVpnGatewayPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createLoadBalancerPoolMember operation with and without retries enabled + // Test the updateVpnGateway operation with and without retries enabled @Test - public void testCreateLoadBalancerPoolMemberWRetries() throws Throwable { + public void testUpdateVpnGatewayWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateLoadBalancerPoolMemberWOptions(); + testUpdateVpnGatewayWOptions(); vpcService.disableRetries(); - testCreateLoadBalancerPoolMemberWOptions(); + testUpdateVpnGatewayWOptions(); } - // Test the createLoadBalancerPoolMember operation with a null options model (negative test) + // Test the updateVpnGateway operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateLoadBalancerPoolMemberNoOptions() throws Throwable { + public void testUpdateVpnGatewayNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createLoadBalancerPoolMember(null).execute(); + vpcService.updateVpnGateway(null).execute(); } - // Test the replaceLoadBalancerPoolMembers operation with a valid options model parameter + // Test the listVpnGatewayAdvertisedCidrs operation with a valid options model parameter @Test - public void testReplaceLoadBalancerPoolMembersWOptions() throws Throwable { + public void testListVpnGatewayAdvertisedCidrsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"members\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}]}"; - String replaceLoadBalancerPoolMembersPath = "/load_balancers/testString/pools/testString/members"; + String mockResponseBody = "{\"advertised_cidrs\": [\"192.168.3.0/24\"]}"; + String listVpnGatewayAdvertisedCidrsPath = "/vpn_gateways/testString/advertised_cidrs"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") - .build(); - - // Construct an instance of the LoadBalancerPoolMemberPrototype model - LoadBalancerPoolMemberPrototype loadBalancerPoolMemberPrototypeModel = new LoadBalancerPoolMemberPrototype.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("50")) - .build(); - - // Construct an instance of the ReplaceLoadBalancerPoolMembersOptions model - ReplaceLoadBalancerPoolMembersOptions replaceLoadBalancerPoolMembersOptionsModel = new ReplaceLoadBalancerPoolMembersOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .members(java.util.Arrays.asList(loadBalancerPoolMemberPrototypeModel)) + // Construct an instance of the ListVpnGatewayAdvertisedCidrsOptions model + ListVpnGatewayAdvertisedCidrsOptions listVpnGatewayAdvertisedCidrsOptionsModel = new ListVpnGatewayAdvertisedCidrsOptions.Builder() + .vpnGatewayId("testString") .build(); - // Invoke replaceLoadBalancerPoolMembers() with a valid options model and verify the result - Response response = vpcService.replaceLoadBalancerPoolMembers(replaceLoadBalancerPoolMembersOptionsModel).execute(); + // Invoke listVpnGatewayAdvertisedCidrs() with a valid options model and verify the result + Response response = vpcService.listVpnGatewayAdvertisedCidrs(listVpnGatewayAdvertisedCidrsOptionsModel).execute(); assertNotNull(response); - LoadBalancerPoolMemberCollection responseObj = response.getResult(); + VPNGatewayAdvertisedCIDRCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, replaceLoadBalancerPoolMembersPath); + assertEquals(parsedPath, listVpnGatewayAdvertisedCidrsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the replaceLoadBalancerPoolMembers operation with and without retries enabled + // Test the listVpnGatewayAdvertisedCidrs operation with and without retries enabled @Test - public void testReplaceLoadBalancerPoolMembersWRetries() throws Throwable { + public void testListVpnGatewayAdvertisedCidrsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testReplaceLoadBalancerPoolMembersWOptions(); + testListVpnGatewayAdvertisedCidrsWOptions(); vpcService.disableRetries(); - testReplaceLoadBalancerPoolMembersWOptions(); + testListVpnGatewayAdvertisedCidrsWOptions(); } - // Test the replaceLoadBalancerPoolMembers operation with a null options model (negative test) + // Test the listVpnGatewayAdvertisedCidrs operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testReplaceLoadBalancerPoolMembersNoOptions() throws Throwable { + public void testListVpnGatewayAdvertisedCidrsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.replaceLoadBalancerPoolMembers(null).execute(); + vpcService.listVpnGatewayAdvertisedCidrs(null).execute(); } - // Test the deleteLoadBalancerPoolMember operation with a valid options model parameter + // Test the removeVpnGatewayAdvertisedCidr operation with a valid options model parameter @Test - public void testDeleteLoadBalancerPoolMemberWOptions() throws Throwable { + public void testRemoveVpnGatewayAdvertisedCidrWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members/testString"; + String removeVpnGatewayAdvertisedCidrPath = "/vpn_gateways/testString/advertised_cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() - .setResponseCode(202) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteLoadBalancerPoolMemberOptions model - DeleteLoadBalancerPoolMemberOptions deleteLoadBalancerPoolMemberOptionsModel = new DeleteLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .id("testString") + // Construct an instance of the RemoveVpnGatewayAdvertisedCidrOptions model + RemoveVpnGatewayAdvertisedCidrOptions removeVpnGatewayAdvertisedCidrOptionsModel = new RemoveVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke deleteLoadBalancerPoolMember() with a valid options model and verify the result - Response response = vpcService.deleteLoadBalancerPoolMember(deleteLoadBalancerPoolMemberOptionsModel).execute(); + // Invoke removeVpnGatewayAdvertisedCidr() with a valid options model and verify the result + Response response = vpcService.removeVpnGatewayAdvertisedCidr(removeVpnGatewayAdvertisedCidrOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -31554,54 +33113,52 @@ public void testDeleteLoadBalancerPoolMemberWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteLoadBalancerPoolMemberPath); + assertEquals(parsedPath, removeVpnGatewayAdvertisedCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteLoadBalancerPoolMember operation with and without retries enabled + // Test the removeVpnGatewayAdvertisedCidr operation with and without retries enabled @Test - public void testDeleteLoadBalancerPoolMemberWRetries() throws Throwable { + public void testRemoveVpnGatewayAdvertisedCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteLoadBalancerPoolMemberWOptions(); + testRemoveVpnGatewayAdvertisedCidrWOptions(); vpcService.disableRetries(); - testDeleteLoadBalancerPoolMemberWOptions(); + testRemoveVpnGatewayAdvertisedCidrWOptions(); } - // Test the deleteLoadBalancerPoolMember operation with a null options model (negative test) + // Test the removeVpnGatewayAdvertisedCidr operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteLoadBalancerPoolMemberNoOptions() throws Throwable { + public void testRemoveVpnGatewayAdvertisedCidrNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteLoadBalancerPoolMember(null).execute(); + vpcService.removeVpnGatewayAdvertisedCidr(null).execute(); } - // Test the getLoadBalancerPoolMember operation with a valid options model parameter + // Test the checkVpnGatewayAdvertisedCidr operation with a valid options model parameter @Test - public void testGetLoadBalancerPoolMemberWOptions() throws Throwable { + public void testCheckVpnGatewayAdvertisedCidrWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}"; - String getLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members/testString"; + String mockResponseBody = ""; + String checkVpnGatewayAdvertisedCidrPath = "/vpn_gateways/testString/advertised_cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the GetLoadBalancerPoolMemberOptions model - GetLoadBalancerPoolMemberOptions getLoadBalancerPoolMemberOptionsModel = new GetLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .id("testString") + // Construct an instance of the CheckVpnGatewayAdvertisedCidrOptions model + CheckVpnGatewayAdvertisedCidrOptions checkVpnGatewayAdvertisedCidrOptionsModel = new CheckVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke getLoadBalancerPoolMember() with a valid options model and verify the result - Response response = vpcService.getLoadBalancerPoolMember(getLoadBalancerPoolMemberOptionsModel).execute(); + // Invoke checkVpnGatewayAdvertisedCidr() with a valid options model and verify the result + Response response = vpcService.checkVpnGatewayAdvertisedCidr(checkVpnGatewayAdvertisedCidrOptionsModel).execute(); assertNotNull(response); - LoadBalancerPoolMember responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -31609,128 +33166,107 @@ public void testGetLoadBalancerPoolMemberWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getLoadBalancerPoolMemberPath); + assertEquals(parsedPath, checkVpnGatewayAdvertisedCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getLoadBalancerPoolMember operation with and without retries enabled + // Test the checkVpnGatewayAdvertisedCidr operation with and without retries enabled @Test - public void testGetLoadBalancerPoolMemberWRetries() throws Throwable { + public void testCheckVpnGatewayAdvertisedCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetLoadBalancerPoolMemberWOptions(); + testCheckVpnGatewayAdvertisedCidrWOptions(); vpcService.disableRetries(); - testGetLoadBalancerPoolMemberWOptions(); + testCheckVpnGatewayAdvertisedCidrWOptions(); } - // Test the getLoadBalancerPoolMember operation with a null options model (negative test) + // Test the checkVpnGatewayAdvertisedCidr operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetLoadBalancerPoolMemberNoOptions() throws Throwable { + public void testCheckVpnGatewayAdvertisedCidrNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getLoadBalancerPoolMember(null).execute(); + vpcService.checkVpnGatewayAdvertisedCidr(null).execute(); } - // Test the updateLoadBalancerPoolMember operation with a valid options model parameter + // Test the addVpnGatewayAdvertisedCidr operation with a valid options model parameter @Test - public void testUpdateLoadBalancerPoolMemberWOptions() throws Throwable { + public void testAddVpnGatewayAdvertisedCidrWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"health\": \"faulted\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/r006-70294e14-4e61-11e8-bcf4-0242ac110004/members/r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"id\": \"r006-4a4b345f-cf6b-4326-8202-6d8229e9833a\", \"port\": 80, \"provisioning_status\": \"active\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::instance:0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"id\": \"0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0\", \"name\": \"my-instance\"}, \"weight\": 50}"; - String updateLoadBalancerPoolMemberPath = "/load_balancers/testString/pools/testString/members/testString"; + String mockResponseBody = ""; + String addVpnGatewayAdvertisedCidrPath = "/vpn_gateways/testString/advertised_cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model - LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById loadBalancerPoolMemberTargetPrototypeModel = new LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById.Builder() - .id("0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0") - .build(); - - // Construct an instance of the LoadBalancerPoolMemberPatch model - LoadBalancerPoolMemberPatch loadBalancerPoolMemberPatchModel = new LoadBalancerPoolMemberPatch.Builder() - .port(Long.valueOf("80")) - .target(loadBalancerPoolMemberTargetPrototypeModel) - .weight(Long.valueOf("99")) - .build(); - Map loadBalancerPoolMemberPatchModelAsPatch = loadBalancerPoolMemberPatchModel.asPatch(); - - // Construct an instance of the UpdateLoadBalancerPoolMemberOptions model - UpdateLoadBalancerPoolMemberOptions updateLoadBalancerPoolMemberOptionsModel = new UpdateLoadBalancerPoolMemberOptions.Builder() - .loadBalancerId("testString") - .poolId("testString") - .id("testString") - .loadBalancerPoolMemberPatch(loadBalancerPoolMemberPatchModelAsPatch) + // Construct an instance of the AddVpnGatewayAdvertisedCidrOptions model + AddVpnGatewayAdvertisedCidrOptions addVpnGatewayAdvertisedCidrOptionsModel = new AddVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke updateLoadBalancerPoolMember() with a valid options model and verify the result - Response response = vpcService.updateLoadBalancerPoolMember(updateLoadBalancerPoolMemberOptionsModel).execute(); + // Invoke addVpnGatewayAdvertisedCidr() with a valid options model and verify the result + Response response = vpcService.addVpnGatewayAdvertisedCidr(addVpnGatewayAdvertisedCidrOptionsModel).execute(); assertNotNull(response); - LoadBalancerPoolMember responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateLoadBalancerPoolMemberPath); + assertEquals(parsedPath, addVpnGatewayAdvertisedCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateLoadBalancerPoolMember operation with and without retries enabled + // Test the addVpnGatewayAdvertisedCidr operation with and without retries enabled @Test - public void testUpdateLoadBalancerPoolMemberWRetries() throws Throwable { + public void testAddVpnGatewayAdvertisedCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateLoadBalancerPoolMemberWOptions(); + testAddVpnGatewayAdvertisedCidrWOptions(); vpcService.disableRetries(); - testUpdateLoadBalancerPoolMemberWOptions(); + testAddVpnGatewayAdvertisedCidrWOptions(); } - // Test the updateLoadBalancerPoolMember operation with a null options model (negative test) + // Test the addVpnGatewayAdvertisedCidr operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateLoadBalancerPoolMemberNoOptions() throws Throwable { + public void testAddVpnGatewayAdvertisedCidrNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateLoadBalancerPoolMember(null).execute(); + vpcService.addVpnGatewayAdvertisedCidr(null).execute(); } - // Test the listEndpointGateways operation with a valid options model parameter + // Test the listVpnGatewayConnections operation with a valid options model parameter @Test - public void testListEndpointGatewaysWOptions() throws Throwable { + public void testListVpnGatewayConnectionsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"endpoint_gateways\": [{\"allow_dns_resolution_binding\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_reasons\": [{\"code\": \"dns_resolution_binding_pending\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-endpoint-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"endpoint_gateway\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"service_endpoint\": \"my-cloudant-instance.appdomain.cloud\", \"service_endpoints\": [\"my-cloudant-instance.appdomain.cloud\"], \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"name\": \"my-private-path-service-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"private_path_service_gateway\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listEndpointGatewaysPath = "/endpoint_gateways"; + String mockResponseBody = "{\"connections\": [{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listVpnGatewayConnectionsPath = "/vpn_gateways/testString/connections"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListEndpointGatewaysOptions model - ListEndpointGatewaysOptions listEndpointGatewaysOptionsModel = new ListEndpointGatewaysOptions.Builder() - .name("my-name") + // Construct an instance of the ListVpnGatewayConnectionsOptions model + ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptionsModel = new ListVpnGatewayConnectionsOptions.Builder() + .vpnGatewayId("testString") .start("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .lifecycleState(java.util.Arrays.asList("stable")) - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .allowDnsResolutionBinding(true) + .status("down") .build(); - // Invoke listEndpointGateways() with a valid options model and verify the result - Response response = vpcService.listEndpointGateways(listEndpointGatewaysOptionsModel).execute(); + // Invoke listVpnGatewayConnections() with a valid options model and verify the result + Response response = vpcService.listVpnGatewayConnections(listVpnGatewayConnectionsOptionsModel).execute(); assertNotNull(response); - EndpointGatewayCollection responseObj = response.getResult(); + VPNGatewayConnectionCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -31739,39 +33275,40 @@ public void testListEndpointGatewaysWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listEndpointGatewaysPath); + assertEquals(parsedPath, listVpnGatewayConnectionsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("name"), "my-name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("lifecycle_state"), RequestUtils.join(java.util.Arrays.asList("stable"), ",")); - assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); - assertEquals(query.get("vpc.name"), "my-vpc"); - assertEquals(Boolean.valueOf(query.get("allow_dns_resolution_binding")), Boolean.valueOf(true)); + assertEquals(query.get("status"), "down"); } - // Test the listEndpointGateways operation with and without retries enabled + // Test the listVpnGatewayConnections operation with and without retries enabled @Test - public void testListEndpointGatewaysWRetries() throws Throwable { + public void testListVpnGatewayConnectionsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListEndpointGatewaysWOptions(); + testListVpnGatewayConnectionsWOptions(); vpcService.disableRetries(); - testListEndpointGatewaysWOptions(); + testListVpnGatewayConnectionsWOptions(); } - // Test the listEndpointGateways operation using the EndpointGatewaysPager.getNext() method + // Test the listVpnGatewayConnections operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListVpnGatewayConnectionsNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.listVpnGatewayConnections(null).execute(); + } + + // Test the listVpnGatewayConnections operation using the VpnGatewayConnectionsPager.getNext() method @Test - public void testListEndpointGatewaysWithPagerGetNext() throws Throwable { + public void testListVpnGatewayConnectionsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"endpoint_gateways\":[{\"allow_dns_resolution_binding\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_reasons\":[{\"code\":\"dns_resolution_binding_pending\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"name\":\"my-private-path-service-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"private_path_service_gateway\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"endpoint_gateways\":[{\"allow_dns_resolution_binding\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_reasons\":[{\"code\":\"dns_resolution_binding_pending\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"name\":\"my-private-path-service-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"private_path_service_gateway\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -31785,33 +33322,28 @@ public void testListEndpointGatewaysWithPagerGetNext() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() - .name("my-name") + ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions = new ListVpnGatewayConnectionsOptions.Builder() + .vpnGatewayId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .lifecycleState(java.util.Arrays.asList("stable")) - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .allowDnsResolutionBinding(true) + .status("down") .build(); - List allResults = new ArrayList<>(); - EndpointGatewaysPager pager = new EndpointGatewaysPager(vpcService, listEndpointGatewaysOptions); + List allResults = new ArrayList<>(); + VpnGatewayConnectionsPager pager = new VpnGatewayConnectionsPager(vpcService, listVpnGatewayConnectionsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listEndpointGateways operation using the EndpointGatewaysPager.getAll() method + // Test the listVpnGatewayConnections operation using the VpnGatewayConnectionsPager.getAll() method @Test - public void testListEndpointGatewaysWithPagerGetAll() throws Throwable { + public void testListVpnGatewayConnectionsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"endpoint_gateways\":[{\"allow_dns_resolution_binding\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_reasons\":[{\"code\":\"dns_resolution_binding_pending\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"name\":\"my-private-path-service-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"private_path_service_gateway\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"endpoint_gateways\":[{\"allow_dns_resolution_binding\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"lifecycle_reasons\":[{\"code\":\"dns_resolution_binding_pending\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-endpoint-gateway\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"endpoint_gateway\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"service_endpoint\":\"my-cloudant-instance.appdomain.cloud\",\"service_endpoints\":[\"my-cloudant-instance.appdomain.cloud\"],\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"name\":\"my-private-path-service-gateway\",\"remote\":{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"region\":{\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\",\"name\":\"us-south\"}},\"resource_type\":\"private_path_service_gateway\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"connections\":[{\"admin_state_up\":true,\"authentication_mode\":\"psk\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"dead_peer_detection\":{\"action\":\"restart\",\"interval\":30,\"timeout\":120},\"establish_mode\":\"bidirectional\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"id\":\"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\",\"ike_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"id\":\"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\",\"name\":\"my-ike-policy\",\"resource_type\":\"ike_policy\"},\"ipsec_policy\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"id\":\"r006-51eae621-dbbc-4c47-b623-b57a43c19876\",\"name\":\"my-ipsec-policy\",\"resource_type\":\"ipsec_policy\"},\"mode\":\"policy\",\"name\":\"my-vpn-gateway-connection\",\"psk\":\"lkj14b1oi0alcniejkso\",\"resource_type\":\"vpn_gateway_connection\",\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}],\"distribute_traffic\":false,\"local\":{\"ike_identities\":[{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"}]},\"peer\":{\"ike_identity\":{\"type\":\"fqdn\",\"value\":\"my-service.example.com\"},\"type\":\"address\",\"address\":\"192.0.2.5\"},\"routing_protocol\":\"none\",\"tunnels\":[{\"public_ip\":{\"address\":\"192.168.3.4\"},\"status\":\"down\",\"status_reasons\":[{\"code\":\"cannot_authenticate_connection\",\"message\":\"Failed to authenticate a connection because of mismatched IKE ID and PSK.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -31825,75 +33357,88 @@ public void testListEndpointGatewaysWithPagerGetAll() throws Throwable { .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListEndpointGatewaysOptions listEndpointGatewaysOptions = new ListEndpointGatewaysOptions.Builder() - .name("my-name") + ListVpnGatewayConnectionsOptions listVpnGatewayConnectionsOptions = new ListVpnGatewayConnectionsOptions.Builder() + .vpnGatewayId("testString") .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .lifecycleState(java.util.Arrays.asList("stable")) - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .allowDnsResolutionBinding(true) + .status("down") .build(); - EndpointGatewaysPager pager = new EndpointGatewaysPager(vpcService, listEndpointGatewaysOptions); - List allResults = pager.getAll(); + VpnGatewayConnectionsPager pager = new VpnGatewayConnectionsPager(vpcService, listVpnGatewayConnectionsOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createEndpointGateway operation with a valid options model parameter + // Test the createVpnGatewayConnection operation with a valid options model parameter @Test - public void testCreateEndpointGatewayWOptions() throws Throwable { + public void testCreateVpnGatewayConnectionWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_dns_resolution_binding\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_reasons\": [{\"code\": \"dns_resolution_binding_pending\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-endpoint-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"endpoint_gateway\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"service_endpoint\": \"my-cloudant-instance.appdomain.cloud\", \"service_endpoints\": [\"my-cloudant-instance.appdomain.cloud\"], \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"name\": \"my-private-path-service-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"private_path_service_gateway\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String createEndpointGatewayPath = "/endpoint_gateways"; + String mockResponseBody = "{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}"; + String createVpnGatewayConnectionPath = "/vpn_gateways/testString/connections"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype model - EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype endpointGatewayTargetPrototypeModel = new EndpointGatewayTargetPrototypeEndpointGatewayTargetResourceTypeProviderInfrastructureServicePrototype.Builder() - .name("ibm-ntp-server") - .resourceType("provider_infrastructure_service") + // Construct an instance of the VPNGatewayConnectionDPDPrototype model + VPNGatewayConnectionDPDPrototype vpnGatewayConnectionDpdPrototypeModel = new VPNGatewayConnectionDPDPrototype.Builder() + .action("restart") + .interval(Long.valueOf("30")) + .timeout(Long.valueOf("120")) .build(); - // Construct an instance of the VPCIdentityById model - VPCIdentityById vpcIdentityModel = new VPCIdentityById.Builder() - .id("r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") + // Construct an instance of the VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model + VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPrototypeModel = new VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.Builder() + .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") .build(); - // Construct an instance of the EndpointGatewayReservedIPReservedIPIdentityById model - EndpointGatewayReservedIPReservedIPIdentityById endpointGatewayReservedIpModel = new EndpointGatewayReservedIPReservedIPIdentityById.Builder() - .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + // Construct an instance of the VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model + VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPrototypeModel = new VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.Builder() + .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") .build(); - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") + // Construct an instance of the VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN model + VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN vpnGatewayConnectionIkeIdentityPrototypeModel = new VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN.Builder() + .type("fqdn") + .value("my-service.example.com") .build(); - // Construct an instance of the SecurityGroupIdentityById model - SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() - .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + // Construct an instance of the VPNGatewayConnectionStaticRouteModeLocalPrototype model + VPNGatewayConnectionStaticRouteModeLocalPrototype vpnGatewayConnectionStaticRouteModeLocalPrototypeModel = new VPNGatewayConnectionStaticRouteModeLocalPrototype.Builder() + .ikeIdentities(java.util.Arrays.asList(vpnGatewayConnectionIkeIdentityPrototypeModel)) .build(); - // Construct an instance of the CreateEndpointGatewayOptions model - CreateEndpointGatewayOptions createEndpointGatewayOptionsModel = new CreateEndpointGatewayOptions.Builder() - .target(endpointGatewayTargetPrototypeModel) - .vpc(vpcIdentityModel) - .allowDnsResolutionBinding(true) - .ips(java.util.Arrays.asList(endpointGatewayReservedIpModel)) - .name("testString") - .resourceGroup(resourceGroupIdentityModel) - .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) + // Construct an instance of the VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model + VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress vpnGatewayConnectionStaticRouteModePeerPrototypeModel = new VPNGatewayConnectionStaticRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.Builder() + .ikeIdentity(vpnGatewayConnectionIkeIdentityPrototypeModel) + .address("192.0.2.5") .build(); - // Invoke createEndpointGateway() with a valid options model and verify the result - Response response = vpcService.createEndpointGateway(createEndpointGatewayOptionsModel).execute(); + // Construct an instance of the VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model + VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype vpnGatewayConnectionPrototypeModel = new VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype.Builder() + .adminStateUp(true) + .deadPeerDetection(vpnGatewayConnectionDpdPrototypeModel) + .establishMode("bidirectional") + .ikePolicy(vpnGatewayConnectionIkePolicyPrototypeModel) + .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPrototypeModel) + .name("my-vpn-gateway-connection") + .psk("lkj14b1oi0alcniejkso") + .distributeTraffic(false) + .local(vpnGatewayConnectionStaticRouteModeLocalPrototypeModel) + .peer(vpnGatewayConnectionStaticRouteModePeerPrototypeModel) + .routingProtocol("none") + .build(); + + // Construct an instance of the CreateVpnGatewayConnectionOptions model + CreateVpnGatewayConnectionOptions createVpnGatewayConnectionOptionsModel = new CreateVpnGatewayConnectionOptions.Builder() + .vpnGatewayId("testString") + .vpnGatewayConnectionPrototype(vpnGatewayConnectionPrototypeModel) + .build(); + + // Invoke createVpnGatewayConnection() with a valid options model and verify the result + Response response = vpcService.createVpnGatewayConnection(createVpnGatewayConnectionOptionsModel).execute(); assertNotNull(response); - EndpointGateway responseObj = response.getResult(); + VPNGatewayConnection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -31902,230 +33447,265 @@ public void testCreateEndpointGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createEndpointGatewayPath); + assertEquals(parsedPath, createVpnGatewayConnectionPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createEndpointGateway operation with and without retries enabled + // Test the createVpnGatewayConnection operation with and without retries enabled @Test - public void testCreateEndpointGatewayWRetries() throws Throwable { + public void testCreateVpnGatewayConnectionWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateEndpointGatewayWOptions(); + testCreateVpnGatewayConnectionWOptions(); vpcService.disableRetries(); - testCreateEndpointGatewayWOptions(); + testCreateVpnGatewayConnectionWOptions(); } - // Test the createEndpointGateway operation with a null options model (negative test) + // Test the createVpnGatewayConnection operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateEndpointGatewayNoOptions() throws Throwable { + public void testCreateVpnGatewayConnectionNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createEndpointGateway(null).execute(); + vpcService.createVpnGatewayConnection(null).execute(); } - // Test the listEndpointGatewayIps operation with a valid options model parameter + // Test the deleteVpnGatewayConnection operation with a valid options model parameter @Test - public void testListEndpointGatewayIpsWOptions() throws Throwable { + public void testDeleteVpnGatewayConnectionWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"ips\": [{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listEndpointGatewayIpsPath = "/endpoint_gateways/testString/ips"; + String mockResponseBody = ""; + String deleteVpnGatewayConnectionPath = "/vpn_gateways/testString/connections/testString"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the ListEndpointGatewayIpsOptions model - ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptionsModel = new ListEndpointGatewayIpsOptions.Builder() - .endpointGatewayId("testString") - .start("testString") - .limit(Long.valueOf("10")) - .sort("name") + // Construct an instance of the DeleteVpnGatewayConnectionOptions model + DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptionsModel = new DeleteVpnGatewayConnectionOptions.Builder() + .vpnGatewayId("testString") + .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke listEndpointGatewayIps() with a valid options model and verify the result - Response response = vpcService.listEndpointGatewayIps(listEndpointGatewayIpsOptionsModel).execute(); + // Invoke deleteVpnGatewayConnection() with a valid options model and verify the result + Response response = vpcService.deleteVpnGatewayConnection(deleteVpnGatewayConnectionOptionsModel).execute(); assertNotNull(response); - ReservedIPCollectionEndpointGatewayContext responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listEndpointGatewayIpsPath); + assertEquals(parsedPath, deleteVpnGatewayConnectionPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("sort"), "name"); } - // Test the listEndpointGatewayIps operation with and without retries enabled + // Test the deleteVpnGatewayConnection operation with and without retries enabled @Test - public void testListEndpointGatewayIpsWRetries() throws Throwable { + public void testDeleteVpnGatewayConnectionWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListEndpointGatewayIpsWOptions(); + testDeleteVpnGatewayConnectionWOptions(); vpcService.disableRetries(); - testListEndpointGatewayIpsWOptions(); + testDeleteVpnGatewayConnectionWOptions(); } - // Test the listEndpointGatewayIps operation with a null options model (negative test) + // Test the deleteVpnGatewayConnection operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListEndpointGatewayIpsNoOptions() throws Throwable { + public void testDeleteVpnGatewayConnectionNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listEndpointGatewayIps(null).execute(); + vpcService.deleteVpnGatewayConnection(null).execute(); } - // Test the listEndpointGatewayIps operation using the EndpointGatewayIpsPager.getNext() method + // Test the getVpnGatewayConnection operation with a valid options model parameter @Test - public void testListEndpointGatewayIpsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); + public void testGetVpnGatewayConnectionWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}"; + String getVpnGatewayConnectionPath = "/vpn_gateways/testString/connections/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + .setBody(mockResponseBody)); - ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() - .endpointGatewayId("testString") - .limit(Long.valueOf("10")) - .sort("name") + // Construct an instance of the GetVpnGatewayConnectionOptions model + GetVpnGatewayConnectionOptions getVpnGatewayConnectionOptionsModel = new GetVpnGatewayConnectionOptions.Builder() + .vpnGatewayId("testString") + .id("testString") .build(); - List allResults = new ArrayList<>(); - EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(vpcService, listEndpointGatewayIpsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Invoke getVpnGatewayConnection() with a valid options model and verify the result + Response response = vpcService.getVpnGatewayConnection(getVpnGatewayConnectionOptionsModel).execute(); + assertNotNull(response); + VPNGatewayConnection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getVpnGatewayConnectionPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - - // Test the listEndpointGatewayIps operation using the EndpointGatewayIpsPager.getAll() method + + // Test the getVpnGatewayConnection operation with and without retries enabled @Test - public void testListEndpointGatewayIpsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"ips\":[{\"address\":\"192.168.3.4\",\"auto_delete\":false,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"lifecycle_state\":\"stable\",\"name\":\"my-reserved-ip\",\"owner\":\"provider\",\"resource_type\":\"subnet_reserved_ip\",\"target\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"id\":\"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\",\"name\":\"my-endpoint-gateway\",\"resource_type\":\"endpoint_gateway\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); + public void testGetVpnGatewayConnectionWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetVpnGatewayConnectionWOptions(); - ListEndpointGatewayIpsOptions listEndpointGatewayIpsOptions = new ListEndpointGatewayIpsOptions.Builder() - .endpointGatewayId("testString") - .limit(Long.valueOf("10")) - .sort("name") - .build(); + vpcService.disableRetries(); + testGetVpnGatewayConnectionWOptions(); + } - EndpointGatewayIpsPager pager = new EndpointGatewayIpsPager(vpcService, listEndpointGatewayIpsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); + // Test the getVpnGatewayConnection operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetVpnGatewayConnectionNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getVpnGatewayConnection(null).execute(); } - - // Test the removeEndpointGatewayIp operation with a valid options model parameter + + // Test the updateVpnGatewayConnection operation with a valid options model parameter @Test - public void testRemoveEndpointGatewayIpWOptions() throws Throwable { + public void testUpdateVpnGatewayConnectionWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String removeEndpointGatewayIpPath = "/endpoint_gateways/testString/ips/testString"; + String mockResponseBody = "{\"admin_state_up\": true, \"authentication_mode\": \"psk\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"dead_peer_detection\": {\"action\": \"restart\", \"interval\": 30, \"timeout\": 120}, \"establish_mode\": \"bidirectional\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/0717-ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"id\": \"0717-52f69dc3-6a5c-4bcf-b264-e7fae279b15c\", \"ike_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ike_policies/r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"id\": \"r006-e98f46a3-1e4e-4195-b4e5-b8155192689d\", \"name\": \"my-ike-policy\", \"resource_type\": \"ike_policy\"}, \"ipsec_policy\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"id\": \"r006-51eae621-dbbc-4c47-b623-b57a43c19876\", \"name\": \"my-ipsec-policy\", \"resource_type\": \"ipsec_policy\"}, \"mode\": \"policy\", \"name\": \"my-vpn-gateway-connection\", \"psk\": \"lkj14b1oi0alcniejkso\", \"resource_type\": \"vpn_gateway_connection\", \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}], \"distribute_traffic\": false, \"local\": {\"ike_identities\": [{\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}]}, \"peer\": {\"ike_identity\": {\"type\": \"fqdn\", \"value\": \"my-service.example.com\"}, \"type\": \"address\", \"address\": \"192.0.2.5\"}, \"routing_protocol\": \"none\", \"tunnels\": [{\"public_ip\": {\"address\": \"192.168.3.4\"}, \"status\": \"down\", \"status_reasons\": [{\"code\": \"cannot_authenticate_connection\", \"message\": \"Failed to authenticate a connection because of mismatched IKE ID and PSK.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health#vpn-connection-health\"}]}]}"; + String updateVpnGatewayConnectionPath = "/vpn_gateways/testString/connections/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the RemoveEndpointGatewayIpOptions model - RemoveEndpointGatewayIpOptions removeEndpointGatewayIpOptionsModel = new RemoveEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") + // Construct an instance of the VPNGatewayConnectionDPDPatch model + VPNGatewayConnectionDPDPatch vpnGatewayConnectionDpdPatchModel = new VPNGatewayConnectionDPDPatch.Builder() + .action("restart") + .interval(Long.valueOf("30")) + .timeout(Long.valueOf("120")) + .build(); + + // Construct an instance of the VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model + VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPatchModel = new VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById.Builder() + .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") + .build(); + + // Construct an instance of the VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model + VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPatchModel = new VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById.Builder() + .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") + .build(); + + // Construct an instance of the VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch model + VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch vpnGatewayConnectionPeerPatchModel = new VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch.Builder() + .address("192.0.2.5") + .build(); + + // Construct an instance of the IP model + IP ipModel = new IP.Builder() + .address("169.254.0.2") + .build(); + + // Construct an instance of the VPNGatewayConnectionTunnel model + VPNGatewayConnectionTunnel vpnGatewayConnectionTunnelModel = new VPNGatewayConnectionTunnel.Builder() + .neighborIp(ipModel) + .tunnelInterfaceIp(ipModel) + .build(); + + // Construct an instance of the VPNGatewayConnectionPatch model + VPNGatewayConnectionPatch vpnGatewayConnectionPatchModel = new VPNGatewayConnectionPatch.Builder() + .adminStateUp(true) + .deadPeerDetection(vpnGatewayConnectionDpdPatchModel) + .distributeTraffic(true) + .establishMode("bidirectional") + .ikePolicy(vpnGatewayConnectionIkePolicyPatchModel) + .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPatchModel) + .name("my-vpn-gateway-connection") + .peer(vpnGatewayConnectionPeerPatchModel) + .psk("lkj14b1oi0alcniejkso") + .routingProtocol("bgp") + .tunnels(java.util.Arrays.asList(vpnGatewayConnectionTunnelModel)) + .build(); + Map vpnGatewayConnectionPatchModelAsPatch = vpnGatewayConnectionPatchModel.asPatch(); + + // Construct an instance of the UpdateVpnGatewayConnectionOptions model + UpdateVpnGatewayConnectionOptions updateVpnGatewayConnectionOptionsModel = new UpdateVpnGatewayConnectionOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .vpnGatewayConnectionPatch(vpnGatewayConnectionPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke removeEndpointGatewayIp() with a valid options model and verify the result - Response response = vpcService.removeEndpointGatewayIp(removeEndpointGatewayIpOptionsModel).execute(); + // Invoke updateVpnGatewayConnection() with a valid options model and verify the result + Response response = vpcService.updateVpnGatewayConnection(updateVpnGatewayConnectionOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + VPNGatewayConnection responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, removeEndpointGatewayIpPath); + assertEquals(parsedPath, updateVpnGatewayConnectionPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the removeEndpointGatewayIp operation with and without retries enabled + // Test the updateVpnGatewayConnection operation with and without retries enabled @Test - public void testRemoveEndpointGatewayIpWRetries() throws Throwable { + public void testUpdateVpnGatewayConnectionWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testRemoveEndpointGatewayIpWOptions(); + testUpdateVpnGatewayConnectionWOptions(); vpcService.disableRetries(); - testRemoveEndpointGatewayIpWOptions(); + testUpdateVpnGatewayConnectionWOptions(); } - // Test the removeEndpointGatewayIp operation with a null options model (negative test) + // Test the updateVpnGatewayConnection operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testRemoveEndpointGatewayIpNoOptions() throws Throwable { + public void testUpdateVpnGatewayConnectionNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.removeEndpointGatewayIp(null).execute(); + vpcService.updateVpnGatewayConnection(null).execute(); } - // Test the getEndpointGatewayIp operation with a valid options model parameter + // Test the listVpnGatewayConnectionsLocalCidrs operation with a valid options model parameter @Test - public void testGetEndpointGatewayIpWOptions() throws Throwable { + public void testListVpnGatewayConnectionsLocalCidrsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; - String getEndpointGatewayIpPath = "/endpoint_gateways/testString/ips/testString"; + String mockResponseBody = "{\"cidrs\": [\"192.0.2.0/24\"]}"; + String listVpnGatewayConnectionsLocalCidrsPath = "/vpn_gateways/testString/connections/testString/local/cidrs"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetEndpointGatewayIpOptions model - GetEndpointGatewayIpOptions getEndpointGatewayIpOptionsModel = new GetEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") + // Construct an instance of the ListVpnGatewayConnectionsLocalCidrsOptions model + ListVpnGatewayConnectionsLocalCidrsOptions listVpnGatewayConnectionsLocalCidrsOptionsModel = new ListVpnGatewayConnectionsLocalCidrsOptions.Builder() + .vpnGatewayId("testString") .id("testString") .build(); - // Invoke getEndpointGatewayIp() with a valid options model and verify the result - Response response = vpcService.getEndpointGatewayIp(getEndpointGatewayIpOptionsModel).execute(); + // Invoke listVpnGatewayConnectionsLocalCidrs() with a valid options model and verify the result + Response response = vpcService.listVpnGatewayConnectionsLocalCidrs(listVpnGatewayConnectionsLocalCidrsOptionsModel).execute(); assertNotNull(response); - ReservedIP responseObj = response.getResult(); + VPNGatewayConnectionCIDRs responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -32134,102 +33714,104 @@ public void testGetEndpointGatewayIpWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getEndpointGatewayIpPath); + assertEquals(parsedPath, listVpnGatewayConnectionsLocalCidrsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getEndpointGatewayIp operation with and without retries enabled + // Test the listVpnGatewayConnectionsLocalCidrs operation with and without retries enabled @Test - public void testGetEndpointGatewayIpWRetries() throws Throwable { + public void testListVpnGatewayConnectionsLocalCidrsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetEndpointGatewayIpWOptions(); + testListVpnGatewayConnectionsLocalCidrsWOptions(); vpcService.disableRetries(); - testGetEndpointGatewayIpWOptions(); + testListVpnGatewayConnectionsLocalCidrsWOptions(); } - // Test the getEndpointGatewayIp operation with a null options model (negative test) + // Test the listVpnGatewayConnectionsLocalCidrs operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetEndpointGatewayIpNoOptions() throws Throwable { + public void testListVpnGatewayConnectionsLocalCidrsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getEndpointGatewayIp(null).execute(); + vpcService.listVpnGatewayConnectionsLocalCidrs(null).execute(); } - // Test the addEndpointGatewayIp operation with a valid options model parameter + // Test the removeVpnGatewayConnectionsLocalCidr operation with a valid options model parameter @Test - public void testAddEndpointGatewayIpWOptions() throws Throwable { + public void testRemoveVpnGatewayConnectionsLocalCidrWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"address\": \"192.168.3.4\", \"auto_delete\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"lifecycle_state\": \"stable\", \"name\": \"my-reserved-ip\", \"owner\": \"provider\", \"resource_type\": \"subnet_reserved_ip\", \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"name\": \"my-endpoint-gateway\", \"resource_type\": \"endpoint_gateway\"}}"; - String addEndpointGatewayIpPath = "/endpoint_gateways/testString/ips/testString"; + String mockResponseBody = ""; + String removeVpnGatewayConnectionsLocalCidrPath = "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the AddEndpointGatewayIpOptions model - AddEndpointGatewayIpOptions addEndpointGatewayIpOptionsModel = new AddEndpointGatewayIpOptions.Builder() - .endpointGatewayId("testString") + // Construct an instance of the RemoveVpnGatewayConnectionsLocalCidrOptions model + RemoveVpnGatewayConnectionsLocalCidrOptions removeVpnGatewayConnectionsLocalCidrOptionsModel = new RemoveVpnGatewayConnectionsLocalCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke addEndpointGatewayIp() with a valid options model and verify the result - Response response = vpcService.addEndpointGatewayIp(addEndpointGatewayIpOptionsModel).execute(); + // Invoke removeVpnGatewayConnectionsLocalCidr() with a valid options model and verify the result + Response response = vpcService.removeVpnGatewayConnectionsLocalCidr(removeVpnGatewayConnectionsLocalCidrOptionsModel).execute(); assertNotNull(response); - ReservedIP responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addEndpointGatewayIpPath); + assertEquals(parsedPath, removeVpnGatewayConnectionsLocalCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the addEndpointGatewayIp operation with and without retries enabled + // Test the removeVpnGatewayConnectionsLocalCidr operation with and without retries enabled @Test - public void testAddEndpointGatewayIpWRetries() throws Throwable { + public void testRemoveVpnGatewayConnectionsLocalCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testAddEndpointGatewayIpWOptions(); + testRemoveVpnGatewayConnectionsLocalCidrWOptions(); vpcService.disableRetries(); - testAddEndpointGatewayIpWOptions(); + testRemoveVpnGatewayConnectionsLocalCidrWOptions(); } - // Test the addEndpointGatewayIp operation with a null options model (negative test) + // Test the removeVpnGatewayConnectionsLocalCidr operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddEndpointGatewayIpNoOptions() throws Throwable { + public void testRemoveVpnGatewayConnectionsLocalCidrNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.addEndpointGatewayIp(null).execute(); + vpcService.removeVpnGatewayConnectionsLocalCidr(null).execute(); } - // Test the deleteEndpointGateway operation with a valid options model parameter + // Test the checkVpnGatewayConnectionsLocalCidr operation with a valid options model parameter @Test - public void testDeleteEndpointGatewayWOptions() throws Throwable { + public void testCheckVpnGatewayConnectionsLocalCidrWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteEndpointGatewayPath = "/endpoint_gateways/testString"; + String checkVpnGatewayConnectionsLocalCidrPath = "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the DeleteEndpointGatewayOptions model - DeleteEndpointGatewayOptions deleteEndpointGatewayOptionsModel = new DeleteEndpointGatewayOptions.Builder() + // Construct an instance of the CheckVpnGatewayConnectionsLocalCidrOptions model + CheckVpnGatewayConnectionsLocalCidrOptions checkVpnGatewayConnectionsLocalCidrOptionsModel = new CheckVpnGatewayConnectionsLocalCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke deleteEndpointGateway() with a valid options model and verify the result - Response response = vpcService.deleteEndpointGateway(deleteEndpointGatewayOptionsModel).execute(); + // Invoke checkVpnGatewayConnectionsLocalCidr() with a valid options model and verify the result + Response response = vpcService.checkVpnGatewayConnectionsLocalCidr(checkVpnGatewayConnectionsLocalCidrOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -32237,376 +33819,269 @@ public void testDeleteEndpointGatewayWOptions() throws Throwable { // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteEndpointGatewayPath); + assertEquals(parsedPath, checkVpnGatewayConnectionsLocalCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteEndpointGateway operation with and without retries enabled + // Test the checkVpnGatewayConnectionsLocalCidr operation with and without retries enabled @Test - public void testDeleteEndpointGatewayWRetries() throws Throwable { + public void testCheckVpnGatewayConnectionsLocalCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteEndpointGatewayWOptions(); + testCheckVpnGatewayConnectionsLocalCidrWOptions(); vpcService.disableRetries(); - testDeleteEndpointGatewayWOptions(); + testCheckVpnGatewayConnectionsLocalCidrWOptions(); } - // Test the deleteEndpointGateway operation with a null options model (negative test) + // Test the checkVpnGatewayConnectionsLocalCidr operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteEndpointGatewayNoOptions() throws Throwable { + public void testCheckVpnGatewayConnectionsLocalCidrNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteEndpointGateway(null).execute(); + vpcService.checkVpnGatewayConnectionsLocalCidr(null).execute(); } - // Test the getEndpointGateway operation with a valid options model parameter + // Test the addVpnGatewayConnectionsLocalCidr operation with a valid options model parameter @Test - public void testGetEndpointGatewayWOptions() throws Throwable { + public void testAddVpnGatewayConnectionsLocalCidrWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_dns_resolution_binding\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_reasons\": [{\"code\": \"dns_resolution_binding_pending\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-endpoint-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"endpoint_gateway\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"service_endpoint\": \"my-cloudant-instance.appdomain.cloud\", \"service_endpoints\": [\"my-cloudant-instance.appdomain.cloud\"], \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"name\": \"my-private-path-service-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"private_path_service_gateway\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getEndpointGatewayPath = "/endpoint_gateways/testString"; + String mockResponseBody = ""; + String addVpnGatewayConnectionsLocalCidrPath = "/vpn_gateways/testString/connections/testString/local/cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the GetEndpointGatewayOptions model - GetEndpointGatewayOptions getEndpointGatewayOptionsModel = new GetEndpointGatewayOptions.Builder() + // Construct an instance of the AddVpnGatewayConnectionsLocalCidrOptions model + AddVpnGatewayConnectionsLocalCidrOptions addVpnGatewayConnectionsLocalCidrOptionsModel = new AddVpnGatewayConnectionsLocalCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke getEndpointGateway() with a valid options model and verify the result - Response response = vpcService.getEndpointGateway(getEndpointGatewayOptionsModel).execute(); + // Invoke addVpnGatewayConnectionsLocalCidr() with a valid options model and verify the result + Response response = vpcService.addVpnGatewayConnectionsLocalCidr(addVpnGatewayConnectionsLocalCidrOptionsModel).execute(); assertNotNull(response); - EndpointGateway responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getEndpointGatewayPath); + assertEquals(parsedPath, addVpnGatewayConnectionsLocalCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getEndpointGateway operation with and without retries enabled + // Test the addVpnGatewayConnectionsLocalCidr operation with and without retries enabled @Test - public void testGetEndpointGatewayWRetries() throws Throwable { + public void testAddVpnGatewayConnectionsLocalCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetEndpointGatewayWOptions(); + testAddVpnGatewayConnectionsLocalCidrWOptions(); vpcService.disableRetries(); - testGetEndpointGatewayWOptions(); + testAddVpnGatewayConnectionsLocalCidrWOptions(); } - // Test the getEndpointGateway operation with a null options model (negative test) + // Test the addVpnGatewayConnectionsLocalCidr operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetEndpointGatewayNoOptions() throws Throwable { + public void testAddVpnGatewayConnectionsLocalCidrNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getEndpointGateway(null).execute(); + vpcService.addVpnGatewayConnectionsLocalCidr(null).execute(); } - // Test the updateEndpointGateway operation with a valid options model parameter + // Test the listVpnGatewayConnectionsPeerCidrs operation with a valid options model parameter @Test - public void testUpdateEndpointGatewayWOptions() throws Throwable { + public void testListVpnGatewayConnectionsPeerCidrsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"allow_dns_resolution_binding\": false, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::endpoint-gateway:r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"id\": \"r006-7610ebfb-f5dc-4d42-bc18-287d47f7a5b0\", \"ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"lifecycle_reasons\": [{\"code\": \"dns_resolution_binding_pending\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-endpoint-gateway\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"endpoint_gateway\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"service_endpoint\": \"my-cloudant-instance.appdomain.cloud\", \"service_endpoints\": [\"my-cloudant-instance.appdomain.cloud\"], \"target\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"name\": \"my-private-path-service-gateway\", \"remote\": {\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"region\": {\"href\": \"https://us-south.iaas.cloud.ibm.com/v1/regions/us-south\", \"name\": \"us-south\"}}, \"resource_type\": \"private_path_service_gateway\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String updateEndpointGatewayPath = "/endpoint_gateways/testString"; + String mockResponseBody = "{\"cidrs\": [\"192.0.2.0/24\"]}"; + String listVpnGatewayConnectionsPeerCidrsPath = "/vpn_gateways/testString/connections/testString/peer/cidrs"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the EndpointGatewayPatch model - EndpointGatewayPatch endpointGatewayPatchModel = new EndpointGatewayPatch.Builder() - .allowDnsResolutionBinding(false) - .name("my-endpoint-gateway") - .build(); - Map endpointGatewayPatchModelAsPatch = endpointGatewayPatchModel.asPatch(); - - // Construct an instance of the UpdateEndpointGatewayOptions model - UpdateEndpointGatewayOptions updateEndpointGatewayOptionsModel = new UpdateEndpointGatewayOptions.Builder() + // Construct an instance of the ListVpnGatewayConnectionsPeerCidrsOptions model + ListVpnGatewayConnectionsPeerCidrsOptions listVpnGatewayConnectionsPeerCidrsOptionsModel = new ListVpnGatewayConnectionsPeerCidrsOptions.Builder() + .vpnGatewayId("testString") .id("testString") - .endpointGatewayPatch(endpointGatewayPatchModelAsPatch) .build(); - // Invoke updateEndpointGateway() with a valid options model and verify the result - Response response = vpcService.updateEndpointGateway(updateEndpointGatewayOptionsModel).execute(); + // Invoke listVpnGatewayConnectionsPeerCidrs() with a valid options model and verify the result + Response response = vpcService.listVpnGatewayConnectionsPeerCidrs(listVpnGatewayConnectionsPeerCidrsOptionsModel).execute(); assertNotNull(response); - EndpointGateway responseObj = response.getResult(); + VPNGatewayConnectionCIDRs responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateEndpointGatewayPath); + assertEquals(parsedPath, listVpnGatewayConnectionsPeerCidrsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateEndpointGateway operation with and without retries enabled + // Test the listVpnGatewayConnectionsPeerCidrs operation with and without retries enabled @Test - public void testUpdateEndpointGatewayWRetries() throws Throwable { + public void testListVpnGatewayConnectionsPeerCidrsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateEndpointGatewayWOptions(); + testListVpnGatewayConnectionsPeerCidrsWOptions(); vpcService.disableRetries(); - testUpdateEndpointGatewayWOptions(); + testListVpnGatewayConnectionsPeerCidrsWOptions(); } - // Test the updateEndpointGateway operation with a null options model (negative test) + // Test the listVpnGatewayConnectionsPeerCidrs operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateEndpointGatewayNoOptions() throws Throwable { + public void testListVpnGatewayConnectionsPeerCidrsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateEndpointGateway(null).execute(); + vpcService.listVpnGatewayConnectionsPeerCidrs(null).execute(); } - // Test the listFlowLogCollectors operation with a valid options model parameter + // Test the removeVpnGatewayConnectionsPeerCidr operation with a valid options model parameter @Test - public void testListFlowLogCollectorsWOptions() throws Throwable { + public void testRemoveVpnGatewayConnectionsPeerCidrWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"flow_log_collectors\": [{\"active\": true, \"auto_delete\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"id\": \"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"lifecycle_state\": \"stable\", \"name\": \"my-flow-log-collector\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"storage_bucket\": {\"name\": \"bucket-27200-lwx4cfvcue\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"resource_type\": \"network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}], \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listFlowLogCollectorsPath = "/flow_log_collectors"; + String mockResponseBody = ""; + String removeVpnGatewayConnectionsPeerCidrPath = "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the ListFlowLogCollectorsOptions model - ListFlowLogCollectorsOptions listFlowLogCollectorsOptionsModel = new ListFlowLogCollectorsOptions.Builder() - .start("testString") - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .targetId("testString") - .targetResourceType("testString") + // Construct an instance of the RemoveVpnGatewayConnectionsPeerCidrOptions model + RemoveVpnGatewayConnectionsPeerCidrOptions removeVpnGatewayConnectionsPeerCidrOptionsModel = new RemoveVpnGatewayConnectionsPeerCidrOptions.Builder() + .vpnGatewayId("testString") + .id("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke listFlowLogCollectors() with a valid options model and verify the result - Response response = vpcService.listFlowLogCollectors(listFlowLogCollectorsOptionsModel).execute(); + // Invoke removeVpnGatewayConnectionsPeerCidr() with a valid options model and verify the result + Response response = vpcService.removeVpnGatewayConnectionsPeerCidr(removeVpnGatewayConnectionsPeerCidrOptionsModel).execute(); assertNotNull(response); - FlowLogCollectorCollection responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "GET"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listFlowLogCollectorsPath); + assertEquals(parsedPath, removeVpnGatewayConnectionsPeerCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - assertEquals(query.get("start"), "testString"); - assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("resource_group.id"), "testString"); - assertEquals(query.get("name"), "my-name"); - assertEquals(query.get("vpc.id"), "testString"); - assertEquals(query.get("vpc.crn"), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); - assertEquals(query.get("vpc.name"), "my-vpc"); - assertEquals(query.get("target.id"), "testString"); - assertEquals(query.get("target.resource_type"), "testString"); } - // Test the listFlowLogCollectors operation with and without retries enabled + // Test the removeVpnGatewayConnectionsPeerCidr operation with and without retries enabled @Test - public void testListFlowLogCollectorsWRetries() throws Throwable { + public void testRemoveVpnGatewayConnectionsPeerCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListFlowLogCollectorsWOptions(); + testRemoveVpnGatewayConnectionsPeerCidrWOptions(); vpcService.disableRetries(); - testListFlowLogCollectorsWOptions(); + testRemoveVpnGatewayConnectionsPeerCidrWOptions(); } - // Test the listFlowLogCollectors operation using the FlowLogCollectorsPager.getNext() method - @Test - public void testListFlowLogCollectorsWithPagerGetNext() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"id\":\"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"id\":\"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .targetId("testString") - .targetResourceType("testString") - .build(); - - List allResults = new ArrayList<>(); - FlowLogCollectorsPager pager = new FlowLogCollectorsPager(vpcService, listFlowLogCollectorsOptions); - while (pager.hasNext()) { - List nextPage = pager.getNext(); - assertNotNull(nextPage); - allResults.addAll(nextPage); - } - assertEquals(allResults.size(), 2); + // Test the removeVpnGatewayConnectionsPeerCidr operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testRemoveVpnGatewayConnectionsPeerCidrNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.removeVpnGatewayConnectionsPeerCidr(null).execute(); } - - // Test the listFlowLogCollectors operation using the FlowLogCollectorsPager.getAll() method - @Test - public void testListFlowLogCollectorsWithPagerGetAll() throws Throwable { - // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"id\":\"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"flow_log_collectors\":[{\"active\":true,\"auto_delete\":true,\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"id\":\"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\",\"lifecycle_state\":\"stable\",\"name\":\"my-flow-log-collector\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"storage_bucket\":{\"name\":\"bucket-27200-lwx4cfvcue\"},\"target\":{\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"id\":\"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\",\"name\":\"my-instance-network-interface\",\"resource_type\":\"network_interface\"},\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListFlowLogCollectorsOptions listFlowLogCollectorsOptions = new ListFlowLogCollectorsOptions.Builder() - .limit(Long.valueOf("10")) - .resourceGroupId("testString") - .name("my-name") - .vpcId("testString") - .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") - .vpcName("my-vpc") - .targetId("testString") - .targetResourceType("testString") - .build(); - FlowLogCollectorsPager pager = new FlowLogCollectorsPager(vpcService, listFlowLogCollectorsOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createFlowLogCollector operation with a valid options model parameter + // Test the checkVpnGatewayConnectionsPeerCidr operation with a valid options model parameter @Test - public void testCreateFlowLogCollectorWOptions() throws Throwable { + public void testCheckVpnGatewayConnectionsPeerCidrWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"auto_delete\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"id\": \"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"lifecycle_state\": \"stable\", \"name\": \"my-flow-log-collector\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"storage_bucket\": {\"name\": \"bucket-27200-lwx4cfvcue\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"resource_type\": \"network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String createFlowLogCollectorPath = "/flow_log_collectors"; + String mockResponseBody = ""; + String checkVpnGatewayConnectionsPeerCidrPath = "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) + .setResponseCode(204) .setBody(mockResponseBody)); - // Construct an instance of the LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName model - LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName legacyCloudObjectStorageBucketIdentityModel = new LegacyCloudObjectStorageBucketIdentityCloudObjectStorageBucketIdentityByName.Builder() - .name("bucket-27200-lwx4cfvcue") - .build(); - - // Construct an instance of the FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById model - FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById flowLogCollectorTargetPrototypeModel = new FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityById.Builder() - .id("0717-d54eb633-98ea-459d-aa00-6a8e780175a7") - .build(); - - // Construct an instance of the ResourceGroupIdentityById model - ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() - .id("fee82deba12e4c0fb69c3b09d1f12345") - .build(); - - // Construct an instance of the CreateFlowLogCollectorOptions model - CreateFlowLogCollectorOptions createFlowLogCollectorOptionsModel = new CreateFlowLogCollectorOptions.Builder() - .storageBucket(legacyCloudObjectStorageBucketIdentityModel) - .target(flowLogCollectorTargetPrototypeModel) - .active(false) - .name("my-flow-log-collector") - .resourceGroup(resourceGroupIdentityModel) + // Construct an instance of the CheckVpnGatewayConnectionsPeerCidrOptions model + CheckVpnGatewayConnectionsPeerCidrOptions checkVpnGatewayConnectionsPeerCidrOptionsModel = new CheckVpnGatewayConnectionsPeerCidrOptions.Builder() + .vpnGatewayId("testString") + .id("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke createFlowLogCollector() with a valid options model and verify the result - Response response = vpcService.createFlowLogCollector(createFlowLogCollectorOptionsModel).execute(); + // Invoke checkVpnGatewayConnectionsPeerCidr() with a valid options model and verify the result + Response response = vpcService.checkVpnGatewayConnectionsPeerCidr(checkVpnGatewayConnectionsPeerCidrOptionsModel).execute(); assertNotNull(response); - FlowLogCollector responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createFlowLogCollectorPath); + assertEquals(parsedPath, checkVpnGatewayConnectionsPeerCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createFlowLogCollector operation with and without retries enabled + // Test the checkVpnGatewayConnectionsPeerCidr operation with and without retries enabled @Test - public void testCreateFlowLogCollectorWRetries() throws Throwable { + public void testCheckVpnGatewayConnectionsPeerCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreateFlowLogCollectorWOptions(); + testCheckVpnGatewayConnectionsPeerCidrWOptions(); vpcService.disableRetries(); - testCreateFlowLogCollectorWOptions(); + testCheckVpnGatewayConnectionsPeerCidrWOptions(); } - // Test the createFlowLogCollector operation with a null options model (negative test) + // Test the checkVpnGatewayConnectionsPeerCidr operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateFlowLogCollectorNoOptions() throws Throwable { + public void testCheckVpnGatewayConnectionsPeerCidrNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createFlowLogCollector(null).execute(); + vpcService.checkVpnGatewayConnectionsPeerCidr(null).execute(); } - // Test the deleteFlowLogCollector operation with a valid options model parameter + // Test the addVpnGatewayConnectionsPeerCidr operation with a valid options model parameter @Test - public void testDeleteFlowLogCollectorWOptions() throws Throwable { + public void testAddVpnGatewayConnectionsPeerCidrWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deleteFlowLogCollectorPath = "/flow_log_collectors/testString"; + String addVpnGatewayConnectionsPeerCidrPath = "/vpn_gateways/testString/connections/testString/peer/cidrs/192.168.3.0%2F24"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the DeleteFlowLogCollectorOptions model - DeleteFlowLogCollectorOptions deleteFlowLogCollectorOptionsModel = new DeleteFlowLogCollectorOptions.Builder() + // Construct an instance of the AddVpnGatewayConnectionsPeerCidrOptions model + AddVpnGatewayConnectionsPeerCidrOptions addVpnGatewayConnectionsPeerCidrOptionsModel = new AddVpnGatewayConnectionsPeerCidrOptions.Builder() + .vpnGatewayId("testString") .id("testString") + .cidr("192.168.3.0/24") .build(); - // Invoke deleteFlowLogCollector() with a valid options model and verify the result - Response response = vpcService.deleteFlowLogCollector(deleteFlowLogCollectorOptionsModel).execute(); + // Invoke addVpnGatewayConnectionsPeerCidr() with a valid options model and verify the result + Response response = vpcService.addVpnGatewayConnectionsPeerCidr(addVpnGatewayConnectionsPeerCidrOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -32614,54 +34089,56 @@ public void testDeleteFlowLogCollectorWOptions() throws Throwable { // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); + assertEquals(request.getMethod(), "PUT"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteFlowLogCollectorPath); + assertEquals(parsedPath, addVpnGatewayConnectionsPeerCidrPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deleteFlowLogCollector operation with and without retries enabled + // Test the addVpnGatewayConnectionsPeerCidr operation with and without retries enabled @Test - public void testDeleteFlowLogCollectorWRetries() throws Throwable { + public void testAddVpnGatewayConnectionsPeerCidrWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeleteFlowLogCollectorWOptions(); + testAddVpnGatewayConnectionsPeerCidrWOptions(); vpcService.disableRetries(); - testDeleteFlowLogCollectorWOptions(); + testAddVpnGatewayConnectionsPeerCidrWOptions(); } - // Test the deleteFlowLogCollector operation with a null options model (negative test) + // Test the addVpnGatewayConnectionsPeerCidr operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteFlowLogCollectorNoOptions() throws Throwable { + public void testAddVpnGatewayConnectionsPeerCidrNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deleteFlowLogCollector(null).execute(); + vpcService.addVpnGatewayConnectionsPeerCidr(null).execute(); } - // Test the getFlowLogCollector operation with a valid options model parameter + // Test the listVpnGatewayServiceConnections operation with a valid options model parameter @Test - public void testGetFlowLogCollectorWOptions() throws Throwable { + public void testListVpnGatewayServiceConnectionsWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"active\": true, \"auto_delete\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"id\": \"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"lifecycle_state\": \"stable\", \"name\": \"my-flow-log-collector\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"storage_bucket\": {\"name\": \"bucket-27200-lwx4cfvcue\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"resource_type\": \"network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String getFlowLogCollectorPath = "/flow_log_collectors/testString"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"service_connections\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\", \"id\": \"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\", \"resource_type\": \"transit_gateway\"}, \"id\": \"0717-64e7e88c-4b28-4082-9ab8-3f95876952ac\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"status\": \"up\", \"status_reasons\": [{\"code\": \"peer_not_responding\", \"message\": \"The connection is down because the peer is not responding.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}]}], \"total_count\": 132}"; + String listVpnGatewayServiceConnectionsPath = "/vpn_gateways/testString/service_connections"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetFlowLogCollectorOptions model - GetFlowLogCollectorOptions getFlowLogCollectorOptionsModel = new GetFlowLogCollectorOptions.Builder() - .id("testString") + // Construct an instance of the ListVpnGatewayServiceConnectionsOptions model + ListVpnGatewayServiceConnectionsOptions listVpnGatewayServiceConnectionsOptionsModel = new ListVpnGatewayServiceConnectionsOptions.Builder() + .vpnGatewayId("testString") + .start("testString") + .limit(Long.valueOf("10")) .build(); - // Invoke getFlowLogCollector() with a valid options model and verify the result - Response response = vpcService.getFlowLogCollector(getFlowLogCollectorOptionsModel).execute(); + // Invoke listVpnGatewayServiceConnections() with a valid options model and verify the result + Response response = vpcService.listVpnGatewayServiceConnections(listVpnGatewayServiceConnectionsOptionsModel).execute(); assertNotNull(response); - FlowLogCollector responseObj = response.getResult(); + VPNGatewayServiceConnectionCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -32670,114 +34147,175 @@ public void testGetFlowLogCollectorWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getFlowLogCollectorPath); + assertEquals(parsedPath, listVpnGatewayServiceConnectionsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("start"), "testString"); + assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); } - // Test the getFlowLogCollector operation with and without retries enabled + // Test the listVpnGatewayServiceConnections operation with and without retries enabled @Test - public void testGetFlowLogCollectorWRetries() throws Throwable { + public void testListVpnGatewayServiceConnectionsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetFlowLogCollectorWOptions(); + testListVpnGatewayServiceConnectionsWOptions(); vpcService.disableRetries(); - testGetFlowLogCollectorWOptions(); + testListVpnGatewayServiceConnectionsWOptions(); } - // Test the getFlowLogCollector operation with a null options model (negative test) + // Test the listVpnGatewayServiceConnections operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetFlowLogCollectorNoOptions() throws Throwable { + public void testListVpnGatewayServiceConnectionsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getFlowLogCollector(null).execute(); + vpcService.listVpnGatewayServiceConnections(null).execute(); } - // Test the updateFlowLogCollector operation with a valid options model parameter + // Test the listVpnGatewayServiceConnections operation using the VpnGatewayServiceConnectionsPager.getNext() method @Test - public void testUpdateFlowLogCollectorWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"active\": true, \"auto_delete\": true, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::flow-log-collector:r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"id\": \"r006-ad0cded3-53a3-4d4a-9809-8c59b50d2b80\", \"lifecycle_state\": \"stable\", \"name\": \"my-flow-log-collector\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"storage_bucket\": {\"name\": \"bucket-27200-lwx4cfvcue\"}, \"target\": {\"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/instances/0717_e21b7391-2ca2-4ab5-84a8-b92157a633b0/network_interfaces/0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"id\": \"0717-d54eb633-98ea-459d-aa00-6a8e780175a7\", \"name\": \"my-instance-network-interface\", \"resource_type\": \"network_interface\"}, \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; - String updateFlowLogCollectorPath = "/flow_log_collectors/testString"; + public void testListVpnGatewayServiceConnectionsWithPagerGetNext() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"service_connections\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\",\"id\":\"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\",\"resource_type\":\"transit_gateway\"},\"id\":\"0717-64e7e88c-4b28-4082-9ab8-3f95876952ac\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"status\":\"up\",\"status_reasons\":[{\"code\":\"peer_not_responding\",\"message\":\"The connection is down because the peer is not responding.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"service_connections\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\",\"id\":\"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\",\"resource_type\":\"transit_gateway\"},\"id\":\"0717-64e7e88c-4b28-4082-9ab8-3f95876952ac\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"status\":\"up\",\"status_reasons\":[{\"code\":\"peer_not_responding\",\"message\":\"The connection is down because the peer is not responding.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}]}]}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) - .setBody(mockResponseBody)); + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - // Construct an instance of the FlowLogCollectorPatch model - FlowLogCollectorPatch flowLogCollectorPatchModel = new FlowLogCollectorPatch.Builder() - .active(false) - .name("my-flow-log-collector") + ListVpnGatewayServiceConnectionsOptions listVpnGatewayServiceConnectionsOptions = new ListVpnGatewayServiceConnectionsOptions.Builder() + .vpnGatewayId("testString") + .limit(Long.valueOf("10")) .build(); - Map flowLogCollectorPatchModelAsPatch = flowLogCollectorPatchModel.asPatch(); - // Construct an instance of the UpdateFlowLogCollectorOptions model - UpdateFlowLogCollectorOptions updateFlowLogCollectorOptionsModel = new UpdateFlowLogCollectorOptions.Builder() + List allResults = new ArrayList<>(); + VpnGatewayServiceConnectionsPager pager = new VpnGatewayServiceConnectionsPager(vpcService, listVpnGatewayServiceConnectionsOptions); + while (pager.hasNext()) { + List nextPage = pager.getNext(); + assertNotNull(nextPage); + allResults.addAll(nextPage); + } + assertEquals(allResults.size(), 2); + } + + // Test the listVpnGatewayServiceConnections operation using the VpnGatewayServiceConnectionsPager.getAll() method + @Test + public void testListVpnGatewayServiceConnectionsWithPagerGetAll() throws Throwable { + // Set up the two-page mock response. + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"service_connections\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\",\"id\":\"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\",\"resource_type\":\"transit_gateway\"},\"id\":\"0717-64e7e88c-4b28-4082-9ab8-3f95876952ac\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"status\":\"up\",\"status_reasons\":[{\"code\":\"peer_not_responding\",\"message\":\"The connection is down because the peer is not responding.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}]}]}"; + String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"service_connections\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"creator\":{\"crn\":\"crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\",\"id\":\"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\",\"resource_type\":\"transit_gateway\"},\"id\":\"0717-64e7e88c-4b28-4082-9ab8-3f95876952ac\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"status\":\"up\",\"status_reasons\":[{\"code\":\"peer_not_responding\",\"message\":\"The connection is down because the peer is not responding.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}]}]}"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); + + ListVpnGatewayServiceConnectionsOptions listVpnGatewayServiceConnectionsOptions = new ListVpnGatewayServiceConnectionsOptions.Builder() + .vpnGatewayId("testString") + .limit(Long.valueOf("10")) + .build(); + + VpnGatewayServiceConnectionsPager pager = new VpnGatewayServiceConnectionsPager(vpcService, listVpnGatewayServiceConnectionsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); + } + + // Test the getVpnGatewayServiceConnection operation with a valid options model parameter + @Test + public void testGetVpnGatewayServiceConnectionWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"creator\": {\"crn\": \"crn:v1:bluemix:public:transit:dal03:a/aa2432b1fa4d4ace891e9b80fc104e34::gateway:ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\", \"id\": \"ef4dcb1a-fee4-41c7-9e11-9cd99e65c1f4\", \"resource_type\": \"transit_gateway\"}, \"id\": \"0717-64e7e88c-4b28-4082-9ab8-3f95876952ac\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"status\": \"up\", \"status_reasons\": [{\"code\": \"peer_not_responding\", \"message\": \"The connection is down because the peer is not responding.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-health\"}]}"; + String getVpnGatewayServiceConnectionPath = "/vpn_gateways/testString/service_connections/testString"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetVpnGatewayServiceConnectionOptions model + GetVpnGatewayServiceConnectionOptions getVpnGatewayServiceConnectionOptionsModel = new GetVpnGatewayServiceConnectionOptions.Builder() + .vpnGatewayId("testString") .id("testString") - .flowLogCollectorPatch(flowLogCollectorPatchModelAsPatch) .build(); - // Invoke updateFlowLogCollector() with a valid options model and verify the result - Response response = vpcService.updateFlowLogCollector(updateFlowLogCollectorOptionsModel).execute(); + // Invoke getVpnGatewayServiceConnection() with a valid options model and verify the result + Response response = vpcService.getVpnGatewayServiceConnection(getVpnGatewayServiceConnectionOptionsModel).execute(); assertNotNull(response); - FlowLogCollector responseObj = response.getResult(); + VPNGatewayServiceConnection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateFlowLogCollectorPath); + assertEquals(parsedPath, getVpnGatewayServiceConnectionPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updateFlowLogCollector operation with and without retries enabled + // Test the getVpnGatewayServiceConnection operation with and without retries enabled @Test - public void testUpdateFlowLogCollectorWRetries() throws Throwable { + public void testGetVpnGatewayServiceConnectionWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdateFlowLogCollectorWOptions(); + testGetVpnGatewayServiceConnectionWOptions(); vpcService.disableRetries(); - testUpdateFlowLogCollectorWOptions(); + testGetVpnGatewayServiceConnectionWOptions(); } - // Test the updateFlowLogCollector operation with a null options model (negative test) + // Test the getVpnGatewayServiceConnection operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateFlowLogCollectorNoOptions() throws Throwable { + public void testGetVpnGatewayServiceConnectionNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updateFlowLogCollector(null).execute(); + vpcService.getVpnGatewayServiceConnection(null).execute(); } - // Test the listPrivatePathServiceGateways operation with a valid options model parameter + // Test the listVpnServers operation with a valid options model parameter @Test - public void testListPrivatePathServiceGatewaysWOptions() throws Throwable { + public void testListVpnServersWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"private_path_service_gateways\": [{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"default_access_policy\": \"deny\", \"endpoint_gateway_binding_auto_delete\": true, \"endpoint_gateway_binding_auto_delete_timeout\": 1, \"endpoint_gateway_count\": 0, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"lifecycle_state\": \"stable\", \"load_balancer\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"name\": \"my-load-balancer\", \"resource_type\": \"load_balancer\"}, \"name\": \"my-private-path-service-gateway\", \"published\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"private_path_service_gateway\", \"service_endpoints\": [\"*.example.com\"], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zonal_affinity\": false}], \"total_count\": 132}"; - String listPrivatePathServiceGatewaysPath = "/private_path_service_gateways"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132, \"vpn_servers\": [{\"certificate\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"client_authentication\": [{\"method\": \"certificate\", \"identity_provider\": {\"provider_type\": \"iam\"}}], \"client_auto_delete\": true, \"client_auto_delete_timeout\": 1, \"client_dns_server_ips\": [{\"address\": \"192.168.3.4\"}], \"client_idle_timeout\": 600, \"client_ip_pool\": \"172.16.0.0/16\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"enable_split_tunneling\": true, \"health_reasons\": [{\"code\": \"cannot_access_server_certificate\", \"message\": \"Failed to get VPN server's server certificate from Secrets Manager.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}], \"health_state\": \"ok\", \"hostname\": \"a8506291.us-south.vpn-server.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"id\": \"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-server\", \"port\": 443, \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"protocol\": \"tcp\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_server\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}]}"; + String listVpnServersPath = "/vpn_servers"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListPrivatePathServiceGatewaysOptions model - ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptionsModel = new ListPrivatePathServiceGatewaysOptions.Builder() + // Construct an instance of the ListVpnServersOptions model + ListVpnServersOptions listVpnServersOptionsModel = new ListVpnServersOptions.Builder() + .name("my-name") .start("testString") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .sort("name") .build(); - // Invoke listPrivatePathServiceGateways() with a valid options model and verify the result - Response response = vpcService.listPrivatePathServiceGateways(listPrivatePathServiceGatewaysOptionsModel).execute(); + // Invoke listVpnServers() with a valid options model and verify the result + Response response = vpcService.listVpnServers(listVpnServersOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGatewayCollection responseObj = response.getResult(); + VPNServerCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -32786,33 +34324,35 @@ public void testListPrivatePathServiceGatewaysWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listPrivatePathServiceGatewaysPath); + assertEquals(parsedPath, listVpnServersPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + assertEquals(query.get("name"), "my-name"); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); assertEquals(query.get("resource_group.id"), "testString"); + assertEquals(query.get("sort"), "name"); } - // Test the listPrivatePathServiceGateways operation with and without retries enabled + // Test the listVpnServers operation with and without retries enabled @Test - public void testListPrivatePathServiceGatewaysWRetries() throws Throwable { + public void testListVpnServersWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListPrivatePathServiceGatewaysWOptions(); + testListVpnServersWOptions(); vpcService.disableRetries(); - testListPrivatePathServiceGatewaysWOptions(); + testListVpnServersWOptions(); } - // Test the listPrivatePathServiceGateways operation using the PrivatePathServiceGatewaysPager.getNext() method + // Test the listVpnServers operation using the VpnServersPager.getNext() method @Test - public void testListPrivatePathServiceGatewaysWithPagerGetNext() throws Throwable { + public void testListVpnServersWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"private_path_service_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"default_access_policy\":\"deny\",\"endpoint_gateway_binding_auto_delete\":true,\"endpoint_gateway_binding_auto_delete_timeout\":1,\"endpoint_gateway_count\":0,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"lifecycle_state\":\"stable\",\"load_balancer\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"name\":\"my-load-balancer\",\"resource_type\":\"load_balancer\"},\"name\":\"my-private-path-service-gateway\",\"published\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"private_path_service_gateway\",\"service_endpoints\":[\"*.example.com\"],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zonal_affinity\":false}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"private_path_service_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"default_access_policy\":\"deny\",\"endpoint_gateway_binding_auto_delete\":true,\"endpoint_gateway_binding_auto_delete_timeout\":1,\"endpoint_gateway_count\":0,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"lifecycle_state\":\"stable\",\"load_balancer\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"name\":\"my-load-balancer\",\"resource_type\":\"load_balancer\"},\"name\":\"my-private-path-service-gateway\",\"published\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"private_path_service_gateway\",\"service_endpoints\":[\"*.example.com\"],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zonal_affinity\":false}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"enable_split_tunneling\":true,\"health_reasons\":[{\"code\":\"cannot_access_server_certificate\",\"message\":\"Failed to get VPN server's server certificate from Secrets Manager.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}],\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"id\":\"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"tcp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"enable_split_tunneling\":true,\"health_reasons\":[{\"code\":\"cannot_access_server_certificate\",\"message\":\"Failed to get VPN server's server certificate from Secrets Manager.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}],\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"id\":\"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"tcp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -32826,27 +34366,29 @@ public void testListPrivatePathServiceGatewaysWithPagerGetNext() throws Throwabl .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptions = new ListPrivatePathServiceGatewaysOptions.Builder() + ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() + .name("my-name") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .sort("name") .build(); - List allResults = new ArrayList<>(); - PrivatePathServiceGatewaysPager pager = new PrivatePathServiceGatewaysPager(vpcService, listPrivatePathServiceGatewaysOptions); + List allResults = new ArrayList<>(); + VpnServersPager pager = new VpnServersPager(vpcService, listVpnServersOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listPrivatePathServiceGateways operation using the PrivatePathServiceGatewaysPager.getAll() method + // Test the listVpnServers operation using the VpnServersPager.getAll() method @Test - public void testListPrivatePathServiceGatewaysWithPagerGetAll() throws Throwable { + public void testListVpnServersWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"private_path_service_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"default_access_policy\":\"deny\",\"endpoint_gateway_binding_auto_delete\":true,\"endpoint_gateway_binding_auto_delete_timeout\":1,\"endpoint_gateway_count\":0,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"lifecycle_state\":\"stable\",\"load_balancer\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"name\":\"my-load-balancer\",\"resource_type\":\"load_balancer\"},\"name\":\"my-private-path-service-gateway\",\"published\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"private_path_service_gateway\",\"service_endpoints\":[\"*.example.com\"],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zonal_affinity\":false}],\"total_count\":2,\"limit\":1}"; - String mockResponsePage2 = "{\"private_path_service_gateways\":[{\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"default_access_policy\":\"deny\",\"endpoint_gateway_binding_auto_delete\":true,\"endpoint_gateway_binding_auto_delete_timeout\":1,\"endpoint_gateway_count\":0,\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"lifecycle_state\":\"stable\",\"load_balancer\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"id\":\"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\",\"name\":\"my-load-balancer\",\"resource_type\":\"load_balancer\"},\"name\":\"my-private-path-service-gateway\",\"published\":false,\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"private_path_service_gateway\",\"service_endpoints\":[\"*.example.com\"],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"},\"zonal_affinity\":false}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"enable_split_tunneling\":true,\"health_reasons\":[{\"code\":\"cannot_access_server_certificate\",\"message\":\"Failed to get VPN server's server certificate from Secrets Manager.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}],\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"id\":\"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"tcp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"vpn_servers\":[{\"certificate\":{\"crn\":\"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"},\"client_authentication\":[{\"method\":\"certificate\",\"identity_provider\":{\"provider_type\":\"iam\"}}],\"client_auto_delete\":true,\"client_auto_delete_timeout\":1,\"client_dns_server_ips\":[{\"address\":\"192.168.3.4\"}],\"client_idle_timeout\":600,\"client_ip_pool\":\"172.16.0.0/16\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"enable_split_tunneling\":true,\"health_reasons\":[{\"code\":\"cannot_access_server_certificate\",\"message\":\"Failed to get VPN server's server certificate from Secrets Manager.\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}],\"health_state\":\"ok\",\"hostname\":\"a8506291.us-south.vpn-server.appdomain.cloud\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"id\":\"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-server\",\"port\":443,\"private_ips\":[{\"address\":\"192.168.3.4\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"id\":\"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\",\"name\":\"my-reserved-ip\",\"resource_type\":\"subnet_reserved_ip\"}],\"protocol\":\"tcp\",\"resource_group\":{\"href\":\"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\",\"id\":\"fee82deba12e4c0fb69c3b09d1f12345\",\"name\":\"my-resource-group\"},\"resource_type\":\"vpn_server\",\"security_groups\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"id\":\"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\",\"name\":\"my-security-group\"}],\"subnets\":[{\"crn\":\"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"id\":\"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\",\"name\":\"my-subnet\",\"resource_type\":\"subnet\"}],\"vpc\":{\"crn\":\"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"deleted\":{\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"},\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"id\":\"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\",\"name\":\"my-vpc\",\"resource_type\":\"vpc\"}}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -32860,31 +34402,54 @@ public void testListPrivatePathServiceGatewaysWithPagerGetAll() throws Throwable .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPrivatePathServiceGatewaysOptions listPrivatePathServiceGatewaysOptions = new ListPrivatePathServiceGatewaysOptions.Builder() + ListVpnServersOptions listVpnServersOptions = new ListVpnServersOptions.Builder() + .name("my-name") .limit(Long.valueOf("10")) .resourceGroupId("testString") + .sort("name") .build(); - PrivatePathServiceGatewaysPager pager = new PrivatePathServiceGatewaysPager(vpcService, listPrivatePathServiceGatewaysOptions); - List allResults = pager.getAll(); + VpnServersPager pager = new VpnServersPager(vpcService, listVpnServersOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the createPrivatePathServiceGateway operation with a valid options model parameter + // Test the createVpnServer operation with a valid options model parameter @Test - public void testCreatePrivatePathServiceGatewayWOptions() throws Throwable { + public void testCreateVpnServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"default_access_policy\": \"deny\", \"endpoint_gateway_binding_auto_delete\": true, \"endpoint_gateway_binding_auto_delete_timeout\": 1, \"endpoint_gateway_count\": 0, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"lifecycle_state\": \"stable\", \"load_balancer\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"name\": \"my-load-balancer\", \"resource_type\": \"load_balancer\"}, \"name\": \"my-private-path-service-gateway\", \"published\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"private_path_service_gateway\", \"service_endpoints\": [\"*.example.com\"], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zonal_affinity\": false}"; - String createPrivatePathServiceGatewayPath = "/private_path_service_gateways"; + String mockResponseBody = "{\"certificate\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"client_authentication\": [{\"method\": \"certificate\", \"identity_provider\": {\"provider_type\": \"iam\"}}], \"client_auto_delete\": true, \"client_auto_delete_timeout\": 1, \"client_dns_server_ips\": [{\"address\": \"192.168.3.4\"}], \"client_idle_timeout\": 600, \"client_ip_pool\": \"172.16.0.0/16\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"enable_split_tunneling\": true, \"health_reasons\": [{\"code\": \"cannot_access_server_certificate\", \"message\": \"Failed to get VPN server's server certificate from Secrets Manager.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}], \"health_state\": \"ok\", \"hostname\": \"a8506291.us-south.vpn-server.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"id\": \"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-server\", \"port\": 443, \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"protocol\": \"tcp\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_server\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String createVpnServerPath = "/vpn_servers"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerIdentityById model - LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() - .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + // Construct an instance of the CertificateInstanceIdentityByCRN model + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") + .build(); + + // Construct an instance of the VPNServerAuthenticationByUsernameIdProviderByIAM model + VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() + .providerType("iam") + .build(); + + // Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model + VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() + .method("username") + .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + // Construct an instance of the IP model + IP ipModel = new IP.Builder() + .address("192.168.3.4") .build(); // Construct an instance of the ResourceGroupIdentityById model @@ -32892,20 +34457,31 @@ public void testCreatePrivatePathServiceGatewayWOptions() throws Throwable { .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); - // Construct an instance of the CreatePrivatePathServiceGatewayOptions model - CreatePrivatePathServiceGatewayOptions createPrivatePathServiceGatewayOptionsModel = new CreatePrivatePathServiceGatewayOptions.Builder() - .loadBalancer(loadBalancerIdentityModel) - .serviceEndpoints(java.util.Arrays.asList("*.example.com")) - .defaultAccessPolicy("deny") - .name("my-private-path-service-gateway") + // Construct an instance of the SecurityGroupIdentityById model + SecurityGroupIdentityById securityGroupIdentityModel = new SecurityGroupIdentityById.Builder() + .id("r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271") + .build(); + + // Construct an instance of the CreateVpnServerOptions model + CreateVpnServerOptions createVpnServerOptionsModel = new CreateVpnServerOptions.Builder() + .certificate(certificateInstanceIdentityModel) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientIpPool("172.16.0.0/16") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) + .clientIdleTimeout(Long.valueOf("600")) + .enableSplitTunneling(false) + .name("my-vpn-server") + .port(Long.valueOf("443")) + .protocol("udp") .resourceGroup(resourceGroupIdentityModel) - .zonalAffinity(false) + .securityGroups(java.util.Arrays.asList(securityGroupIdentityModel)) .build(); - // Invoke createPrivatePathServiceGateway() with a valid options model and verify the result - Response response = vpcService.createPrivatePathServiceGateway(createPrivatePathServiceGatewayOptionsModel).execute(); + // Invoke createVpnServer() with a valid options model and verify the result + Response response = vpcService.createVpnServer(createVpnServerOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGateway responseObj = response.getResult(); + VPNServer responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -32914,48 +34490,49 @@ public void testCreatePrivatePathServiceGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createPrivatePathServiceGatewayPath); + assertEquals(parsedPath, createVpnServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the createPrivatePathServiceGateway operation with and without retries enabled + // Test the createVpnServer operation with and without retries enabled @Test - public void testCreatePrivatePathServiceGatewayWRetries() throws Throwable { + public void testCreateVpnServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testCreatePrivatePathServiceGatewayWOptions(); + testCreateVpnServerWOptions(); vpcService.disableRetries(); - testCreatePrivatePathServiceGatewayWOptions(); + testCreateVpnServerWOptions(); } - // Test the createPrivatePathServiceGateway operation with a null options model (negative test) + // Test the createVpnServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreatePrivatePathServiceGatewayNoOptions() throws Throwable { + public void testCreateVpnServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.createPrivatePathServiceGateway(null).execute(); + vpcService.createVpnServer(null).execute(); } - // Test the deletePrivatePathServiceGateway operation with a valid options model parameter + // Test the deleteVpnServer operation with a valid options model parameter @Test - public void testDeletePrivatePathServiceGatewayWOptions() throws Throwable { + public void testDeleteVpnServerWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deletePrivatePathServiceGatewayPath = "/private_path_service_gateways/testString"; + String deleteVpnServerPath = "/vpn_servers/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeletePrivatePathServiceGatewayOptions model - DeletePrivatePathServiceGatewayOptions deletePrivatePathServiceGatewayOptionsModel = new DeletePrivatePathServiceGatewayOptions.Builder() + // Construct an instance of the DeleteVpnServerOptions model + DeleteVpnServerOptions deleteVpnServerOptionsModel = new DeleteVpnServerOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke deletePrivatePathServiceGateway() with a valid options model and verify the result - Response response = vpcService.deletePrivatePathServiceGateway(deletePrivatePathServiceGatewayOptionsModel).execute(); + // Invoke deleteVpnServer() with a valid options model and verify the result + Response response = vpcService.deleteVpnServer(deleteVpnServerOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -32966,51 +34543,51 @@ public void testDeletePrivatePathServiceGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deletePrivatePathServiceGatewayPath); + assertEquals(parsedPath, deleteVpnServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deletePrivatePathServiceGateway operation with and without retries enabled + // Test the deleteVpnServer operation with and without retries enabled @Test - public void testDeletePrivatePathServiceGatewayWRetries() throws Throwable { + public void testDeleteVpnServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeletePrivatePathServiceGatewayWOptions(); + testDeleteVpnServerWOptions(); vpcService.disableRetries(); - testDeletePrivatePathServiceGatewayWOptions(); + testDeleteVpnServerWOptions(); } - // Test the deletePrivatePathServiceGateway operation with a null options model (negative test) + // Test the deleteVpnServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeletePrivatePathServiceGatewayNoOptions() throws Throwable { + public void testDeleteVpnServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deletePrivatePathServiceGateway(null).execute(); + vpcService.deleteVpnServer(null).execute(); } - // Test the getPrivatePathServiceGateway operation with a valid options model parameter + // Test the getVpnServer operation with a valid options model parameter @Test - public void testGetPrivatePathServiceGatewayWOptions() throws Throwable { + public void testGetVpnServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"default_access_policy\": \"deny\", \"endpoint_gateway_binding_auto_delete\": true, \"endpoint_gateway_binding_auto_delete_timeout\": 1, \"endpoint_gateway_count\": 0, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"lifecycle_state\": \"stable\", \"load_balancer\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"name\": \"my-load-balancer\", \"resource_type\": \"load_balancer\"}, \"name\": \"my-private-path-service-gateway\", \"published\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"private_path_service_gateway\", \"service_endpoints\": [\"*.example.com\"], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zonal_affinity\": false}"; - String getPrivatePathServiceGatewayPath = "/private_path_service_gateways/testString"; + String mockResponseBody = "{\"certificate\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"client_authentication\": [{\"method\": \"certificate\", \"identity_provider\": {\"provider_type\": \"iam\"}}], \"client_auto_delete\": true, \"client_auto_delete_timeout\": 1, \"client_dns_server_ips\": [{\"address\": \"192.168.3.4\"}], \"client_idle_timeout\": 600, \"client_ip_pool\": \"172.16.0.0/16\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"enable_split_tunneling\": true, \"health_reasons\": [{\"code\": \"cannot_access_server_certificate\", \"message\": \"Failed to get VPN server's server certificate from Secrets Manager.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}], \"health_state\": \"ok\", \"hostname\": \"a8506291.us-south.vpn-server.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"id\": \"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-server\", \"port\": 443, \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"protocol\": \"tcp\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_server\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String getVpnServerPath = "/vpn_servers/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetPrivatePathServiceGatewayOptions model - GetPrivatePathServiceGatewayOptions getPrivatePathServiceGatewayOptionsModel = new GetPrivatePathServiceGatewayOptions.Builder() + // Construct an instance of the GetVpnServerOptions model + GetVpnServerOptions getVpnServerOptionsModel = new GetVpnServerOptions.Builder() .id("testString") .build(); - // Invoke getPrivatePathServiceGateway() with a valid options model and verify the result - Response response = vpcService.getPrivatePathServiceGateway(getPrivatePathServiceGatewayOptionsModel).execute(); + // Invoke getVpnServer() with a valid options model and verify the result + Response response = vpcService.getVpnServer(getVpnServerOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGateway responseObj = response.getResult(); + VPNServer responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -33019,66 +34596,94 @@ public void testGetPrivatePathServiceGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getPrivatePathServiceGatewayPath); + assertEquals(parsedPath, getVpnServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getPrivatePathServiceGateway operation with and without retries enabled + // Test the getVpnServer operation with and without retries enabled @Test - public void testGetPrivatePathServiceGatewayWRetries() throws Throwable { + public void testGetVpnServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetPrivatePathServiceGatewayWOptions(); + testGetVpnServerWOptions(); vpcService.disableRetries(); - testGetPrivatePathServiceGatewayWOptions(); + testGetVpnServerWOptions(); } - // Test the getPrivatePathServiceGateway operation with a null options model (negative test) + // Test the getVpnServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetPrivatePathServiceGatewayNoOptions() throws Throwable { + public void testGetVpnServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getPrivatePathServiceGateway(null).execute(); + vpcService.getVpnServer(null).execute(); } - // Test the updatePrivatePathServiceGateway operation with a valid options model parameter + // Test the updateVpnServer operation with a valid options model parameter @Test - public void testUpdatePrivatePathServiceGatewayWOptions() throws Throwable { + public void testUpdateVpnServerWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::private-path-service-gateway:r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"default_access_policy\": \"deny\", \"endpoint_gateway_binding_auto_delete\": true, \"endpoint_gateway_binding_auto_delete_timeout\": 1, \"endpoint_gateway_count\": 0, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"lifecycle_state\": \"stable\", \"load_balancer\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::load-balancer:r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/load_balancers/r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"id\": \"r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727\", \"name\": \"my-load-balancer\", \"resource_type\": \"load_balancer\"}, \"name\": \"my-private-path-service-gateway\", \"published\": false, \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"private_path_service_gateway\", \"service_endpoints\": [\"*.example.com\"], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}, \"zonal_affinity\": false}"; - String updatePrivatePathServiceGatewayPath = "/private_path_service_gateways/testString"; + String mockResponseBody = "{\"certificate\": {\"crn\": \"crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5\"}, \"client_authentication\": [{\"method\": \"certificate\", \"identity_provider\": {\"provider_type\": \"iam\"}}], \"client_auto_delete\": true, \"client_auto_delete_timeout\": 1, \"client_dns_server_ips\": [{\"address\": \"192.168.3.4\"}], \"client_idle_timeout\": 600, \"client_ip_pool\": \"172.16.0.0/16\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpn-server:r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"enable_split_tunneling\": true, \"health_reasons\": [{\"code\": \"cannot_access_server_certificate\", \"message\": \"Failed to get VPN server's server certificate from Secrets Manager.\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-health\"}], \"health_state\": \"ok\", \"hostname\": \"a8506291.us-south.vpn-server.appdomain.cloud\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"id\": \"r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-server\", \"port\": 443, \"private_ips\": [{\"address\": \"192.168.3.4\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"id\": \"0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb\", \"name\": \"my-reserved-ip\", \"resource_type\": \"subnet_reserved_ip\"}], \"protocol\": \"tcp\", \"resource_group\": {\"href\": \"https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345\", \"id\": \"fee82deba12e4c0fb69c3b09d1f12345\", \"name\": \"my-resource-group\"}, \"resource_type\": \"vpn_server\", \"security_groups\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::security-group:r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"id\": \"r006-be5df5ca-12a0-494b-907e-aa6ec2bfa271\", \"name\": \"my-security-group\"}], \"subnets\": [{\"crn\": \"crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::subnet:0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"id\": \"0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e\", \"name\": \"my-subnet\", \"resource_type\": \"subnet\"}], \"vpc\": {\"crn\": \"crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"deleted\": {\"more_info\": \"https://cloud.ibm.com/apidocs/vpc#deleted-resources\"}, \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpcs/r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"id\": \"r006-4727d842-f94f-4a2d-824a-9bc9b02c523b\", \"name\": \"my-vpc\", \"resource_type\": \"vpc\"}}"; + String updateVpnServerPath = "/vpn_servers/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the LoadBalancerIdentityById model - LoadBalancerIdentityById loadBalancerIdentityModel = new LoadBalancerIdentityById.Builder() - .id("r006-dd754295-e9e0-4c9d-bf6c-58fbc59e5727") + // Construct an instance of the CertificateInstanceIdentityByCRN model + CertificateInstanceIdentityByCRN certificateInstanceIdentityModel = new CertificateInstanceIdentityByCRN.Builder() + .crn("crn:v1:bluemix:public:secrets-manager:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:36fa422d-080d-4d83-8d2d-86851b4001df:secret:2e786aab-42fa-63ed-14f8-d66d552f4dd5") .build(); - // Construct an instance of the PrivatePathServiceGatewayPatch model - PrivatePathServiceGatewayPatch privatePathServiceGatewayPatchModel = new PrivatePathServiceGatewayPatch.Builder() - .defaultAccessPolicy("deny") - .loadBalancer(loadBalancerIdentityModel) - .name("my-private-path-service-gateway") - .zonalAffinity(true) + // Construct an instance of the VPNServerAuthenticationByUsernameIdProviderByIAM model + VPNServerAuthenticationByUsernameIdProviderByIAM vpnServerAuthenticationByUsernameIdProviderModel = new VPNServerAuthenticationByUsernameIdProviderByIAM.Builder() + .providerType("iam") .build(); - Map privatePathServiceGatewayPatchModelAsPatch = privatePathServiceGatewayPatchModel.asPatch(); - // Construct an instance of the UpdatePrivatePathServiceGatewayOptions model - UpdatePrivatePathServiceGatewayOptions updatePrivatePathServiceGatewayOptionsModel = new UpdatePrivatePathServiceGatewayOptions.Builder() + // Construct an instance of the VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype model + VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype vpnServerAuthenticationPrototypeModel = new VPNServerAuthenticationPrototypeVPNServerAuthenticationByUsernamePrototype.Builder() + .method("username") + .identityProvider(vpnServerAuthenticationByUsernameIdProviderModel) + .build(); + + // Construct an instance of the IP model + IP ipModel = new IP.Builder() + .address("192.168.3.4") + .build(); + + // Construct an instance of the SubnetIdentityById model + SubnetIdentityById subnetIdentityModel = new SubnetIdentityById.Builder() + .id("0717-7ec86020-1c6e-4889-b3f0-a15f2e50f87e") + .build(); + + // Construct an instance of the VPNServerPatch model + VPNServerPatch vpnServerPatchModel = new VPNServerPatch.Builder() + .certificate(certificateInstanceIdentityModel) + .clientAuthentication(java.util.Arrays.asList(vpnServerAuthenticationPrototypeModel)) + .clientDnsServerIps(java.util.Arrays.asList(ipModel)) + .clientIdleTimeout(Long.valueOf("600")) + .clientIpPool("172.16.0.0/16") + .enableSplitTunneling(true) + .name("my-vpn-server-updated") + .port(Long.valueOf("443")) + .protocol("tcp") + .subnets(java.util.Arrays.asList(subnetIdentityModel)) + .build(); + Map vpnServerPatchModelAsPatch = vpnServerPatchModel.asPatch(); + + // Construct an instance of the UpdateVpnServerOptions model + UpdateVpnServerOptions updateVpnServerOptionsModel = new UpdateVpnServerOptions.Builder() .id("testString") - .privatePathServiceGatewayPatch(privatePathServiceGatewayPatchModelAsPatch) + .vpnServerPatch(vpnServerPatchModelAsPatch) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); - // Invoke updatePrivatePathServiceGateway() with a valid options model and verify the result - Response response = vpcService.updatePrivatePathServiceGateway(updatePrivatePathServiceGatewayOptionsModel).execute(); + // Invoke updateVpnServer() with a valid options model and verify the result + Response response = vpcService.updateVpnServer(updateVpnServerOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGateway responseObj = response.getResult(); + VPNServer responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -33087,54 +34692,107 @@ public void testUpdatePrivatePathServiceGatewayWOptions() throws Throwable { assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updatePrivatePathServiceGatewayPath); + assertEquals(parsedPath, updateVpnServerPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updatePrivatePathServiceGateway operation with and without retries enabled + // Test the updateVpnServer operation with and without retries enabled @Test - public void testUpdatePrivatePathServiceGatewayWRetries() throws Throwable { + public void testUpdateVpnServerWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdatePrivatePathServiceGatewayWOptions(); + testUpdateVpnServerWOptions(); vpcService.disableRetries(); - testUpdatePrivatePathServiceGatewayWOptions(); + testUpdateVpnServerWOptions(); } - // Test the updatePrivatePathServiceGateway operation with a null options model (negative test) + // Test the updateVpnServer operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdatePrivatePathServiceGatewayNoOptions() throws Throwable { + public void testUpdateVpnServerNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updatePrivatePathServiceGateway(null).execute(); + vpcService.updateVpnServer(null).execute(); } - // Test the listPrivatePathServiceGatewayAccountPolicies operation with a valid options model parameter + // Test the getVpnServerClientConfiguration operation with a valid options model parameter @Test - public void testListPrivatePathServiceGatewayAccountPoliciesWOptions() throws Throwable { + public void testGetVpnServerClientConfigurationWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"account_policies\": [{\"access_policy\": \"deny\", \"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"resource_type\": \"private_path_service_gateway_account_policy\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listPrivatePathServiceGatewayAccountPoliciesPath = "/private_path_service_gateways/testString/account_policies"; + String mockResponseBody = "\"client\nproto udp\nremote a8506291.us-south.vpn-server.appdomain.cloud\nport 443\n\ndev tun\nnobind\n\n-----BEGIN CERTIFICATE-----\nxxxxxx\n-----END CERTIFICATE-----\n\""; + String getVpnServerClientConfigurationPath = "/vpn_servers/testString/client_configuration"; + server.enqueue(new MockResponse() + .setHeader("Content-type", "text/plain") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetVpnServerClientConfigurationOptions model + GetVpnServerClientConfigurationOptions getVpnServerClientConfigurationOptionsModel = new GetVpnServerClientConfigurationOptions.Builder() + .id("testString") + .build(); + + // Invoke getVpnServerClientConfiguration() with a valid options model and verify the result + Response response = vpcService.getVpnServerClientConfiguration(getVpnServerClientConfigurationOptionsModel).execute(); + assertNotNull(response); + String responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getVpnServerClientConfigurationPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), version); + assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); + } + + // Test the getVpnServerClientConfiguration operation with and without retries enabled + @Test + public void testGetVpnServerClientConfigurationWRetries() throws Throwable { + vpcService.enableRetries(4, 30); + testGetVpnServerClientConfigurationWOptions(); + + vpcService.disableRetries(); + testGetVpnServerClientConfigurationWOptions(); + } + + // Test the getVpnServerClientConfiguration operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetVpnServerClientConfigurationNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + vpcService.getVpnServerClientConfiguration(null).execute(); + } + + // Test the listVpnServerClients operation with a valid options model parameter + @Test + public void testListVpnServerClientsWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"clients\": [{\"client_ip\": {\"address\": \"192.168.3.4\"}, \"common_name\": \"commonName\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"disconnected_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\", \"id\": \"r006-b37832e2-7abe-4b20-a292-c70b007569c6\", \"remote_ip\": {\"address\": \"192.168.3.4\"}, \"remote_port\": 22, \"resource_type\": \"vpn_server_client\", \"status\": \"connected\", \"username\": \"username\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; + String listVpnServerClientsPath = "/vpn_servers/testString/clients"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListPrivatePathServiceGatewayAccountPoliciesOptions model - ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptionsModel = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() - .privatePathServiceGatewayId("testString") + // Construct an instance of the ListVpnServerClientsOptions model + ListVpnServerClientsOptions listVpnServerClientsOptionsModel = new ListVpnServerClientsOptions.Builder() + .vpnServerId("testString") .start("testString") .limit(Long.valueOf("10")) - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("created_at") .build(); - // Invoke listPrivatePathServiceGatewayAccountPolicies() with a valid options model and verify the result - Response response = vpcService.listPrivatePathServiceGatewayAccountPolicies(listPrivatePathServiceGatewayAccountPoliciesOptionsModel).execute(); + // Invoke listVpnServerClients() with a valid options model and verify the result + Response response = vpcService.listVpnServerClients(listVpnServerClientsOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGatewayAccountPolicyCollection responseObj = response.getResult(); + VPNServerClientCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -33143,40 +34801,40 @@ public void testListPrivatePathServiceGatewayAccountPoliciesWOptions() throws Th assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listPrivatePathServiceGatewayAccountPoliciesPath); + assertEquals(parsedPath, listVpnServerClientsPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("account.id"), "bb1b52262f7441a586f49068482f1e60"); + assertEquals(query.get("sort"), "created_at"); } - // Test the listPrivatePathServiceGatewayAccountPolicies operation with and without retries enabled + // Test the listVpnServerClients operation with and without retries enabled @Test - public void testListPrivatePathServiceGatewayAccountPoliciesWRetries() throws Throwable { + public void testListVpnServerClientsWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListPrivatePathServiceGatewayAccountPoliciesWOptions(); + testListVpnServerClientsWOptions(); vpcService.disableRetries(); - testListPrivatePathServiceGatewayAccountPoliciesWOptions(); + testListVpnServerClientsWOptions(); } - // Test the listPrivatePathServiceGatewayAccountPolicies operation with a null options model (negative test) + // Test the listVpnServerClients operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListPrivatePathServiceGatewayAccountPoliciesNoOptions() throws Throwable { + public void testListVpnServerClientsNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listPrivatePathServiceGatewayAccountPolicies(null).execute(); + vpcService.listVpnServerClients(null).execute(); } - // Test the listPrivatePathServiceGatewayAccountPolicies operation using the PrivatePathServiceGatewayAccountPoliciesPager.getNext() method + // Test the listVpnServerClients operation using the VpnServerClientsPager.getNext() method @Test - public void testListPrivatePathServiceGatewayAccountPoliciesWithPagerGetNext() throws Throwable { + public void testListVpnServerClientsWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"account_policies\":[{\"access_policy\":\"deny\",\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"resource_type\":\"private_path_service_gateway_account_policy\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"account_policies\":[{\"access_policy\":\"deny\",\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"resource_type\":\"private_path_service_gateway_account_policy\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"id\":\"r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"id\":\"r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -33190,131 +34848,71 @@ public void testListPrivatePathServiceGatewayAccountPoliciesWithPagerGetNext() t .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptions = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() - .privatePathServiceGatewayId("testString") + ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() + .vpnServerId("testString") .limit(Long.valueOf("10")) - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("created_at") .build(); - List allResults = new ArrayList<>(); - PrivatePathServiceGatewayAccountPoliciesPager pager = new PrivatePathServiceGatewayAccountPoliciesPager(vpcService, listPrivatePathServiceGatewayAccountPoliciesOptions); + List allResults = new ArrayList<>(); + VpnServerClientsPager pager = new VpnServerClientsPager(vpcService, listVpnServerClientsOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listPrivatePathServiceGatewayAccountPolicies operation using the PrivatePathServiceGatewayAccountPoliciesPager.getAll() method + // Test the listVpnServerClients operation using the VpnServerClientsPager.getAll() method @Test - public void testListPrivatePathServiceGatewayAccountPoliciesWithPagerGetAll() throws Throwable { + public void testListVpnServerClientsWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"account_policies\":[{\"access_policy\":\"deny\",\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"resource_type\":\"private_path_service_gateway_account_policy\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"account_policies\":[{\"access_policy\":\"deny\",\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\",\"id\":\"r006-7268d425-59b7-48fd-9735-81a7271657d5\",\"resource_type\":\"private_path_service_gateway_account_policy\"}]}"; - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage1)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponsePage2)); - server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(400) - .setBody("{\"message\": \"No more results available!\"}")); - - ListPrivatePathServiceGatewayAccountPoliciesOptions listPrivatePathServiceGatewayAccountPoliciesOptions = new ListPrivatePathServiceGatewayAccountPoliciesOptions.Builder() - .privatePathServiceGatewayId("testString") - .limit(Long.valueOf("10")) - .accountId("bb1b52262f7441a586f49068482f1e60") - .build(); - - PrivatePathServiceGatewayAccountPoliciesPager pager = new PrivatePathServiceGatewayAccountPoliciesPager(vpcService, listPrivatePathServiceGatewayAccountPoliciesOptions); - List allResults = pager.getAll(); - assertNotNull(allResults); - assertEquals(allResults.size(), 2); - } - - // Test the createPrivatePathServiceGatewayAccountPolicy operation with a valid options model parameter - @Test - public void testCreatePrivatePathServiceGatewayAccountPolicyWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"access_policy\": \"deny\", \"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"resource_type\": \"private_path_service_gateway_account_policy\"}"; - String createPrivatePathServiceGatewayAccountPolicyPath = "/private_path_service_gateways/testString/account_policies"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"id\":\"r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"clients\":[{\"client_ip\":{\"address\":\"192.168.3.4\"},\"common_name\":\"commonName\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"disconnected_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"id\":\"r006-b37832e2-7abe-4b20-a292-c70b007569c6\",\"remote_ip\":{\"address\":\"192.168.3.4\"},\"remote_port\":22,\"resource_type\":\"vpn_server_client\",\"status\":\"connected\",\"username\":\"username\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the AccountIdentityById model - AccountIdentityById accountIdentityModel = new AccountIdentityById.Builder() - .id("bb1b52262f7441a586f49068482f1e60") - .build(); - - // Construct an instance of the CreatePrivatePathServiceGatewayAccountPolicyOptions model - CreatePrivatePathServiceGatewayAccountPolicyOptions createPrivatePathServiceGatewayAccountPolicyOptionsModel = new CreatePrivatePathServiceGatewayAccountPolicyOptions.Builder() - .privatePathServiceGatewayId("testString") - .accessPolicy("deny") - .account(accountIdentityModel) - .build(); - - // Invoke createPrivatePathServiceGatewayAccountPolicy() with a valid options model and verify the result - Response response = vpcService.createPrivatePathServiceGatewayAccountPolicy(createPrivatePathServiceGatewayAccountPolicyOptionsModel).execute(); - assertNotNull(response); - PrivatePathServiceGatewayAccountPolicy responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createPrivatePathServiceGatewayAccountPolicyPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the createPrivatePathServiceGatewayAccountPolicy operation with and without retries enabled - @Test - public void testCreatePrivatePathServiceGatewayAccountPolicyWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testCreatePrivatePathServiceGatewayAccountPolicyWOptions(); + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage1)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponsePage2)); + server.enqueue(new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(400) + .setBody("{\"message\": \"No more results available!\"}")); - vpcService.disableRetries(); - testCreatePrivatePathServiceGatewayAccountPolicyWOptions(); - } + ListVpnServerClientsOptions listVpnServerClientsOptions = new ListVpnServerClientsOptions.Builder() + .vpnServerId("testString") + .limit(Long.valueOf("10")) + .sort("created_at") + .build(); - // Test the createPrivatePathServiceGatewayAccountPolicy operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreatePrivatePathServiceGatewayAccountPolicyNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.createPrivatePathServiceGatewayAccountPolicy(null).execute(); + VpnServerClientsPager pager = new VpnServerClientsPager(vpcService, listVpnServerClientsOptions); + List allResults = pager.getAll(); + assertNotNull(allResults); + assertEquals(allResults.size(), 2); } - - // Test the deletePrivatePathServiceGatewayAccountPolicy operation with a valid options model parameter + + // Test the deleteVpnServerClient operation with a valid options model parameter @Test - public void testDeletePrivatePathServiceGatewayAccountPolicyWOptions() throws Throwable { + public void testDeleteVpnServerClientWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String deletePrivatePathServiceGatewayAccountPolicyPath = "/private_path_service_gateways/testString/account_policies/testString"; + String deleteVpnServerClientPath = "/vpn_servers/testString/clients/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the DeletePrivatePathServiceGatewayAccountPolicyOptions model - DeletePrivatePathServiceGatewayAccountPolicyOptions deletePrivatePathServiceGatewayAccountPolicyOptionsModel = new DeletePrivatePathServiceGatewayAccountPolicyOptions.Builder() - .privatePathServiceGatewayId("testString") + // Construct an instance of the DeleteVpnServerClientOptions model + DeleteVpnServerClientOptions deleteVpnServerClientOptionsModel = new DeleteVpnServerClientOptions.Builder() + .vpnServerId("testString") .id("testString") .build(); - // Invoke deletePrivatePathServiceGatewayAccountPolicy() with a valid options model and verify the result - Response response = vpcService.deletePrivatePathServiceGatewayAccountPolicy(deletePrivatePathServiceGatewayAccountPolicyOptionsModel).execute(); + // Invoke deleteVpnServerClient() with a valid options model and verify the result + Response response = vpcService.deleteVpnServerClient(deleteVpnServerClientOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -33325,52 +34923,52 @@ public void testDeletePrivatePathServiceGatewayAccountPolicyWOptions() throws Th assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deletePrivatePathServiceGatewayAccountPolicyPath); + assertEquals(parsedPath, deleteVpnServerClientPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the deletePrivatePathServiceGatewayAccountPolicy operation with and without retries enabled + // Test the deleteVpnServerClient operation with and without retries enabled @Test - public void testDeletePrivatePathServiceGatewayAccountPolicyWRetries() throws Throwable { + public void testDeleteVpnServerClientWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDeletePrivatePathServiceGatewayAccountPolicyWOptions(); + testDeleteVpnServerClientWOptions(); vpcService.disableRetries(); - testDeletePrivatePathServiceGatewayAccountPolicyWOptions(); + testDeleteVpnServerClientWOptions(); } - // Test the deletePrivatePathServiceGatewayAccountPolicy operation with a null options model (negative test) + // Test the deleteVpnServerClient operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeletePrivatePathServiceGatewayAccountPolicyNoOptions() throws Throwable { + public void testDeleteVpnServerClientNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.deletePrivatePathServiceGatewayAccountPolicy(null).execute(); + vpcService.deleteVpnServerClient(null).execute(); } - // Test the getPrivatePathServiceGatewayAccountPolicy operation with a valid options model parameter + // Test the getVpnServerClient operation with a valid options model parameter @Test - public void testGetPrivatePathServiceGatewayAccountPolicyWOptions() throws Throwable { + public void testGetVpnServerClientWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_policy\": \"deny\", \"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"resource_type\": \"private_path_service_gateway_account_policy\"}"; - String getPrivatePathServiceGatewayAccountPolicyPath = "/private_path_service_gateways/testString/account_policies/testString"; + String mockResponseBody = "{\"client_ip\": {\"address\": \"192.168.3.4\"}, \"common_name\": \"commonName\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"disconnected_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/clients/r006-b37832e2-7abe-4b20-a292-c70b007569c6\", \"id\": \"r006-b37832e2-7abe-4b20-a292-c70b007569c6\", \"remote_ip\": {\"address\": \"192.168.3.4\"}, \"remote_port\": 22, \"resource_type\": \"vpn_server_client\", \"status\": \"connected\", \"username\": \"username\"}"; + String getVpnServerClientPath = "/vpn_servers/testString/clients/testString"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the GetPrivatePathServiceGatewayAccountPolicyOptions model - GetPrivatePathServiceGatewayAccountPolicyOptions getPrivatePathServiceGatewayAccountPolicyOptionsModel = new GetPrivatePathServiceGatewayAccountPolicyOptions.Builder() - .privatePathServiceGatewayId("testString") + // Construct an instance of the GetVpnServerClientOptions model + GetVpnServerClientOptions getVpnServerClientOptionsModel = new GetVpnServerClientOptions.Builder() + .vpnServerId("testString") .id("testString") .build(); - // Invoke getPrivatePathServiceGatewayAccountPolicy() with a valid options model and verify the result - Response response = vpcService.getPrivatePathServiceGatewayAccountPolicy(getPrivatePathServiceGatewayAccountPolicyOptionsModel).execute(); + // Invoke getVpnServerClient() with a valid options model and verify the result + Response response = vpcService.getVpnServerClient(getVpnServerClientOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGatewayAccountPolicy responseObj = response.getResult(); + VPNServerClient responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -33379,116 +34977,107 @@ public void testGetPrivatePathServiceGatewayAccountPolicyWOptions() throws Throw assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getPrivatePathServiceGatewayAccountPolicyPath); + assertEquals(parsedPath, getVpnServerClientPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the getPrivatePathServiceGatewayAccountPolicy operation with and without retries enabled + // Test the getVpnServerClient operation with and without retries enabled @Test - public void testGetPrivatePathServiceGatewayAccountPolicyWRetries() throws Throwable { + public void testGetVpnServerClientWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testGetPrivatePathServiceGatewayAccountPolicyWOptions(); + testGetVpnServerClientWOptions(); vpcService.disableRetries(); - testGetPrivatePathServiceGatewayAccountPolicyWOptions(); + testGetVpnServerClientWOptions(); } - // Test the getPrivatePathServiceGatewayAccountPolicy operation with a null options model (negative test) + // Test the getVpnServerClient operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetPrivatePathServiceGatewayAccountPolicyNoOptions() throws Throwable { + public void testGetVpnServerClientNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.getPrivatePathServiceGatewayAccountPolicy(null).execute(); + vpcService.getVpnServerClient(null).execute(); } - // Test the updatePrivatePathServiceGatewayAccountPolicy operation with a valid options model parameter + // Test the disconnectVpnClient operation with a valid options model parameter @Test - public void testUpdatePrivatePathServiceGatewayAccountPolicyWOptions() throws Throwable { + public void testDisconnectVpnClientWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"access_policy\": \"deny\", \"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/account_policies/dd455384-b019-4242-9453-45fe68b18e4c\", \"id\": \"r006-7268d425-59b7-48fd-9735-81a7271657d5\", \"resource_type\": \"private_path_service_gateway_account_policy\"}"; - String updatePrivatePathServiceGatewayAccountPolicyPath = "/private_path_service_gateways/testString/account_policies/testString"; + String mockResponseBody = ""; + String disconnectVpnClientPath = "/vpn_servers/testString/clients/testString/disconnect"; server.enqueue(new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the PrivatePathServiceGatewayAccountPolicyPatch model - PrivatePathServiceGatewayAccountPolicyPatch privatePathServiceGatewayAccountPolicyPatchModel = new PrivatePathServiceGatewayAccountPolicyPatch.Builder() - .accessPolicy("review") - .build(); - Map privatePathServiceGatewayAccountPolicyPatchModelAsPatch = privatePathServiceGatewayAccountPolicyPatchModel.asPatch(); - - // Construct an instance of the UpdatePrivatePathServiceGatewayAccountPolicyOptions model - UpdatePrivatePathServiceGatewayAccountPolicyOptions updatePrivatePathServiceGatewayAccountPolicyOptionsModel = new UpdatePrivatePathServiceGatewayAccountPolicyOptions.Builder() - .privatePathServiceGatewayId("testString") + // Construct an instance of the DisconnectVpnClientOptions model + DisconnectVpnClientOptions disconnectVpnClientOptionsModel = new DisconnectVpnClientOptions.Builder() + .vpnServerId("testString") .id("testString") - .privatePathServiceGatewayAccountPolicyPatch(privatePathServiceGatewayAccountPolicyPatchModelAsPatch) .build(); - // Invoke updatePrivatePathServiceGatewayAccountPolicy() with a valid options model and verify the result - Response response = vpcService.updatePrivatePathServiceGatewayAccountPolicy(updatePrivatePathServiceGatewayAccountPolicyOptionsModel).execute(); + // Invoke disconnectVpnClient() with a valid options model and verify the result + Response response = vpcService.disconnectVpnClient(disconnectVpnClientOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGatewayAccountPolicy responseObj = response.getResult(); - assertNotNull(responseObj); + Void responseObj = response.getResult(); + assertNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "PATCH"); + assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updatePrivatePathServiceGatewayAccountPolicyPath); + assertEquals(parsedPath, disconnectVpnClientPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the updatePrivatePathServiceGatewayAccountPolicy operation with and without retries enabled + // Test the disconnectVpnClient operation with and without retries enabled @Test - public void testUpdatePrivatePathServiceGatewayAccountPolicyWRetries() throws Throwable { + public void testDisconnectVpnClientWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUpdatePrivatePathServiceGatewayAccountPolicyWOptions(); + testDisconnectVpnClientWOptions(); vpcService.disableRetries(); - testUpdatePrivatePathServiceGatewayAccountPolicyWOptions(); + testDisconnectVpnClientWOptions(); } - // Test the updatePrivatePathServiceGatewayAccountPolicy operation with a null options model (negative test) + // Test the disconnectVpnClient operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdatePrivatePathServiceGatewayAccountPolicyNoOptions() throws Throwable { + public void testDisconnectVpnClientNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.updatePrivatePathServiceGatewayAccountPolicy(null).execute(); + vpcService.disconnectVpnClient(null).execute(); } - // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation with a valid options model parameter + // Test the listVpnServerRoutes operation with a valid options model parameter @Test - public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWOptions() throws Throwable { + public void testListVpnServerRoutesWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"endpoint_gateway_bindings\": [{\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\", \"id\": \"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\", \"lifecycle_state\": \"stable\", \"resource_type\": \"private_path_service_gateway_endpoint_gateway_binding\", \"status\": \"abandoned\"}], \"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"total_count\": 132}"; - String listPrivatePathServiceGatewayEndpointGatewayBindingsPath = "/private_path_service_gateways/testString/endpoint_gateway_bindings"; + String mockResponseBody = "{\"first\": {\"href\": \"href\"}, \"limit\": 20, \"next\": {\"href\": \"href\"}, \"routes\": [{\"action\": \"deliver\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"health_reasons\": [{\"code\": \"internal_error\", \"message\": \"Internal error (contact IBM support).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-route-1\", \"resource_type\": \"vpn_server_route\"}], \"total_count\": 132}"; + String listVpnServerRoutesPath = "/vpn_servers/testString/routes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions model - ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() - .privatePathServiceGatewayId("testString") + // Construct an instance of the ListVpnServerRoutesOptions model + ListVpnServerRoutesOptions listVpnServerRoutesOptionsModel = new ListVpnServerRoutesOptions.Builder() + .vpnServerId("testString") .start("testString") .limit(Long.valueOf("10")) - .status("abandoned") - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("name") .build(); - // Invoke listPrivatePathServiceGatewayEndpointGatewayBindings() with a valid options model and verify the result - Response response = vpcService.listPrivatePathServiceGatewayEndpointGatewayBindings(listPrivatePathServiceGatewayEndpointGatewayBindingsOptionsModel).execute(); + // Invoke listVpnServerRoutes() with a valid options model and verify the result + Response response = vpcService.listVpnServerRoutes(listVpnServerRoutesOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGatewayEndpointGatewayBindingCollection responseObj = response.getResult(); + VPNServerRouteCollection responseObj = response.getResult(); assertNotNull(responseObj); // Verify the contents of the request sent to the mock server @@ -33497,41 +35086,40 @@ public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWOptions() t assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listPrivatePathServiceGatewayEndpointGatewayBindingsPath); + assertEquals(parsedPath, listVpnServerRoutesPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); assertEquals(query.get("start"), "testString"); assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("10")); - assertEquals(query.get("status"), "abandoned"); - assertEquals(query.get("account.id"), "bb1b52262f7441a586f49068482f1e60"); + assertEquals(query.get("sort"), "name"); } - // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation with and without retries enabled + // Test the listVpnServerRoutes operation with and without retries enabled @Test - public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWRetries() throws Throwable { + public void testListVpnServerRoutesWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testListPrivatePathServiceGatewayEndpointGatewayBindingsWOptions(); + testListVpnServerRoutesWOptions(); vpcService.disableRetries(); - testListPrivatePathServiceGatewayEndpointGatewayBindingsWOptions(); + testListVpnServerRoutesWOptions(); } - // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation with a null options model (negative test) + // Test the listVpnServerRoutes operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testListPrivatePathServiceGatewayEndpointGatewayBindingsNoOptions() throws Throwable { + public void testListVpnServerRoutesNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.listPrivatePathServiceGatewayEndpointGatewayBindings(null).execute(); + vpcService.listVpnServerRoutes(null).execute(); } - // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation using the PrivatePathServiceGatewayEndpointGatewayBindingsPager.getNext() method + // Test the listVpnServerRoutes operation using the VpnServerRoutesPager.getNext() method @Test - public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWithPagerGetNext() throws Throwable { + public void testListVpnServerRoutesWithPagerGetNext() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"endpoint_gateway_bindings\":[{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"id\":\"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"lifecycle_state\":\"stable\",\"resource_type\":\"private_path_service_gateway_endpoint_gateway_binding\",\"status\":\"abandoned\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"endpoint_gateway_bindings\":[{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"id\":\"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"lifecycle_state\":\"stable\",\"resource_type\":\"private_path_service_gateway_endpoint_gateway_binding\",\"status\":\"abandoned\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"health_reasons\":[{\"code\":\"internal_error\",\"message\":\"Internal error (contact IBM support).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"health_reasons\":[{\"code\":\"internal_error\",\"message\":\"Internal error (contact IBM support).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -33545,29 +35133,28 @@ public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWithPagerGet .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptions = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() - .privatePathServiceGatewayId("testString") + ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() + .vpnServerId("testString") .limit(Long.valueOf("10")) - .status("abandoned") - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("name") .build(); - List allResults = new ArrayList<>(); - PrivatePathServiceGatewayEndpointGatewayBindingsPager pager = new PrivatePathServiceGatewayEndpointGatewayBindingsPager(vpcService, listPrivatePathServiceGatewayEndpointGatewayBindingsOptions); + List allResults = new ArrayList<>(); + VpnServerRoutesPager pager = new VpnServerRoutesPager(vpcService, listVpnServerRoutesOptions); while (pager.hasNext()) { - List nextPage = pager.getNext(); + List nextPage = pager.getNext(); assertNotNull(nextPage); allResults.addAll(nextPage); } assertEquals(allResults.size(), 2); } - // Test the listPrivatePathServiceGatewayEndpointGatewayBindings operation using the PrivatePathServiceGatewayEndpointGatewayBindingsPager.getAll() method + // Test the listVpnServerRoutes operation using the VpnServerRoutesPager.getAll() method @Test - public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWithPagerGetAll() throws Throwable { + public void testListVpnServerRoutesWithPagerGetAll() throws Throwable { // Set up the two-page mock response. - String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"total_count\":2,\"limit\":1,\"endpoint_gateway_bindings\":[{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"id\":\"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"lifecycle_state\":\"stable\",\"resource_type\":\"private_path_service_gateway_endpoint_gateway_binding\",\"status\":\"abandoned\"}]}"; - String mockResponsePage2 = "{\"total_count\":2,\"limit\":1,\"endpoint_gateway_bindings\":[{\"account\":{\"id\":\"bb1b52262f7441a586f49068482f1e60\",\"resource_type\":\"account\"},\"created_at\":\"2019-01-01T12:00:00.000Z\",\"expiration_at\":\"2019-01-01T12:00:00.000Z\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"id\":\"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\",\"lifecycle_state\":\"stable\",\"resource_type\":\"private_path_service_gateway_endpoint_gateway_binding\",\"status\":\"abandoned\"}]}"; + String mockResponsePage1 = "{\"next\":{\"href\":\"https://myhost.com/somePath?start=1\"},\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"health_reasons\":[{\"code\":\"internal_error\",\"message\":\"Internal error (contact IBM support).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; + String mockResponsePage2 = "{\"routes\":[{\"action\":\"deliver\",\"created_at\":\"2019-01-01T12:00:00.000Z\",\"destination\":\"192.168.3.0/24\",\"health_reasons\":[{\"code\":\"internal_error\",\"message\":\"Internal error (contact IBM support).\",\"more_info\":\"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}],\"health_state\":\"ok\",\"href\":\"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"id\":\"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\",\"lifecycle_reasons\":[{\"code\":\"resource_suspended_by_provider\",\"message\":\"The resource has been suspended. Contact IBM support with the CRN for next steps.\",\"more_info\":\"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}],\"lifecycle_state\":\"stable\",\"name\":\"my-vpn-route-1\",\"resource_type\":\"vpn_server_route\"}],\"total_count\":2,\"limit\":1}"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") .setResponseCode(200) @@ -33581,146 +35168,92 @@ public void testListPrivatePathServiceGatewayEndpointGatewayBindingsWithPagerGet .setResponseCode(400) .setBody("{\"message\": \"No more results available!\"}")); - ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions listPrivatePathServiceGatewayEndpointGatewayBindingsOptions = new ListPrivatePathServiceGatewayEndpointGatewayBindingsOptions.Builder() - .privatePathServiceGatewayId("testString") + ListVpnServerRoutesOptions listVpnServerRoutesOptions = new ListVpnServerRoutesOptions.Builder() + .vpnServerId("testString") .limit(Long.valueOf("10")) - .status("abandoned") - .accountId("bb1b52262f7441a586f49068482f1e60") + .sort("name") .build(); - PrivatePathServiceGatewayEndpointGatewayBindingsPager pager = new PrivatePathServiceGatewayEndpointGatewayBindingsPager(vpcService, listPrivatePathServiceGatewayEndpointGatewayBindingsOptions); - List allResults = pager.getAll(); + VpnServerRoutesPager pager = new VpnServerRoutesPager(vpcService, listVpnServerRoutesOptions); + List allResults = pager.getAll(); assertNotNull(allResults); assertEquals(allResults.size(), 2); } - // Test the getPrivatePathServiceGatewayEndpointGatewayBinding operation with a valid options model parameter + // Test the createVpnServerRoute operation with a valid options model parameter @Test - public void testGetPrivatePathServiceGatewayEndpointGatewayBindingWOptions() throws Throwable { + public void testCreateVpnServerRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = "{\"account\": {\"id\": \"bb1b52262f7441a586f49068482f1e60\", \"resource_type\": \"account\"}, \"created_at\": \"2019-01-01T12:00:00.000Z\", \"expiration_at\": \"2019-01-01T12:00:00.000Z\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/private_path_service_gateways/r006-7268d425-59b7-48fd-9735-81a7271657d5/endpoint_gateway_bindings/r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\", \"id\": \"r006-7c30adc3-083d-46a1-a72c-d0ca8654a1d0\", \"lifecycle_state\": \"stable\", \"resource_type\": \"private_path_service_gateway_endpoint_gateway_binding\", \"status\": \"abandoned\"}"; - String getPrivatePathServiceGatewayEndpointGatewayBindingPath = "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString"; + String mockResponseBody = "{\"action\": \"deliver\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"health_reasons\": [{\"code\": \"internal_error\", \"message\": \"Internal error (contact IBM support).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-route-1\", \"resource_type\": \"vpn_server_route\"}"; + String createVpnServerRoutePath = "/vpn_servers/testString/routes"; server.enqueue(new MockResponse() .setHeader("Content-type", "application/json") - .setResponseCode(200) + .setResponseCode(201) .setBody(mockResponseBody)); - // Construct an instance of the GetPrivatePathServiceGatewayEndpointGatewayBindingOptions model - GetPrivatePathServiceGatewayEndpointGatewayBindingOptions getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel = new GetPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() - .privatePathServiceGatewayId("testString") - .id("testString") + // Construct an instance of the CreateVpnServerRouteOptions model + CreateVpnServerRouteOptions createVpnServerRouteOptionsModel = new CreateVpnServerRouteOptions.Builder() + .vpnServerId("testString") + .destination("172.16.0.0/16") + .action("deliver") + .name("my-vpn-route-2") .build(); - // Invoke getPrivatePathServiceGatewayEndpointGatewayBinding() with a valid options model and verify the result - Response response = vpcService.getPrivatePathServiceGatewayEndpointGatewayBinding(getPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).execute(); + // Invoke createVpnServerRoute() with a valid options model and verify the result + Response response = vpcService.createVpnServerRoute(createVpnServerRouteOptionsModel).execute(); assertNotNull(response); - PrivatePathServiceGatewayEndpointGatewayBinding responseObj = response.getResult(); + VPNServerRoute responseObj = response.getResult(); assertNotNull(responseObj); - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getPrivatePathServiceGatewayEndpointGatewayBindingPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the getPrivatePathServiceGatewayEndpointGatewayBinding operation with and without retries enabled - @Test - public void testGetPrivatePathServiceGatewayEndpointGatewayBindingWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testGetPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); - - vpcService.disableRetries(); - testGetPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); - } - - // Test the getPrivatePathServiceGatewayEndpointGatewayBinding operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetPrivatePathServiceGatewayEndpointGatewayBindingNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.getPrivatePathServiceGatewayEndpointGatewayBinding(null).execute(); - } - - // Test the denyPrivatePathServiceGatewayEndpointGatewayBinding operation with a valid options model parameter - @Test - public void testDenyPrivatePathServiceGatewayEndpointGatewayBindingWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String denyPrivatePathServiceGatewayEndpointGatewayBindingPath = "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/deny"; - server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); - - // Construct an instance of the DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions model - DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel = new DenyPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() - .privatePathServiceGatewayId("testString") - .id("testString") - .setAccountPolicy(true) - .build(); - - // Invoke denyPrivatePathServiceGatewayEndpointGatewayBinding() with a valid options model and verify the result - Response response = vpcService.denyPrivatePathServiceGatewayEndpointGatewayBinding(denyPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, denyPrivatePathServiceGatewayEndpointGatewayBindingPath); + assertEquals(parsedPath, createVpnServerRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the denyPrivatePathServiceGatewayEndpointGatewayBinding operation with and without retries enabled + // Test the createVpnServerRoute operation with and without retries enabled @Test - public void testDenyPrivatePathServiceGatewayEndpointGatewayBindingWRetries() throws Throwable { + public void testCreateVpnServerRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testDenyPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); + testCreateVpnServerRouteWOptions(); vpcService.disableRetries(); - testDenyPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); + testCreateVpnServerRouteWOptions(); } - // Test the denyPrivatePathServiceGatewayEndpointGatewayBinding operation with a null options model (negative test) + // Test the createVpnServerRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testDenyPrivatePathServiceGatewayEndpointGatewayBindingNoOptions() throws Throwable { + public void testCreateVpnServerRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.denyPrivatePathServiceGatewayEndpointGatewayBinding(null).execute(); + vpcService.createVpnServerRoute(null).execute(); } - // Test the permitPrivatePathServiceGatewayEndpointGatewayBinding operation with a valid options model parameter + // Test the deleteVpnServerRoute operation with a valid options model parameter @Test - public void testPermitPrivatePathServiceGatewayEndpointGatewayBindingWOptions() throws Throwable { + public void testDeleteVpnServerRouteWOptions() throws Throwable { // Register a mock response String mockResponseBody = ""; - String permitPrivatePathServiceGatewayEndpointGatewayBindingPath = "/private_path_service_gateways/testString/endpoint_gateway_bindings/testString/permit"; + String deleteVpnServerRoutePath = "/vpn_servers/testString/routes/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setResponseCode(202) .setBody(mockResponseBody)); - // Construct an instance of the PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions model - PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel = new PermitPrivatePathServiceGatewayEndpointGatewayBindingOptions.Builder() - .privatePathServiceGatewayId("testString") + // Construct an instance of the DeleteVpnServerRouteOptions model + DeleteVpnServerRouteOptions deleteVpnServerRouteOptionsModel = new DeleteVpnServerRouteOptions.Builder() + .vpnServerId("testString") .id("testString") - .setAccountPolicy(true) .build(); - // Invoke permitPrivatePathServiceGatewayEndpointGatewayBinding() with a valid options model and verify the result - Response response = vpcService.permitPrivatePathServiceGatewayEndpointGatewayBinding(permitPrivatePathServiceGatewayEndpointGatewayBindingOptionsModel).execute(); + // Invoke deleteVpnServerRoute() with a valid options model and verify the result + Response response = vpcService.deleteVpnServerRoute(deleteVpnServerRouteOptionsModel).execute(); assertNotNull(response); Void responseObj = response.getResult(); assertNull(responseObj); @@ -33728,194 +35261,147 @@ public void testPermitPrivatePathServiceGatewayEndpointGatewayBindingWOptions() // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "DELETE"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, permitPrivatePathServiceGatewayEndpointGatewayBindingPath); + assertEquals(parsedPath, deleteVpnServerRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the permitPrivatePathServiceGatewayEndpointGatewayBinding operation with and without retries enabled + // Test the deleteVpnServerRoute operation with and without retries enabled @Test - public void testPermitPrivatePathServiceGatewayEndpointGatewayBindingWRetries() throws Throwable { + public void testDeleteVpnServerRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testPermitPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); + testDeleteVpnServerRouteWOptions(); vpcService.disableRetries(); - testPermitPrivatePathServiceGatewayEndpointGatewayBindingWOptions(); + testDeleteVpnServerRouteWOptions(); } - // Test the permitPrivatePathServiceGatewayEndpointGatewayBinding operation with a null options model (negative test) + // Test the deleteVpnServerRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testPermitPrivatePathServiceGatewayEndpointGatewayBindingNoOptions() throws Throwable { + public void testDeleteVpnServerRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.permitPrivatePathServiceGatewayEndpointGatewayBinding(null).execute(); + vpcService.deleteVpnServerRoute(null).execute(); } - // Test the publishPrivatePathServiceGateway operation with a valid options model parameter + // Test the getVpnServerRoute operation with a valid options model parameter @Test - public void testPublishPrivatePathServiceGatewayWOptions() throws Throwable { + public void testGetVpnServerRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String publishPrivatePathServiceGatewayPath = "/private_path_service_gateways/testString/publish"; + String mockResponseBody = "{\"action\": \"deliver\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"health_reasons\": [{\"code\": \"internal_error\", \"message\": \"Internal error (contact IBM support).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-route-1\", \"resource_type\": \"vpn_server_route\"}"; + String getVpnServerRoutePath = "/vpn_servers/testString/routes/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the PublishPrivatePathServiceGatewayOptions model - PublishPrivatePathServiceGatewayOptions publishPrivatePathServiceGatewayOptionsModel = new PublishPrivatePathServiceGatewayOptions.Builder() - .privatePathServiceGatewayId("testString") + // Construct an instance of the GetVpnServerRouteOptions model + GetVpnServerRouteOptions getVpnServerRouteOptionsModel = new GetVpnServerRouteOptions.Builder() + .vpnServerId("testString") + .id("testString") .build(); - // Invoke publishPrivatePathServiceGateway() with a valid options model and verify the result - Response response = vpcService.publishPrivatePathServiceGateway(publishPrivatePathServiceGatewayOptionsModel).execute(); + // Invoke getVpnServerRoute() with a valid options model and verify the result + Response response = vpcService.getVpnServerRoute(getVpnServerRouteOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + VPNServerRoute responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "GET"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, publishPrivatePathServiceGatewayPath); + assertEquals(parsedPath, getVpnServerRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the publishPrivatePathServiceGateway operation with and without retries enabled + // Test the getVpnServerRoute operation with and without retries enabled @Test - public void testPublishPrivatePathServiceGatewayWRetries() throws Throwable { + public void testGetVpnServerRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testPublishPrivatePathServiceGatewayWOptions(); + testGetVpnServerRouteWOptions(); vpcService.disableRetries(); - testPublishPrivatePathServiceGatewayWOptions(); + testGetVpnServerRouteWOptions(); } - // Test the publishPrivatePathServiceGateway operation with a null options model (negative test) + // Test the getVpnServerRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testPublishPrivatePathServiceGatewayNoOptions() throws Throwable { + public void testGetVpnServerRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.publishPrivatePathServiceGateway(null).execute(); + vpcService.getVpnServerRoute(null).execute(); } - // Test the revokeAccountForPrivatePathServiceGateway operation with a valid options model parameter + // Test the updateVpnServerRoute operation with a valid options model parameter @Test - public void testRevokeAccountForPrivatePathServiceGatewayWOptions() throws Throwable { + public void testUpdateVpnServerRouteWOptions() throws Throwable { // Register a mock response - String mockResponseBody = ""; - String revokeAccountForPrivatePathServiceGatewayPath = "/private_path_service_gateways/testString/revoke_account"; + String mockResponseBody = "{\"action\": \"deliver\", \"created_at\": \"2019-01-01T12:00:00.000Z\", \"destination\": \"192.168.3.0/24\", \"health_reasons\": [{\"code\": \"internal_error\", \"message\": \"Internal error (contact IBM support).\", \"more_info\": \"https://cloud.ibm.com/docs/vpc?topic=vpc-vpn-server-route-health\"}], \"health_state\": \"ok\", \"href\": \"https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-4ec65fe4-e68f-44ff-bc94-c9caf6123b5f/routes/r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"id\": \"r006-1a15dca5-7e33-45e1-b7c5-bc690e569531\", \"lifecycle_reasons\": [{\"code\": \"resource_suspended_by_provider\", \"message\": \"The resource has been suspended. Contact IBM support with the CRN for next steps.\", \"more_info\": \"https://cloud.ibm.com/apidocs/vpc#resource-suspension\"}], \"lifecycle_state\": \"stable\", \"name\": \"my-vpn-route-1\", \"resource_type\": \"vpn_server_route\"}"; + String updateVpnServerRoutePath = "/vpn_servers/testString/routes/testString"; server.enqueue(new MockResponse() - .setResponseCode(204) + .setHeader("Content-type", "application/json") + .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the AccountIdentityById model - AccountIdentityById accountIdentityModel = new AccountIdentityById.Builder() - .id("bb1b52262f7441a586f49068482f1e60") - .build(); - - // Construct an instance of the RevokeAccountForPrivatePathServiceGatewayOptions model - RevokeAccountForPrivatePathServiceGatewayOptions revokeAccountForPrivatePathServiceGatewayOptionsModel = new RevokeAccountForPrivatePathServiceGatewayOptions.Builder() - .privatePathServiceGatewayId("testString") - .account(accountIdentityModel) + // Construct an instance of the VPNServerRoutePatch model + VPNServerRoutePatch vpnServerRoutePatchModel = new VPNServerRoutePatch.Builder() + .name("my-vpn-server-route-updated") .build(); + Map vpnServerRoutePatchModelAsPatch = vpnServerRoutePatchModel.asPatch(); - // Invoke revokeAccountForPrivatePathServiceGateway() with a valid options model and verify the result - Response response = vpcService.revokeAccountForPrivatePathServiceGateway(revokeAccountForPrivatePathServiceGatewayOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, revokeAccountForPrivatePathServiceGatewayPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); - assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); - } - - // Test the revokeAccountForPrivatePathServiceGateway operation with and without retries enabled - @Test - public void testRevokeAccountForPrivatePathServiceGatewayWRetries() throws Throwable { - vpcService.enableRetries(4, 30); - testRevokeAccountForPrivatePathServiceGatewayWOptions(); - - vpcService.disableRetries(); - testRevokeAccountForPrivatePathServiceGatewayWOptions(); - } - - // Test the revokeAccountForPrivatePathServiceGateway operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testRevokeAccountForPrivatePathServiceGatewayNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - vpcService.revokeAccountForPrivatePathServiceGateway(null).execute(); - } - - // Test the unpublishPrivatePathServiceGateway operation with a valid options model parameter - @Test - public void testUnpublishPrivatePathServiceGatewayWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String unpublishPrivatePathServiceGatewayPath = "/private_path_service_gateways/testString/unpublish"; - server.enqueue(new MockResponse() - .setResponseCode(204) - .setBody(mockResponseBody)); - - // Construct an instance of the UnpublishPrivatePathServiceGatewayOptions model - UnpublishPrivatePathServiceGatewayOptions unpublishPrivatePathServiceGatewayOptionsModel = new UnpublishPrivatePathServiceGatewayOptions.Builder() - .privatePathServiceGatewayId("testString") + // Construct an instance of the UpdateVpnServerRouteOptions model + UpdateVpnServerRouteOptions updateVpnServerRouteOptionsModel = new UpdateVpnServerRouteOptions.Builder() + .vpnServerId("testString") + .id("testString") + .vpnServerRoutePatch(vpnServerRoutePatchModelAsPatch) .build(); - // Invoke unpublishPrivatePathServiceGateway() with a valid options model and verify the result - Response response = vpcService.unpublishPrivatePathServiceGateway(unpublishPrivatePathServiceGatewayOptionsModel).execute(); + // Invoke updateVpnServerRoute() with a valid options model and verify the result + Response response = vpcService.updateVpnServerRoute(updateVpnServerRouteOptionsModel).execute(); assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); + VPNServerRoute responseObj = response.getResult(); + assertNotNull(responseObj); // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); assertNotNull(request); - assertEquals(request.getMethod(), "POST"); + assertEquals(request.getMethod(), "PATCH"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, unpublishPrivatePathServiceGatewayPath); + assertEquals(parsedPath, updateVpnServerRoutePath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); - assertEquals(query.get("version"), "2025-07-08"); + assertEquals(query.get("version"), version); assertEquals(Long.valueOf(query.get("generation")), Long.valueOf("2")); } - // Test the unpublishPrivatePathServiceGateway operation with and without retries enabled + // Test the updateVpnServerRoute operation with and without retries enabled @Test - public void testUnpublishPrivatePathServiceGatewayWRetries() throws Throwable { + public void testUpdateVpnServerRouteWRetries() throws Throwable { vpcService.enableRetries(4, 30); - testUnpublishPrivatePathServiceGatewayWOptions(); + testUpdateVpnServerRouteWOptions(); vpcService.disableRetries(); - testUnpublishPrivatePathServiceGatewayWOptions(); + testUpdateVpnServerRouteWOptions(); } - // Test the unpublishPrivatePathServiceGateway operation with a null options model (negative test) + // Test the updateVpnServerRoute operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testUnpublishPrivatePathServiceGatewayNoOptions() throws Throwable { + public void testUpdateVpnServerRouteNoOptions() throws Throwable { server.enqueue(new MockResponse()); - vpcService.unpublishPrivatePathServiceGateway(null).execute(); + vpcService.updateVpnServerRoute(null).execute(); } // Perform setup needed before each test method diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayAdvertisedCidrOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayAdvertisedCidrOptionsTest.java new file mode 100644 index 0000000000..7a41b24907 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/AddVpnGatewayAdvertisedCidrOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.AddVpnGatewayAdvertisedCidrOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the AddVpnGatewayAdvertisedCidrOptions model. + */ +public class AddVpnGatewayAdvertisedCidrOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testAddVpnGatewayAdvertisedCidrOptions() throws Throwable { + AddVpnGatewayAdvertisedCidrOptions addVpnGatewayAdvertisedCidrOptionsModel = new AddVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.1.0/24") + .build(); + assertEquals(addVpnGatewayAdvertisedCidrOptionsModel.vpnGatewayId(), "testString"); + assertEquals(addVpnGatewayAdvertisedCidrOptionsModel.cidr(), "192.168.1.0/24"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testAddVpnGatewayAdvertisedCidrOptionsError() throws Throwable { + new AddVpnGatewayAdvertisedCidrOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionTest.java index 6141061945..b1e0f54b90 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerCollectionTest.java @@ -18,9 +18,11 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerCPU; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerCollection; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDisk; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskAllowedUse; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerFirmware; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerHealthReason; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataService; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentReference; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileReference; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerReservationAffinity; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskAllowedUseTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskAllowedUseTest.java new file mode 100644 index 0000000000..71403150ef --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskAllowedUseTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskAllowedUse; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the BareMetalServerDiskAllowedUse model. + */ +public class BareMetalServerDiskAllowedUseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBareMetalServerDiskAllowedUse() throws Throwable { + BareMetalServerDiskAllowedUse bareMetalServerDiskAllowedUseModel = new BareMetalServerDiskAllowedUse(); + assertNull(bareMetalServerDiskAllowedUseModel.getApiVersion()); + assertNull(bareMetalServerDiskAllowedUseModel.getBareMetalServer()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskCollectionTest.java index e19b09c5d1..1b5d1c7f94 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskCollectionTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDisk; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskAllowedUse; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskCollection; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskTest.java index 905acd1164..0d8dc0e653 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerDiskTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDisk; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskAllowedUse; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -32,6 +33,7 @@ public class BareMetalServerDiskTest { @Test public void testBareMetalServerDisk() throws Throwable { BareMetalServerDisk bareMetalServerDiskModel = new BareMetalServerDisk(); + assertNull(bareMetalServerDiskModel.getAllowedUse()); assertNull(bareMetalServerDiskModel.getCreatedAt()); assertNull(bareMetalServerDiskModel.getHref()); assertNull(bareMetalServerDiskModel.getId()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfilePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfilePrototypeTest.java new file mode 100644 index 0000000000..34387d1859 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfilePrototypeTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the BareMetalServerInitializationDefaultTrustedProfilePrototype model. + */ +public class BareMetalServerInitializationDefaultTrustedProfilePrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBareMetalServerInitializationDefaultTrustedProfilePrototype() throws Throwable { + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + + String json = TestUtilities.serialize(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModelNew = TestUtilities.deserialize(json, BareMetalServerInitializationDefaultTrustedProfilePrototype.class); + assertTrue(bareMetalServerInitializationDefaultTrustedProfilePrototypeModelNew instanceof BareMetalServerInitializationDefaultTrustedProfilePrototype); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModelNew.autoLink(), Boolean.valueOf(false)); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModelNew.target().toString(), trustedProfileIdentityModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testBareMetalServerInitializationDefaultTrustedProfilePrototypeError() throws Throwable { + new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfileTest.java new file mode 100644 index 0000000000..d39b7ac411 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationDefaultTrustedProfileTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfile; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileReference; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the BareMetalServerInitializationDefaultTrustedProfile model. + */ +public class BareMetalServerInitializationDefaultTrustedProfileTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBareMetalServerInitializationDefaultTrustedProfile() throws Throwable { + BareMetalServerInitializationDefaultTrustedProfile bareMetalServerInitializationDefaultTrustedProfileModel = new BareMetalServerInitializationDefaultTrustedProfile(); + assertNull(bareMetalServerInitializationDefaultTrustedProfileModel.isAutoLink()); + assertNull(bareMetalServerInitializationDefaultTrustedProfileModel.getTarget()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototypeTest.java index 34be6d6c76..646bbeb36f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationPrototypeTest.java @@ -13,9 +13,11 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationPrototype; import com.ibm.cloud.is.vpc.v1.model.ImageIdentityById; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -33,6 +35,18 @@ public class BareMetalServerInitializationPrototypeTest { @Test public void testBareMetalServerInitializationPrototype() throws Throwable { + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .build(); @@ -44,10 +58,12 @@ public void testBareMetalServerInitializationPrototype() throws Throwable { assertEquals(keyIdentityModel.id(), "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"); BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) .image(imageIdentityModel) .keys(java.util.Arrays.asList(keyIdentityModel)) .userData("testString") .build(); + assertEquals(bareMetalServerInitializationPrototypeModel.defaultTrustedProfile(), bareMetalServerInitializationDefaultTrustedProfilePrototypeModel); assertEquals(bareMetalServerInitializationPrototypeModel.image(), imageIdentityModel); assertEquals(bareMetalServerInitializationPrototypeModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(bareMetalServerInitializationPrototypeModel.userData(), "testString"); @@ -56,6 +72,7 @@ public void testBareMetalServerInitializationPrototype() throws Throwable { BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModelNew = TestUtilities.deserialize(json, BareMetalServerInitializationPrototype.class); assertTrue(bareMetalServerInitializationPrototypeModelNew instanceof BareMetalServerInitializationPrototype); + assertEquals(bareMetalServerInitializationPrototypeModelNew.defaultTrustedProfile().toString(), bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.toString()); assertEquals(bareMetalServerInitializationPrototypeModelNew.image().toString(), imageIdentityModel.toString()); assertEquals(bareMetalServerInitializationPrototypeModelNew.userData(), "testString"); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationTest.java index 606c68828b..7ffea94517 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerInitializationTest.java @@ -15,12 +15,14 @@ import com.ibm.cloud.is.vpc.v1.model.AccountReference; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitialization; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfile; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount; import com.ibm.cloud.is.vpc.v1.model.Deleted; import com.ibm.cloud.is.vpc.v1.model.ImageReference; import com.ibm.cloud.is.vpc.v1.model.ImageRemoteContextImageReference; import com.ibm.cloud.is.vpc.v1.model.KeyReference; import com.ibm.cloud.is.vpc.v1.model.RegionReference; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileReference; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -39,6 +41,7 @@ public class BareMetalServerInitializationTest { @Test public void testBareMetalServerInitialization() throws Throwable { BareMetalServerInitialization bareMetalServerInitializationModel = new BareMetalServerInitialization(); + assertNull(bareMetalServerInitializationModel.getDefaultTrustedProfile()); assertNull(bareMetalServerInitializationModel.getImage()); assertNull(bareMetalServerInitializationModel.getKeys()); assertNull(bareMetalServerInitializationModel.getUserAccounts()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePatchTest.java new file mode 100644 index 0000000000..0685bb8c26 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePatchTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the BareMetalServerMetadataServicePatch model. + */ +public class BareMetalServerMetadataServicePatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBareMetalServerMetadataServicePatch() throws Throwable { + BareMetalServerMetadataServicePatch bareMetalServerMetadataServicePatchModel = new BareMetalServerMetadataServicePatch.Builder() + .enabled(true) + .protocol("http") + .build(); + assertEquals(bareMetalServerMetadataServicePatchModel.enabled(), Boolean.valueOf(true)); + assertEquals(bareMetalServerMetadataServicePatchModel.protocol(), "http"); + + String json = TestUtilities.serialize(bareMetalServerMetadataServicePatchModel); + + BareMetalServerMetadataServicePatch bareMetalServerMetadataServicePatchModelNew = TestUtilities.deserialize(json, BareMetalServerMetadataServicePatch.class); + assertTrue(bareMetalServerMetadataServicePatchModelNew instanceof BareMetalServerMetadataServicePatch); + assertEquals(bareMetalServerMetadataServicePatchModelNew.enabled(), Boolean.valueOf(true)); + assertEquals(bareMetalServerMetadataServicePatchModelNew.protocol(), "http"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePrototypeTest.java new file mode 100644 index 0000000000..d1d36ed874 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServicePrototypeTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the BareMetalServerMetadataServicePrototype model. + */ +public class BareMetalServerMetadataServicePrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBareMetalServerMetadataServicePrototype() throws Throwable { + BareMetalServerMetadataServicePrototype bareMetalServerMetadataServicePrototypeModel = new BareMetalServerMetadataServicePrototype.Builder() + .enabled(true) + .protocol("https") + .build(); + assertEquals(bareMetalServerMetadataServicePrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(bareMetalServerMetadataServicePrototypeModel.protocol(), "https"); + + String json = TestUtilities.serialize(bareMetalServerMetadataServicePrototypeModel); + + BareMetalServerMetadataServicePrototype bareMetalServerMetadataServicePrototypeModelNew = TestUtilities.deserialize(json, BareMetalServerMetadataServicePrototype.class); + assertTrue(bareMetalServerMetadataServicePrototypeModelNew instanceof BareMetalServerMetadataServicePrototype); + assertEquals(bareMetalServerMetadataServicePrototypeModelNew.enabled(), Boolean.valueOf(true)); + assertEquals(bareMetalServerMetadataServicePrototypeModelNew.protocol(), "https"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServiceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServiceTest.java new file mode 100644 index 0000000000..b32b94da33 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerMetadataServiceTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataService; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the BareMetalServerMetadataService model. + */ +public class BareMetalServerMetadataServiceTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testBareMetalServerMetadataService() throws Throwable { + BareMetalServerMetadataService bareMetalServerMetadataServiceModel = new BareMetalServerMetadataService(); + assertNull(bareMetalServerMetadataServiceModel.isEnabled()); + assertNull(bareMetalServerMetadataServiceModel.getProtocol()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatchTest.java index c3040460ac..84277863cd 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPatchTest.java @@ -13,6 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerReservationAffinityPatch; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerTrustedPlatformModulePatch; @@ -35,6 +36,13 @@ public class BareMetalServerPatchTest { @Test public void testBareMetalServerPatch() throws Throwable { + BareMetalServerMetadataServicePatch bareMetalServerMetadataServicePatchModel = new BareMetalServerMetadataServicePatch.Builder() + .enabled(true) + .protocol("http") + .build(); + assertEquals(bareMetalServerMetadataServicePatchModel.enabled(), Boolean.valueOf(true)); + assertEquals(bareMetalServerMetadataServicePatchModel.protocol(), "http"); + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") .build(); @@ -55,12 +63,14 @@ public void testBareMetalServerPatch() throws Throwable { BareMetalServerPatch bareMetalServerPatchModel = new BareMetalServerPatch.Builder() .bandwidth(Long.valueOf("20000")) .enableSecureBoot(false) + .metadataService(bareMetalServerMetadataServicePatchModel) .name("my-bare-metal-server") .reservationAffinity(bareMetalServerReservationAffinityPatchModel) .trustedPlatformModule(bareMetalServerTrustedPlatformModulePatchModel) .build(); assertEquals(bareMetalServerPatchModel.bandwidth(), Long.valueOf("20000")); assertEquals(bareMetalServerPatchModel.enableSecureBoot(), Boolean.valueOf(false)); + assertEquals(bareMetalServerPatchModel.metadataService(), bareMetalServerMetadataServicePatchModel); assertEquals(bareMetalServerPatchModel.name(), "my-bare-metal-server"); assertEquals(bareMetalServerPatchModel.reservationAffinity(), bareMetalServerReservationAffinityPatchModel); assertEquals(bareMetalServerPatchModel.trustedPlatformModule(), bareMetalServerTrustedPlatformModulePatchModel); @@ -71,12 +81,18 @@ public void testBareMetalServerPatch() throws Throwable { assertTrue(bareMetalServerPatchModelNew instanceof BareMetalServerPatch); assertEquals(bareMetalServerPatchModelNew.bandwidth(), Long.valueOf("20000")); assertEquals(bareMetalServerPatchModelNew.enableSecureBoot(), Boolean.valueOf(false)); + assertEquals(bareMetalServerPatchModelNew.metadataService().toString(), bareMetalServerMetadataServicePatchModel.toString()); assertEquals(bareMetalServerPatchModelNew.name(), "my-bare-metal-server"); assertEquals(bareMetalServerPatchModelNew.reservationAffinity().toString(), bareMetalServerReservationAffinityPatchModel.toString()); assertEquals(bareMetalServerPatchModelNew.trustedPlatformModule().toString(), bareMetalServerTrustedPlatformModulePatchModel.toString()); } @Test public void testBareMetalServerPatchAsPatch() throws Throwable { + BareMetalServerMetadataServicePatch bareMetalServerMetadataServicePatchModel = new BareMetalServerMetadataServicePatch.Builder() + .enabled(true) + .protocol("http") + .build(); + ReservationIdentityById reservationIdentityModel = new ReservationIdentityById.Builder() .id("0717-ba49df72-37b8-43ac-98da-f8e029de0e63") .build(); @@ -93,6 +109,7 @@ public void testBareMetalServerPatchAsPatch() throws Throwable { BareMetalServerPatch bareMetalServerPatchModel = new BareMetalServerPatch.Builder() .bandwidth(Long.valueOf("20000")) .enableSecureBoot(false) + .metadataService(bareMetalServerMetadataServicePatchModel) .name("my-bare-metal-server") .reservationAffinity(bareMetalServerReservationAffinityPatchModel) .trustedPlatformModule(bareMetalServerTrustedPlatformModulePatchModel) @@ -102,6 +119,7 @@ public void testBareMetalServerPatchAsPatch() throws Throwable { assertTrue(mergePatch.containsKey("bandwidth")); assertTrue(mergePatch.containsKey("enable_secure_boot")); + assertTrue(mergePatch.containsKey("metadata_service")); assertEquals(mergePatch.get("name"), "my-bare-metal-server"); assertTrue(mergePatch.containsKey("reservation_affinity")); assertTrue(mergePatch.containsKey("trusted_platform_module")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkAttachmentTest.java index 48808c377e..6efe145d55 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkAttachmentTest.java @@ -13,7 +13,9 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationPrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype; @@ -27,6 +29,7 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; @@ -48,6 +51,18 @@ public class BareMetalServerPrototypeBareMetalServerByNetworkAttachmentTest { @Test public void testBareMetalServerPrototypeBareMetalServerByNetworkAttachment() throws Throwable { + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .build(); @@ -59,14 +74,23 @@ public void testBareMetalServerPrototypeBareMetalServerByNetworkAttachment() thr assertEquals(keyIdentityModel.id(), "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"); BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) .image(imageIdentityModel) .keys(java.util.Arrays.asList(keyIdentityModel)) .userData("testString") .build(); + assertEquals(bareMetalServerInitializationPrototypeModel.defaultTrustedProfile(), bareMetalServerInitializationDefaultTrustedProfilePrototypeModel); assertEquals(bareMetalServerInitializationPrototypeModel.image(), imageIdentityModel); assertEquals(bareMetalServerInitializationPrototypeModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(bareMetalServerInitializationPrototypeModel.userData(), "testString"); + BareMetalServerMetadataServicePrototype bareMetalServerMetadataServicePrototypeModel = new BareMetalServerMetadataServicePrototype.Builder() + .enabled(true) + .protocol("https") + .build(); + assertEquals(bareMetalServerMetadataServicePrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(bareMetalServerMetadataServicePrototypeModel.protocol(), "https"); + BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() .name("bx2-metal-192x768") .build(); @@ -181,6 +205,7 @@ public void testBareMetalServerPrototypeBareMetalServerByNetworkAttachment() thr .bandwidth(Long.valueOf("20000")) .enableSecureBoot(false) .initialization(bareMetalServerInitializationPrototypeModel) + .metadataService(bareMetalServerMetadataServicePrototypeModel) .name("my-bare-metal-server") .profile(bareMetalServerProfileIdentityModel) .reservationAffinity(bareMetalServerReservationAffinityPrototypeModel) @@ -194,6 +219,7 @@ public void testBareMetalServerPrototypeBareMetalServerByNetworkAttachment() thr assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModel.bandwidth(), Long.valueOf("20000")); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModel.enableSecureBoot(), Boolean.valueOf(false)); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModel.initialization(), bareMetalServerInitializationPrototypeModel); + assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModel.metadataService(), bareMetalServerMetadataServicePrototypeModel); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModel.name(), "my-bare-metal-server"); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModel.profile(), bareMetalServerProfileIdentityModel); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModel.reservationAffinity(), bareMetalServerReservationAffinityPrototypeModel); @@ -211,6 +237,7 @@ public void testBareMetalServerPrototypeBareMetalServerByNetworkAttachment() thr assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModelNew.bandwidth(), Long.valueOf("20000")); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModelNew.enableSecureBoot(), Boolean.valueOf(false)); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModelNew.initialization().toString(), bareMetalServerInitializationPrototypeModel.toString()); + assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModelNew.metadataService().toString(), bareMetalServerMetadataServicePrototypeModel.toString()); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModelNew.name(), "my-bare-metal-server"); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModelNew.profile().toString(), bareMetalServerProfileIdentityModel.toString()); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkAttachmentModelNew.reservationAffinity().toString(), bareMetalServerReservationAffinityPrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkInterfaceTest.java index 5de076324b..7de5db397a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeBareMetalServerByNetworkInterfaceTest.java @@ -13,7 +13,9 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationPrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByHiperSocketPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPrimaryNetworkInterfacePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileIdentityByName; @@ -27,6 +29,7 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -46,6 +49,18 @@ public class BareMetalServerPrototypeBareMetalServerByNetworkInterfaceTest { @Test public void testBareMetalServerPrototypeBareMetalServerByNetworkInterface() throws Throwable { + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .build(); @@ -57,14 +72,23 @@ public void testBareMetalServerPrototypeBareMetalServerByNetworkInterface() thro assertEquals(keyIdentityModel.id(), "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"); BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) .image(imageIdentityModel) .keys(java.util.Arrays.asList(keyIdentityModel)) .userData("testString") .build(); + assertEquals(bareMetalServerInitializationPrototypeModel.defaultTrustedProfile(), bareMetalServerInitializationDefaultTrustedProfilePrototypeModel); assertEquals(bareMetalServerInitializationPrototypeModel.image(), imageIdentityModel); assertEquals(bareMetalServerInitializationPrototypeModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(bareMetalServerInitializationPrototypeModel.userData(), "testString"); + BareMetalServerMetadataServicePrototype bareMetalServerMetadataServicePrototypeModel = new BareMetalServerMetadataServicePrototype.Builder() + .enabled(true) + .protocol("https") + .build(); + assertEquals(bareMetalServerMetadataServicePrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(bareMetalServerMetadataServicePrototypeModel.protocol(), "https"); + BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() .name("bx2-metal-192x768") .build(); @@ -161,6 +185,7 @@ public void testBareMetalServerPrototypeBareMetalServerByNetworkInterface() thro .bandwidth(Long.valueOf("20000")) .enableSecureBoot(false) .initialization(bareMetalServerInitializationPrototypeModel) + .metadataService(bareMetalServerMetadataServicePrototypeModel) .name("my-bare-metal-server") .profile(bareMetalServerProfileIdentityModel) .reservationAffinity(bareMetalServerReservationAffinityPrototypeModel) @@ -174,6 +199,7 @@ public void testBareMetalServerPrototypeBareMetalServerByNetworkInterface() thro assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModel.bandwidth(), Long.valueOf("20000")); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModel.enableSecureBoot(), Boolean.valueOf(false)); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModel.initialization(), bareMetalServerInitializationPrototypeModel); + assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModel.metadataService(), bareMetalServerMetadataServicePrototypeModel); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModel.name(), "my-bare-metal-server"); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModel.profile(), bareMetalServerProfileIdentityModel); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModel.reservationAffinity(), bareMetalServerReservationAffinityPrototypeModel); @@ -191,6 +217,7 @@ public void testBareMetalServerPrototypeBareMetalServerByNetworkInterface() thro assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModelNew.bandwidth(), Long.valueOf("20000")); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModelNew.enableSecureBoot(), Boolean.valueOf(false)); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModelNew.initialization().toString(), bareMetalServerInitializationPrototypeModel.toString()); + assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModelNew.metadataService().toString(), bareMetalServerMetadataServicePrototypeModel.toString()); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModelNew.name(), "my-bare-metal-server"); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModelNew.profile().toString(), bareMetalServerProfileIdentityModel.toString()); assertEquals(bareMetalServerPrototypeBareMetalServerByNetworkInterfaceModelNew.reservationAffinity().toString(), bareMetalServerReservationAffinityPrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeTest.java index 1508b9b6a7..75992ff33f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerPrototypeTest.java @@ -13,7 +13,9 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationPrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype; @@ -27,6 +29,7 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerTest.java index 194572c963..883d5c1497 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/BareMetalServerTest.java @@ -17,9 +17,11 @@ import com.ibm.cloud.is.vpc.v1.model.BareMetalServerBootTargetBareMetalServerDiskReference; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerCPU; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDisk; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerDiskAllowedUse; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerFirmware; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerHealthReason; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataService; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentReference; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileReference; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerReservationAffinity; @@ -68,6 +70,7 @@ public void testBareMetalServer() throws Throwable { assertNull(bareMetalServerModel.getLifecycleReasons()); assertNull(bareMetalServerModel.getLifecycleState()); assertNull(bareMetalServerModel.getMemory()); + assertNull(bareMetalServerModel.getMetadataService()); assertNull(bareMetalServerModel.getName()); assertNull(bareMetalServerModel.getNetworkAttachments()); assertNull(bareMetalServerModel.getNetworkInterfaces()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayAdvertisedCidrOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayAdvertisedCidrOptionsTest.java new file mode 100644 index 0000000000..5165d32629 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CheckVpnGatewayAdvertisedCidrOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CheckVpnGatewayAdvertisedCidrOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CheckVpnGatewayAdvertisedCidrOptions model. + */ +public class CheckVpnGatewayAdvertisedCidrOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCheckVpnGatewayAdvertisedCidrOptions() throws Throwable { + CheckVpnGatewayAdvertisedCidrOptions checkVpnGatewayAdvertisedCidrOptionsModel = new CheckVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.1.0/24") + .build(); + assertEquals(checkVpnGatewayAdvertisedCidrOptionsModel.vpnGatewayId(), "testString"); + assertEquals(checkVpnGatewayAdvertisedCidrOptionsModel.cidr(), "192.168.1.0/24"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCheckVpnGatewayAdvertisedCidrOptionsError() throws Throwable { + new CheckVpnGatewayAdvertisedCidrOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptionsTest.java index 1d58cebfc3..45b5b20ae5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateBareMetalServerOptionsTest.java @@ -13,7 +13,9 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationPrototype; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerMetadataServicePrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentPrototypeBareMetalServerNetworkAttachmentByPCIPrototype; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerNetworkAttachmentPrototypeVirtualNetworkInterfaceVirtualNetworkInterfacePrototypeBareMetalServerNetworkAttachmentContext; import com.ibm.cloud.is.vpc.v1.model.BareMetalServerPrimaryNetworkAttachmentPrototypeBareMetalServerPrimaryNetworkAttachmentByPCIPrototype; @@ -28,6 +30,7 @@ import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; @@ -49,6 +52,18 @@ public class CreateBareMetalServerOptionsTest { @Test public void testCreateBareMetalServerOptions() throws Throwable { + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + ImageIdentityById imageIdentityModel = new ImageIdentityById.Builder() .id("r006-72b27b5c-f4b0-48bb-b954-5becc7c1dcb8") .build(); @@ -60,14 +75,23 @@ public void testCreateBareMetalServerOptions() throws Throwable { assertEquals(keyIdentityModel.id(), "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"); BareMetalServerInitializationPrototype bareMetalServerInitializationPrototypeModel = new BareMetalServerInitializationPrototype.Builder() + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) .image(imageIdentityModel) .keys(java.util.Arrays.asList(keyIdentityModel)) .userData("testString") .build(); + assertEquals(bareMetalServerInitializationPrototypeModel.defaultTrustedProfile(), bareMetalServerInitializationDefaultTrustedProfilePrototypeModel); assertEquals(bareMetalServerInitializationPrototypeModel.image(), imageIdentityModel); assertEquals(bareMetalServerInitializationPrototypeModel.keys(), java.util.Arrays.asList(keyIdentityModel)); assertEquals(bareMetalServerInitializationPrototypeModel.userData(), "testString"); + BareMetalServerMetadataServicePrototype bareMetalServerMetadataServicePrototypeModel = new BareMetalServerMetadataServicePrototype.Builder() + .enabled(true) + .protocol("https") + .build(); + assertEquals(bareMetalServerMetadataServicePrototypeModel.enabled(), Boolean.valueOf(true)); + assertEquals(bareMetalServerMetadataServicePrototypeModel.protocol(), "https"); + BareMetalServerProfileIdentityByName bareMetalServerProfileIdentityModel = new BareMetalServerProfileIdentityByName.Builder() .name("bx2-metal-192x768") .build(); @@ -182,6 +206,7 @@ public void testCreateBareMetalServerOptions() throws Throwable { .bandwidth(Long.valueOf("20000")) .enableSecureBoot(false) .initialization(bareMetalServerInitializationPrototypeModel) + .metadataService(bareMetalServerMetadataServicePrototypeModel) .name("my-bare-metal-server") .profile(bareMetalServerProfileIdentityModel) .reservationAffinity(bareMetalServerReservationAffinityPrototypeModel) @@ -195,6 +220,7 @@ public void testCreateBareMetalServerOptions() throws Throwable { assertEquals(bareMetalServerPrototypeModel.bandwidth(), Long.valueOf("20000")); assertEquals(bareMetalServerPrototypeModel.enableSecureBoot(), Boolean.valueOf(false)); assertEquals(bareMetalServerPrototypeModel.initialization(), bareMetalServerInitializationPrototypeModel); + assertEquals(bareMetalServerPrototypeModel.metadataService(), bareMetalServerMetadataServicePrototypeModel); assertEquals(bareMetalServerPrototypeModel.name(), "my-bare-metal-server"); assertEquals(bareMetalServerPrototypeModel.profile(), bareMetalServerProfileIdentityModel); assertEquals(bareMetalServerPrototypeModel.reservationAffinity(), bareMetalServerReservationAffinityPrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptionsTest.java index 039efa366e..df071044da 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayOptionsTest.java @@ -66,7 +66,7 @@ public void testCreateEndpointGatewayOptions() throws Throwable { CreateEndpointGatewayOptions createEndpointGatewayOptionsModel = new CreateEndpointGatewayOptions.Builder() .target(endpointGatewayTargetPrototypeModel) .vpc(vpcIdentityModel) - .allowDnsResolutionBinding(true) + .dnsResolutionBindingMode("primary") .ips(java.util.Arrays.asList(endpointGatewayReservedIpModel)) .name("my-endpoint-gateway") .resourceGroup(resourceGroupIdentityModel) @@ -74,7 +74,7 @@ public void testCreateEndpointGatewayOptions() throws Throwable { .build(); assertEquals(createEndpointGatewayOptionsModel.target(), endpointGatewayTargetPrototypeModel); assertEquals(createEndpointGatewayOptionsModel.vpc(), vpcIdentityModel); - assertEquals(createEndpointGatewayOptionsModel.allowDnsResolutionBinding(), Boolean.valueOf(true)); + assertEquals(createEndpointGatewayOptionsModel.dnsResolutionBindingMode(), "primary"); assertEquals(createEndpointGatewayOptionsModel.ips(), java.util.Arrays.asList(endpointGatewayReservedIpModel)); assertEquals(createEndpointGatewayOptionsModel.name(), "my-endpoint-gateway"); assertEquals(createEndpointGatewayOptionsModel.resourceGroup(), resourceGroupIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayResourceBindingOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayResourceBindingOptionsTest.java new file mode 100644 index 0000000000..237fecee3d --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateEndpointGatewayResourceBindingOptionsTest.java @@ -0,0 +1,55 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.CreateEndpointGatewayResourceBindingOptions; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the CreateEndpointGatewayResourceBindingOptions model. + */ +public class CreateEndpointGatewayResourceBindingOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateEndpointGatewayResourceBindingOptions() throws Throwable { + EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN endpointGatewayResourceBindingTargetPrototypeModel = new EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.Builder() + .crn("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue") + .build(); + assertEquals(endpointGatewayResourceBindingTargetPrototypeModel.crn(), "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"); + + CreateEndpointGatewayResourceBindingOptions createEndpointGatewayResourceBindingOptionsModel = new CreateEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .target(endpointGatewayResourceBindingTargetPrototypeModel) + .name("my-resource-binding") + .build(); + assertEquals(createEndpointGatewayResourceBindingOptionsModel.endpointGatewayId(), "testString"); + assertEquals(createEndpointGatewayResourceBindingOptionsModel.target(), endpointGatewayResourceBindingTargetPrototypeModel); + assertEquals(createEndpointGatewayResourceBindingOptionsModel.name(), "my-resource-binding"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateEndpointGatewayResourceBindingOptionsError() throws Throwable { + new CreateEndpointGatewayResourceBindingOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateImageOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateImageOptionsTest.java index 8d20c268c5..74c0b9c906 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateImageOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateImageOptionsTest.java @@ -15,6 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateImageOptions; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.ImageFilePrototype; import com.ibm.cloud.is.vpc.v1.model.ImagePrototypeImageByFile; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemIdentityByName; @@ -37,6 +38,15 @@ public class CreateImageOptionsTest { @Test public void testCreateImageOptions() throws Throwable { + ImageAllowedUsePrototype imageAllowedUsePrototypeModel = new ImageAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(imageAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(imageAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(imageAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); @@ -58,6 +68,7 @@ public void testCreateImageOptions() throws Throwable { assertEquals(operatingSystemIdentityModel.name(), "ubuntu-24-04-amd64"); ImagePrototypeImageByFile imagePrototypeModel = new ImagePrototypeImageByFile.Builder() + .allowedUse(imageAllowedUsePrototypeModel) .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .name("my-image") .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) @@ -67,6 +78,7 @@ public void testCreateImageOptions() throws Throwable { .file(imageFilePrototypeModel) .operatingSystem(operatingSystemIdentityModel) .build(); + assertEquals(imagePrototypeModel.allowedUse(), imageAllowedUsePrototypeModel); assertEquals(imagePrototypeModel.deprecationAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); assertEquals(imagePrototypeModel.name(), "my-image"); assertEquals(imagePrototypeModel.obsolescenceAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerActionOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerActionOptionsTest.java index 5d16e3fb0a..50bf3497be 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerActionOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerActionOptionsTest.java @@ -14,11 +14,10 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.CreateInstanceGroupManagerActionOptions; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionGroupPrototype; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; import java.util.HashMap; import java.util.List; @@ -39,13 +38,13 @@ public void testCreateInstanceGroupManagerActionOptions() throws Throwable { .build(); assertEquals(instanceGroupManagerScheduledActionGroupPrototypeModel.membershipCount(), Long.valueOf("10")); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.Builder() + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup instanceGroupManagerActionPrototypeModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.Builder() .name("my-instance-group-manager-action") - .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) + .cronSpec("30 */2 * * 1-5") .group(instanceGroupManagerScheduledActionGroupPrototypeModel) .build(); assertEquals(instanceGroupManagerActionPrototypeModel.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeModel.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); + assertEquals(instanceGroupManagerActionPrototypeModel.cronSpec(), "30 */2 * * 1-5"); assertEquals(instanceGroupManagerActionPrototypeModel.group(), instanceGroupManagerScheduledActionGroupPrototypeModel); CreateInstanceGroupManagerActionOptions createInstanceGroupManagerActionOptionsModel = new CreateInstanceGroupManagerActionOptions.Builder() diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerPolicyOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerPolicyOptionsTest.java index e2d9faddb0..a72457142d 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerPolicyOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceGroupManagerPolicyOptionsTest.java @@ -35,12 +35,12 @@ public void testCreateInstanceGroupManagerPolicyOptions() throws Throwable { InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype instanceGroupManagerPolicyPrototypeModel = new InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.Builder() .name("my-instance-group-manager-policy") .metricType("cpu") - .metricValue(Long.valueOf("26")) + .metricValue(Long.valueOf("0")) .policyType("target") .build(); assertEquals(instanceGroupManagerPolicyPrototypeModel.name(), "my-instance-group-manager-policy"); assertEquals(instanceGroupManagerPolicyPrototypeModel.metricType(), "cpu"); - assertEquals(instanceGroupManagerPolicyPrototypeModel.metricValue(), Long.valueOf("26")); + assertEquals(instanceGroupManagerPolicyPrototypeModel.metricValue(), Long.valueOf("0")); assertEquals(instanceGroupManagerPolicyPrototypeModel.policyType(), "target"); CreateInstanceGroupManagerPolicyOptions createInstanceGroupManagerPolicyOptionsModel = new CreateInstanceGroupManagerPolicyOptions.Builder() diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptionsTest.java index 68a1a84ebf..8964038bc8 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceOptionsTest.java @@ -29,6 +29,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -38,6 +39,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -151,6 +153,11 @@ public void testCreateInstanceOptions() throws Throwable { .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -170,6 +177,15 @@ public void testCreateInstanceOptions() throws Throwable { .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -181,6 +197,7 @@ public void testCreateInstanceOptions() throws Throwable { assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -190,6 +207,7 @@ public void testCreateInstanceOptions() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -291,7 +309,9 @@ public void testCreateInstanceOptions() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -313,7 +333,9 @@ public void testCreateInstanceOptions() throws Throwable { assertEquals(instancePrototypeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeModel.userData(), "testString"); + assertEquals(instancePrototypeModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instancePrototypeModel.image(), imageIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptionsTest.java index 6d7b045bb9..ad7f606b17 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateInstanceTemplateOptionsTest.java @@ -29,6 +29,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -38,6 +39,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -151,6 +153,11 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -170,6 +177,15 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -181,6 +197,7 @@ public void testCreateInstanceTemplateOptions() throws Throwable { assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -190,6 +207,7 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -291,7 +309,9 @@ public void testCreateInstanceTemplateOptions() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -313,7 +333,9 @@ public void testCreateInstanceTemplateOptions() throws Throwable { assertEquals(instanceTemplatePrototypeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instanceTemplatePrototypeModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instanceTemplatePrototypeModel.image(), imageIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptionsTest.java index 75d420fc25..497daf496b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclOptionsTest.java @@ -15,7 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateNetworkAclOptions; import com.ibm.cloud.is.vpc.v1.model.NetworkACLPrototypeNetworkACLByRules; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -45,14 +45,14 @@ public void testCreateNetworkAclOptions() throws Throwable { .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Builder() + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Builder() .action("allow") .destination("192.168.3.2/32") .direction("inbound") .ipVersion("ipv4") .name("my-network-acl-rule") .source("192.168.3.2/32") - .protocol("all") + .protocol("any") .build(); assertEquals(networkAclRulePrototypeNetworkAclContextModel.action(), "allow"); assertEquals(networkAclRulePrototypeNetworkAclContextModel.destination(), "192.168.3.2/32"); @@ -60,7 +60,7 @@ public void testCreateNetworkAclOptions() throws Throwable { assertEquals(networkAclRulePrototypeNetworkAclContextModel.ipVersion(), "ipv4"); assertEquals(networkAclRulePrototypeNetworkAclContextModel.name(), "my-network-acl-rule"); assertEquals(networkAclRulePrototypeNetworkAclContextModel.source(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclContextModel.protocol(), "all"); + assertEquals(networkAclRulePrototypeNetworkAclContextModel.protocol(), "any"); NetworkACLPrototypeNetworkACLByRules networkAclPrototypeModel = new NetworkACLPrototypeNetworkACLByRules.Builder() .name("my-network-acl") diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptionsTest.java index 1accfdabcf..bce9b3dda7 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateNetworkAclRuleOptionsTest.java @@ -15,7 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateNetworkAclRuleOptions; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -38,7 +38,7 @@ public void testCreateNetworkAclRuleOptions() throws Throwable { .build(); assertEquals(networkAclRuleBeforePrototypeModel.id(), "r006-8daca77a-4980-4d33-8f3e-7038797be8f9"); - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Builder() + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.Builder() .action("allow") .before(networkAclRuleBeforePrototypeModel) .destination("192.168.3.2/32") @@ -46,7 +46,7 @@ public void testCreateNetworkAclRuleOptions() throws Throwable { .ipVersion("ipv4") .name("my-network-acl-rule") .source("192.168.3.2/32") - .protocol("all") + .protocol("any") .build(); assertEquals(networkAclRulePrototypeModel.action(), "allow"); assertEquals(networkAclRulePrototypeModel.before(), networkAclRuleBeforePrototypeModel); @@ -55,7 +55,7 @@ public void testCreateNetworkAclRuleOptions() throws Throwable { assertEquals(networkAclRulePrototypeModel.ipVersion(), "ipv4"); assertEquals(networkAclRulePrototypeModel.name(), "my-network-acl-rule"); assertEquals(networkAclRulePrototypeModel.source(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeModel.protocol(), "all"); + assertEquals(networkAclRulePrototypeModel.protocol(), "any"); CreateNetworkAclRuleOptions createNetworkAclRuleOptionsModel = new CreateNetworkAclRuleOptions.Builder() .networkAclId("testString") diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptionsTest.java index 5513c05210..1fe7851fc4 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupOptionsTest.java @@ -16,7 +16,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateSecurityGroupOptions; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeIP; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeIP; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -56,18 +56,20 @@ public void testCreateSecurityGroupOptions() throws Throwable { .build(); assertEquals(securityGroupRuleRemotePrototypeModel.address(), "192.168.3.4"); - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Builder() .direction("inbound") .ipVersion("ipv4") .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") .remote(securityGroupRuleRemotePrototypeModel) - .protocol("all") + .protocol("any") .build(); assertEquals(securityGroupRulePrototypeModel.direction(), "inbound"); assertEquals(securityGroupRulePrototypeModel.ipVersion(), "ipv4"); assertEquals(securityGroupRulePrototypeModel.local(), securityGroupRuleLocalPrototypeModel); + assertEquals(securityGroupRulePrototypeModel.name(), "my-rule-1"); assertEquals(securityGroupRulePrototypeModel.remote(), securityGroupRuleRemotePrototypeModel); - assertEquals(securityGroupRulePrototypeModel.protocol(), "all"); + assertEquals(securityGroupRulePrototypeModel.protocol(), "any"); CreateSecurityGroupOptions createSecurityGroupOptionsModel = new CreateSecurityGroupOptions.Builder() .vpc(vpcIdentityModel) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptionsTest.java index 0c64106ae3..5fbacc1a66 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSecurityGroupRuleOptionsTest.java @@ -15,7 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateSecurityGroupRuleOptions; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeIP; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeIP; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -44,18 +44,20 @@ public void testCreateSecurityGroupRuleOptions() throws Throwable { .build(); assertEquals(securityGroupRuleRemotePrototypeModel.address(), "192.168.3.4"); - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype securityGroupRulePrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Builder() .direction("inbound") .ipVersion("ipv4") .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") .remote(securityGroupRuleRemotePrototypeModel) - .protocol("all") + .protocol("any") .build(); assertEquals(securityGroupRulePrototypeModel.direction(), "inbound"); assertEquals(securityGroupRulePrototypeModel.ipVersion(), "ipv4"); assertEquals(securityGroupRulePrototypeModel.local(), securityGroupRuleLocalPrototypeModel); + assertEquals(securityGroupRulePrototypeModel.name(), "my-rule-1"); assertEquals(securityGroupRulePrototypeModel.remote(), securityGroupRuleRemotePrototypeModel); - assertEquals(securityGroupRulePrototypeModel.protocol(), "all"); + assertEquals(securityGroupRulePrototypeModel.protocol(), "any"); CreateSecurityGroupRuleOptions createSecurityGroupRuleOptionsModel = new CreateSecurityGroupRuleOptions.Builder() .securityGroupId("testString") diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateShareMountTargetOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateShareMountTargetOptionsTest.java index d492d82fad..39ff4d322a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateShareMountTargetOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateShareMountTargetOptionsTest.java @@ -95,10 +95,12 @@ public void testCreateShareMountTargetOptions() throws Throwable { assertEquals(shareMountTargetVirtualNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) .build(); + assertEquals(shareMountTargetPrototypeModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeModel.virtualNetworkInterface(), shareMountTargetVirtualNetworkInterfacePrototypeModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateShareOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateShareOptionsTest.java index c0bbaa9f2b..679ba56b9b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateShareOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateShareOptionsTest.java @@ -101,10 +101,12 @@ public void testCreateShareOptions() throws Throwable { assertEquals(shareMountTargetVirtualNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) .build(); + assertEquals(shareMountTargetPrototypeModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeModel.virtualNetworkInterface(), shareMountTargetVirtualNetworkInterfacePrototypeModel); @@ -120,7 +122,7 @@ public void testCreateShareOptions() throws Throwable { assertEquals(zoneIdentityModel.name(), "us-south-1"); SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .iops(Long.valueOf("100")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") @@ -130,7 +132,7 @@ public void testCreateShareOptions() throws Throwable { .userTags(java.util.Arrays.asList()) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareContextModel.iops(), Long.valueOf("100")); assertEquals(sharePrototypeShareContextModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareContextModel.name(), "my-share"); @@ -153,12 +155,14 @@ public void testCreateShareOptions() throws Throwable { assertEquals(shareInitialOwnerModel.uid(), Long.valueOf("50")); SharePrototypeShareBySize sharePrototypeModel = new SharePrototypeShareBySize.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") .replicaShare(sharePrototypeShareContextModel) .userTags(java.util.Arrays.asList()) .accessControlMode("security_group") + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .bandwidth(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .initialOwner(shareInitialOwnerModel) .iops(Long.valueOf("100")) @@ -167,12 +171,14 @@ public void testCreateShareOptions() throws Throwable { .size(Long.valueOf("200")) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeModel.name(), "my-share"); assertEquals(sharePrototypeModel.replicaShare(), sharePrototypeShareContextModel); assertEquals(sharePrototypeModel.userTags(), java.util.Arrays.asList()); assertEquals(sharePrototypeModel.accessControlMode(), "security_group"); + assertEquals(sharePrototypeModel.allowedAccessProtocols(), java.util.Arrays.asList("nfs4")); + assertEquals(sharePrototypeModel.bandwidth(), Long.valueOf("100")); assertEquals(sharePrototypeModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(sharePrototypeModel.initialOwner(), shareInitialOwnerModel); assertEquals(sharePrototypeModel.iops(), Long.valueOf("100")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptionsTest.java index 776a11a2b7..8add233eb3 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateSnapshotOptionsTest.java @@ -15,6 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.CreateSnapshotOptions; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotClonePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityById; @@ -36,6 +37,15 @@ public class CreateSnapshotOptionsTest { @Test public void testCreateSnapshotOptions() throws Throwable { + SnapshotAllowedUsePrototype snapshotAllowedUsePrototypeModel = new SnapshotAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(snapshotAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(snapshotAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(snapshotAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); @@ -57,12 +67,14 @@ public void testCreateSnapshotOptions() throws Throwable { assertEquals(volumeIdentityModel.id(), "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() + .allowedUse(snapshotAllowedUsePrototypeModel) .clones(java.util.Arrays.asList(snapshotClonePrototypeModel)) .name("my-snapshot") .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .sourceVolume(volumeIdentityModel) .build(); + assertEquals(snapshotPrototypeModel.allowedUse(), snapshotAllowedUsePrototypeModel); assertEquals(snapshotPrototypeModel.clones(), java.util.Arrays.asList(snapshotClonePrototypeModel)); assertEquals(snapshotPrototypeModel.name(), "my-snapshot"); assertEquals(snapshotPrototypeModel.resourceGroup(), resourceGroupIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayOptionsTest.java index 195787f71c..1bc739b122 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/CreateVpnGatewayOptionsTest.java @@ -48,11 +48,15 @@ public void testCreateVpnGatewayOptions() throws Throwable { .name("my-vpn-gateway") .resourceGroup(resourceGroupIdentityModel) .subnet(subnetIdentityModel) + .advertisedCidrs(java.util.Arrays.asList("192.168.3.0/24")) + .localAsn(Long.valueOf("64520")) .mode("route") .build(); assertEquals(vpnGatewayPrototypeModel.name(), "my-vpn-gateway"); assertEquals(vpnGatewayPrototypeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(vpnGatewayPrototypeModel.subnet(), subnetIdentityModel); + assertEquals(vpnGatewayPrototypeModel.advertisedCidrs(), java.util.Arrays.asList("192.168.3.0/24")); + assertEquals(vpnGatewayPrototypeModel.localAsn(), Long.valueOf("64520")); assertEquals(vpnGatewayPrototypeModel.mode(), "route"); CreateVpnGatewayOptions createVpnGatewayOptionsModel = new CreateVpnGatewayOptions.Builder() diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACLTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACLTest.java index a6f01bdfab..e11422eb47 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACLTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultNetworkACLTest.java @@ -15,7 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.DefaultNetworkACL; import com.ibm.cloud.is.vpc.v1.model.Deleted; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroupTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroupTest.java index 3dd69a4a92..7e3a380d0a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroupTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DefaultSecurityGroupTest.java @@ -17,8 +17,8 @@ import com.ibm.cloud.is.vpc.v1.model.Deleted; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalCIDR; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemoteCIDR; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleSecurityGroupRuleProtocolAll; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupTargetReferenceBareMetalServerNetworkInterfaceReferenceTargetContext; import com.ibm.cloud.is.vpc.v1.model.VPCReference; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayResourceBindingOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayResourceBindingOptionsTest.java new file mode 100644 index 0000000000..59e9c4d688 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteEndpointGatewayResourceBindingOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.DeleteEndpointGatewayResourceBindingOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the DeleteEndpointGatewayResourceBindingOptions model. + */ +public class DeleteEndpointGatewayResourceBindingOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testDeleteEndpointGatewayResourceBindingOptions() throws Throwable { + DeleteEndpointGatewayResourceBindingOptions deleteEndpointGatewayResourceBindingOptionsModel = new DeleteEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .id("testString") + .build(); + assertEquals(deleteEndpointGatewayResourceBindingOptionsModel.endpointGatewayId(), "testString"); + assertEquals(deleteEndpointGatewayResourceBindingOptionsModel.id(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDeleteEndpointGatewayResourceBindingOptionsError() throws Throwable { + new DeleteEndpointGatewayResourceBindingOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteVirtualNetworkInterfacesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteVirtualNetworkInterfacesOptionsTest.java index c666d614a7..cc05e8fa12 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteVirtualNetworkInterfacesOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteVirtualNetworkInterfacesOptionsTest.java @@ -33,8 +33,10 @@ public class DeleteVirtualNetworkInterfacesOptionsTest { public void testDeleteVirtualNetworkInterfacesOptions() throws Throwable { DeleteVirtualNetworkInterfacesOptions deleteVirtualNetworkInterfacesOptionsModel = new DeleteVirtualNetworkInterfacesOptions.Builder() .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); assertEquals(deleteVirtualNetworkInterfacesOptionsModel.id(), "testString"); + assertEquals(deleteVirtualNetworkInterfacesOptionsModel.ifMatch(), "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\""); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptionsTest.java index 3658a348f0..9898ab01cb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/DeleteVpnGatewayConnectionOptionsTest.java @@ -34,9 +34,11 @@ public void testDeleteVpnGatewayConnectionOptions() throws Throwable { DeleteVpnGatewayConnectionOptions deleteVpnGatewayConnectionOptionsModel = new DeleteVpnGatewayConnectionOptions.Builder() .vpnGatewayId("testString") .id("testString") + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); assertEquals(deleteVpnGatewayConnectionOptionsModel.vpnGatewayId(), "testString"); assertEquals(deleteVpnGatewayConnectionOptionsModel.id(), "testString"); + assertEquals(deleteVpnGatewayConnectionOptionsModel.ifMatch(), "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\""); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatchTest.java index 6b99076766..8d6ee102d2 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayPatchTest.java @@ -33,29 +33,29 @@ public class EndpointGatewayPatchTest { @Test public void testEndpointGatewayPatch() throws Throwable { EndpointGatewayPatch endpointGatewayPatchModel = new EndpointGatewayPatch.Builder() - .allowDnsResolutionBinding(true) + .dnsResolutionBindingMode("primary") .name("my-endpoint-gateway") .build(); - assertEquals(endpointGatewayPatchModel.allowDnsResolutionBinding(), Boolean.valueOf(true)); + assertEquals(endpointGatewayPatchModel.dnsResolutionBindingMode(), "primary"); assertEquals(endpointGatewayPatchModel.name(), "my-endpoint-gateway"); String json = TestUtilities.serialize(endpointGatewayPatchModel); EndpointGatewayPatch endpointGatewayPatchModelNew = TestUtilities.deserialize(json, EndpointGatewayPatch.class); assertTrue(endpointGatewayPatchModelNew instanceof EndpointGatewayPatch); - assertEquals(endpointGatewayPatchModelNew.allowDnsResolutionBinding(), Boolean.valueOf(true)); + assertEquals(endpointGatewayPatchModelNew.dnsResolutionBindingMode(), "primary"); assertEquals(endpointGatewayPatchModelNew.name(), "my-endpoint-gateway"); } @Test public void testEndpointGatewayPatchAsPatch() throws Throwable { EndpointGatewayPatch endpointGatewayPatchModel = new EndpointGatewayPatch.Builder() - .allowDnsResolutionBinding(true) + .dnsResolutionBindingMode("primary") .name("my-endpoint-gateway") .build(); Map mergePatch = endpointGatewayPatchModel.asPatch(); - assertTrue(mergePatch.containsKey("allow_dns_resolution_binding")); + assertEquals(mergePatch.get("dns_resolution_binding_mode"), "primary"); assertEquals(mergePatch.get("name"), "my-endpoint-gateway"); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingCollectionTest.java new file mode 100644 index 0000000000..2a30a6bd98 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingCollectionTest.java @@ -0,0 +1,46 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBinding; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingCollection; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetCRN; +import com.ibm.cloud.is.vpc.v1.model.PageLink; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EndpointGatewayResourceBindingCollection model. + */ +public class EndpointGatewayResourceBindingCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEndpointGatewayResourceBindingCollection() throws Throwable { + EndpointGatewayResourceBindingCollection endpointGatewayResourceBindingCollectionModel = new EndpointGatewayResourceBindingCollection(); + assertNull(endpointGatewayResourceBindingCollectionModel.getFirst()); + assertNull(endpointGatewayResourceBindingCollectionModel.getLimit()); + assertNull(endpointGatewayResourceBindingCollectionModel.getNext()); + assertNull(endpointGatewayResourceBindingCollectionModel.getResourceBindings()); + assertNull(endpointGatewayResourceBindingCollectionModel.getTotalCount()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingLifecycleReasonTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingLifecycleReasonTest.java new file mode 100644 index 0000000000..9ab0abad7c --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingLifecycleReasonTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingLifecycleReason; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EndpointGatewayResourceBindingLifecycleReason model. + */ +public class EndpointGatewayResourceBindingLifecycleReasonTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEndpointGatewayResourceBindingLifecycleReason() throws Throwable { + EndpointGatewayResourceBindingLifecycleReason endpointGatewayResourceBindingLifecycleReasonModel = new EndpointGatewayResourceBindingLifecycleReason(); + assertNull(endpointGatewayResourceBindingLifecycleReasonModel.getCode()); + assertNull(endpointGatewayResourceBindingLifecycleReasonModel.getMessage()); + assertNull(endpointGatewayResourceBindingLifecycleReasonModel.getMoreInfo()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingPatchTest.java new file mode 100644 index 0000000000..42fdcd8ffa --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingPatchTest.java @@ -0,0 +1,57 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingPatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EndpointGatewayResourceBindingPatch model. + */ +public class EndpointGatewayResourceBindingPatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEndpointGatewayResourceBindingPatch() throws Throwable { + EndpointGatewayResourceBindingPatch endpointGatewayResourceBindingPatchModel = new EndpointGatewayResourceBindingPatch.Builder() + .name("my-resource-binding-updated") + .build(); + assertEquals(endpointGatewayResourceBindingPatchModel.name(), "my-resource-binding-updated"); + + String json = TestUtilities.serialize(endpointGatewayResourceBindingPatchModel); + + EndpointGatewayResourceBindingPatch endpointGatewayResourceBindingPatchModelNew = TestUtilities.deserialize(json, EndpointGatewayResourceBindingPatch.class); + assertTrue(endpointGatewayResourceBindingPatchModelNew instanceof EndpointGatewayResourceBindingPatch); + assertEquals(endpointGatewayResourceBindingPatchModelNew.name(), "my-resource-binding-updated"); + } + @Test + public void testEndpointGatewayResourceBindingPatchAsPatch() throws Throwable { + EndpointGatewayResourceBindingPatch endpointGatewayResourceBindingPatchModel = new EndpointGatewayResourceBindingPatch.Builder() + .name("my-resource-binding-updated") + .build(); + + Map mergePatch = endpointGatewayResourceBindingPatchModel.asPatch(); + + assertEquals(mergePatch.get("name"), "my-resource-binding-updated"); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetCRNTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetCRNTest.java new file mode 100644 index 0000000000..ad041e00f5 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetCRNTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetCRN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EndpointGatewayResourceBindingTargetCRN model. + */ +public class EndpointGatewayResourceBindingTargetCRNTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEndpointGatewayResourceBindingTargetCRN() throws Throwable { + EndpointGatewayResourceBindingTargetCRN endpointGatewayResourceBindingTargetCrnModel = new EndpointGatewayResourceBindingTargetCRN(); + assertNull(endpointGatewayResourceBindingTargetCrnModel.getCrn()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRNTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRNTest.java new file mode 100644 index 0000000000..e0e2e06e59 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRNTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN model. + */ +public class EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRNTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN() throws Throwable { + EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrnModel = new EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.Builder() + .crn("crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue") + .build(); + assertEquals(endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrnModel.crn(), "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"); + + String json = TestUtilities.serialize(endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrnModel); + + EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrnModelNew = TestUtilities.deserialize(json, EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.class); + assertTrue(endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrnModelNew instanceof EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN); + assertEquals(endpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCrnModelNew.crn(), "crn:v1:bluemix:public:cloud-object-storage:global:a/aa2432b1fa4d4ace891e9b80fc104e34:1a0ec336-f391-4091-a6fb-5e084a4c56f4:bucket:bucket-27200-lwx4cfvcue"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testEndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRNError() throws Throwable { + new EndpointGatewayResourceBindingTargetPrototypeEndpointGatewayResourceBindingTargetByCRN.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeTest.java similarity index 58% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeTest.java index 92b2773aab..b80d309783 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetPrototypeTest.java @@ -13,8 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionGroupPrototype; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetPrototype; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -24,16 +23,16 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec model. + * Unit test class for the EndpointGatewayResourceBindingTargetPrototype model. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecTest { +public class EndpointGatewayResourceBindingTargetPrototypeTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); // TODO: Add tests for models that are abstract @Test - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec() throws Throwable { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(); - assertNotNull(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecModel); + public void testEndpointGatewayResourceBindingTargetPrototype() throws Throwable { + EndpointGatewayResourceBindingTargetPrototype endpointGatewayResourceBindingTargetPrototypeModel = new EndpointGatewayResourceBindingTargetPrototype(); + assertNotNull(endpointGatewayResourceBindingTargetPrototypeModel); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetTest.java similarity index 58% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetTest.java index 6acc464cd3..b59e271cec 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTargetTest.java @@ -13,11 +13,9 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionGroupPrototype; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTarget; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; import java.io.InputStream; import java.util.HashMap; import java.util.List; @@ -25,16 +23,16 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt model. + * Unit test class for the EndpointGatewayResourceBindingTarget model. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtTest { +public class EndpointGatewayResourceBindingTargetTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); // TODO: Add tests for models that are abstract @Test - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt() throws Throwable { - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(); - assertNotNull(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtModel); + public void testEndpointGatewayResourceBindingTarget() throws Throwable { + EndpointGatewayResourceBindingTarget endpointGatewayResourceBindingTargetModel = new EndpointGatewayResourceBindingTarget(); + assertNotNull(endpointGatewayResourceBindingTargetModel); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTest.java new file mode 100644 index 0000000000..56a2a07c8d --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayResourceBindingTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBinding; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.EndpointGatewayResourceBindingTargetCRN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the EndpointGatewayResourceBinding model. + */ +public class EndpointGatewayResourceBindingTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testEndpointGatewayResourceBinding() throws Throwable { + EndpointGatewayResourceBinding endpointGatewayResourceBindingModel = new EndpointGatewayResourceBinding(); + assertNull(endpointGatewayResourceBindingModel.getCreatedAt()); + assertNull(endpointGatewayResourceBindingModel.getHref()); + assertNull(endpointGatewayResourceBindingModel.getId()); + assertNull(endpointGatewayResourceBindingModel.getLifecycleReasons()); + assertNull(endpointGatewayResourceBindingModel.getLifecycleState()); + assertNull(endpointGatewayResourceBindingModel.getName()); + assertNull(endpointGatewayResourceBindingModel.getResourceType()); + assertNull(endpointGatewayResourceBindingModel.getServiceEndpoint()); + assertNull(endpointGatewayResourceBindingModel.getTarget()); + assertNull(endpointGatewayResourceBindingModel.getType()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTest.java index e1bbd20043..88622bca86 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/EndpointGatewayTest.java @@ -42,9 +42,9 @@ public class EndpointGatewayTest { @Test public void testEndpointGateway() throws Throwable { EndpointGateway endpointGatewayModel = new EndpointGateway(); - assertNull(endpointGatewayModel.isAllowDnsResolutionBinding()); assertNull(endpointGatewayModel.getCreatedAt()); assertNull(endpointGatewayModel.getCrn()); + assertNull(endpointGatewayModel.getDnsResolutionBindingMode()); assertNull(endpointGatewayModel.getHealthState()); assertNull(endpointGatewayModel.getHref()); assertNull(endpointGatewayModel.getId()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayResourceBindingOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayResourceBindingOptionsTest.java new file mode 100644 index 0000000000..4a0cc43493 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetEndpointGatewayResourceBindingOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.GetEndpointGatewayResourceBindingOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetEndpointGatewayResourceBindingOptions model. + */ +public class GetEndpointGatewayResourceBindingOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetEndpointGatewayResourceBindingOptions() throws Throwable { + GetEndpointGatewayResourceBindingOptions getEndpointGatewayResourceBindingOptionsModel = new GetEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .id("testString") + .build(); + assertEquals(getEndpointGatewayResourceBindingOptionsModel.endpointGatewayId(), "testString"); + assertEquals(getEndpointGatewayResourceBindingOptionsModel.id(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetEndpointGatewayResourceBindingOptionsError() throws Throwable { + new GetEndpointGatewayResourceBindingOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayServiceConnectionOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayServiceConnectionOptionsTest.java new file mode 100644 index 0000000000..03625cc6db --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/GetVpnGatewayServiceConnectionOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.GetVpnGatewayServiceConnectionOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the GetVpnGatewayServiceConnectionOptions model. + */ +public class GetVpnGatewayServiceConnectionOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testGetVpnGatewayServiceConnectionOptions() throws Throwable { + GetVpnGatewayServiceConnectionOptions getVpnGatewayServiceConnectionOptionsModel = new GetVpnGatewayServiceConnectionOptions.Builder() + .vpnGatewayId("testString") + .id("testString") + .build(); + assertEquals(getVpnGatewayServiceConnectionOptionsModel.vpnGatewayId(), "testString"); + assertEquals(getVpnGatewayServiceConnectionOptionsModel.id(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetVpnGatewayServiceConnectionOptionsError() throws Throwable { + new GetVpnGatewayServiceConnectionOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePatchTest.java new file mode 100644 index 0000000000..ca0a661970 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePatchTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ImageAllowedUsePatch model. + */ +public class ImageAllowedUsePatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImageAllowedUsePatch() throws Throwable { + ImageAllowedUsePatch imageAllowedUsePatchModel = new ImageAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(imageAllowedUsePatchModel.apiVersion(), "2024-06-23"); + assertEquals(imageAllowedUsePatchModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(imageAllowedUsePatchModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + + String json = TestUtilities.serialize(imageAllowedUsePatchModel); + + ImageAllowedUsePatch imageAllowedUsePatchModelNew = TestUtilities.deserialize(json, ImageAllowedUsePatch.class); + assertTrue(imageAllowedUsePatchModelNew instanceof ImageAllowedUsePatch); + assertEquals(imageAllowedUsePatchModelNew.apiVersion(), "2024-06-23"); + assertEquals(imageAllowedUsePatchModelNew.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(imageAllowedUsePatchModelNew.instance(), "gpu.count > 0 && enable_secure_boot == true"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePrototypeTest.java new file mode 100644 index 0000000000..8f2d1050eb --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUsePrototypeTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ImageAllowedUsePrototype model. + */ +public class ImageAllowedUsePrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImageAllowedUsePrototype() throws Throwable { + ImageAllowedUsePrototype imageAllowedUsePrototypeModel = new ImageAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(imageAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(imageAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(imageAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + + String json = TestUtilities.serialize(imageAllowedUsePrototypeModel); + + ImageAllowedUsePrototype imageAllowedUsePrototypeModelNew = TestUtilities.deserialize(json, ImageAllowedUsePrototype.class); + assertTrue(imageAllowedUsePrototypeModelNew instanceof ImageAllowedUsePrototype); + assertEquals(imageAllowedUsePrototypeModelNew.apiVersion(), "2024-06-23"); + assertEquals(imageAllowedUsePrototypeModelNew.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(imageAllowedUsePrototypeModelNew.instance(), "gpu.count > 0 && enable_secure_boot == true"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUseTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUseTest.java new file mode 100644 index 0000000000..b4399cb9f5 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageAllowedUseTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUse; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ImageAllowedUse model. + */ +public class ImageAllowedUseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImageAllowedUse() throws Throwable { + ImageAllowedUse imageAllowedUseModel = new ImageAllowedUse(); + assertNull(imageAllowedUseModel.getApiVersion()); + assertNull(imageAllowedUseModel.getBareMetalServer()); + assertNull(imageAllowedUseModel.getInstance()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfileCollectionTest.java new file mode 100644 index 0000000000..fe879818b5 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageBareMetalServerProfileCollectionTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerProfileReference; +import com.ibm.cloud.is.vpc.v1.model.ImageBareMetalServerProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.PageLink; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ImageBareMetalServerProfileCollection model. + */ +public class ImageBareMetalServerProfileCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImageBareMetalServerProfileCollection() throws Throwable { + ImageBareMetalServerProfileCollection imageBareMetalServerProfileCollectionModel = new ImageBareMetalServerProfileCollection(); + assertNull(imageBareMetalServerProfileCollectionModel.getBareMetalServerProfiles()); + assertNull(imageBareMetalServerProfileCollectionModel.getFirst()); + assertNull(imageBareMetalServerProfileCollectionModel.getLimit()); + assertNull(imageBareMetalServerProfileCollectionModel.getNext()); + assertNull(imageBareMetalServerProfileCollectionModel.getTotalCount()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionTest.java index f23a9798f9..554a4aad0f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageCollectionTest.java @@ -18,6 +18,7 @@ import com.ibm.cloud.is.vpc.v1.model.Deleted; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUse; import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.ImageCollection; import com.ibm.cloud.is.vpc.v1.model.ImageFile; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfileCollectionTest.java new file mode 100644 index 0000000000..19d11b16a1 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageInstanceProfileCollectionTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ImageInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileReference; +import com.ibm.cloud.is.vpc.v1.model.PageLink; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ImageInstanceProfileCollection model. + */ +public class ImageInstanceProfileCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testImageInstanceProfileCollection() throws Throwable { + ImageInstanceProfileCollection imageInstanceProfileCollectionModel = new ImageInstanceProfileCollection(); + assertNull(imageInstanceProfileCollectionModel.getFirst()); + assertNull(imageInstanceProfileCollectionModel.getInstanceProfiles()); + assertNull(imageInstanceProfileCollectionModel.getLimit()); + assertNull(imageInstanceProfileCollectionModel.getNext()); + assertNull(imageInstanceProfileCollectionModel.getTotalCount()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePatchTest.java index 435a9f484f..dd3127ac9e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePatchTest.java @@ -13,6 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePatch; import com.ibm.cloud.is.vpc.v1.model.ImagePatch; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -33,11 +34,22 @@ public class ImagePatchTest { @Test public void testImagePatch() throws Throwable { + ImageAllowedUsePatch imageAllowedUsePatchModel = new ImageAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(imageAllowedUsePatchModel.apiVersion(), "2024-06-23"); + assertEquals(imageAllowedUsePatchModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(imageAllowedUsePatchModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + ImagePatch imagePatchModel = new ImagePatch.Builder() + .allowedUse(imageAllowedUsePatchModel) .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .name("my-image") .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .build(); + assertEquals(imagePatchModel.allowedUse(), imageAllowedUsePatchModel); assertEquals(imagePatchModel.deprecationAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); assertEquals(imagePatchModel.name(), "my-image"); assertEquals(imagePatchModel.obsolescenceAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); @@ -46,13 +58,21 @@ public void testImagePatch() throws Throwable { ImagePatch imagePatchModelNew = TestUtilities.deserialize(json, ImagePatch.class); assertTrue(imagePatchModelNew instanceof ImagePatch); + assertEquals(imagePatchModelNew.allowedUse().toString(), imageAllowedUsePatchModel.toString()); assertEquals(imagePatchModelNew.deprecationAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); assertEquals(imagePatchModelNew.name(), "my-image"); assertEquals(imagePatchModelNew.obsolescenceAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); } @Test public void testImagePatchAsPatch() throws Throwable { + ImageAllowedUsePatch imageAllowedUsePatchModel = new ImageAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + ImagePatch imagePatchModel = new ImagePatch.Builder() + .allowedUse(imageAllowedUsePatchModel) .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .name("my-image") .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) @@ -60,6 +80,7 @@ public void testImagePatchAsPatch() throws Throwable { Map mergePatch = imagePatchModel.asPatch(); + assertTrue(mergePatch.containsKey("allowed_use")); assertTrue(mergePatch.containsKey("deprecation_at")); assertEquals(mergePatch.get("name"), "my-image"); assertTrue(mergePatch.containsKey("obsolescence_at")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFileTest.java index 28edf1bb7d..bf078d5e84 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFileTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageByFileTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.ImageFilePrototype; import com.ibm.cloud.is.vpc.v1.model.ImagePrototypeImageByFile; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemIdentityByName; @@ -36,6 +37,15 @@ public class ImagePrototypeImageByFileTest { @Test public void testImagePrototypeImageByFile() throws Throwable { + ImageAllowedUsePrototype imageAllowedUsePrototypeModel = new ImageAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(imageAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(imageAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(imageAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); @@ -57,6 +67,7 @@ public void testImagePrototypeImageByFile() throws Throwable { assertEquals(operatingSystemIdentityModel.name(), "ubuntu-24-04-amd64"); ImagePrototypeImageByFile imagePrototypeImageByFileModel = new ImagePrototypeImageByFile.Builder() + .allowedUse(imageAllowedUsePrototypeModel) .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .name("my-image") .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) @@ -66,6 +77,7 @@ public void testImagePrototypeImageByFile() throws Throwable { .file(imageFilePrototypeModel) .operatingSystem(operatingSystemIdentityModel) .build(); + assertEquals(imagePrototypeImageByFileModel.allowedUse(), imageAllowedUsePrototypeModel); assertEquals(imagePrototypeImageByFileModel.deprecationAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); assertEquals(imagePrototypeImageByFileModel.name(), "my-image"); assertEquals(imagePrototypeImageByFileModel.obsolescenceAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); @@ -79,6 +91,7 @@ public void testImagePrototypeImageByFile() throws Throwable { ImagePrototypeImageByFile imagePrototypeImageByFileModelNew = TestUtilities.deserialize(json, ImagePrototypeImageByFile.class); assertTrue(imagePrototypeImageByFileModelNew instanceof ImagePrototypeImageByFile); + assertEquals(imagePrototypeImageByFileModelNew.allowedUse().toString(), imageAllowedUsePrototypeModel.toString()); assertEquals(imagePrototypeImageByFileModelNew.deprecationAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); assertEquals(imagePrototypeImageByFileModelNew.name(), "my-image"); assertEquals(imagePrototypeImageByFileModelNew.obsolescenceAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolumeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolumeTest.java index 284e897892..3ee3ca2d6f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolumeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeImageBySourceVolumeTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.ImagePrototypeImageBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityById; @@ -35,6 +36,15 @@ public class ImagePrototypeImageBySourceVolumeTest { @Test public void testImagePrototypeImageBySourceVolume() throws Throwable { + ImageAllowedUsePrototype imageAllowedUsePrototypeModel = new ImageAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(imageAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(imageAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(imageAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + ResourceGroupIdentityById resourceGroupIdentityModel = new ResourceGroupIdentityById.Builder() .id("fee82deba12e4c0fb69c3b09d1f12345") .build(); @@ -51,6 +61,7 @@ public void testImagePrototypeImageBySourceVolume() throws Throwable { assertEquals(volumeIdentityModel.id(), "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); ImagePrototypeImageBySourceVolume imagePrototypeImageBySourceVolumeModel = new ImagePrototypeImageBySourceVolume.Builder() + .allowedUse(imageAllowedUsePrototypeModel) .deprecationAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .name("my-image") .obsolescenceAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) @@ -58,6 +69,7 @@ public void testImagePrototypeImageBySourceVolume() throws Throwable { .encryptionKey(encryptionKeyIdentityModel) .sourceVolume(volumeIdentityModel) .build(); + assertEquals(imagePrototypeImageBySourceVolumeModel.allowedUse(), imageAllowedUsePrototypeModel); assertEquals(imagePrototypeImageBySourceVolumeModel.deprecationAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); assertEquals(imagePrototypeImageBySourceVolumeModel.name(), "my-image"); assertEquals(imagePrototypeImageBySourceVolumeModel.obsolescenceAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); @@ -69,6 +81,7 @@ public void testImagePrototypeImageBySourceVolume() throws Throwable { ImagePrototypeImageBySourceVolume imagePrototypeImageBySourceVolumeModelNew = TestUtilities.deserialize(json, ImagePrototypeImageBySourceVolume.class); assertTrue(imagePrototypeImageBySourceVolumeModelNew instanceof ImagePrototypeImageBySourceVolume); + assertEquals(imagePrototypeImageBySourceVolumeModelNew.allowedUse().toString(), imageAllowedUsePrototypeModel.toString()); assertEquals(imagePrototypeImageBySourceVolumeModelNew.deprecationAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); assertEquals(imagePrototypeImageBySourceVolumeModelNew.name(), "my-image"); assertEquals(imagePrototypeImageBySourceVolumeModelNew.obsolescenceAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeTest.java index 459b250bbb..ff0e85f5c1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImagePrototypeTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.ImageFilePrototype; import com.ibm.cloud.is.vpc.v1.model.ImagePrototype; import com.ibm.cloud.is.vpc.v1.model.OperatingSystemIdentityByName; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageTest.java index c38ea3e845..369e658bc0 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ImageTest.java @@ -18,6 +18,7 @@ import com.ibm.cloud.is.vpc.v1.model.Deleted; import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyReference; import com.ibm.cloud.is.vpc.v1.model.Image; +import com.ibm.cloud.is.vpc.v1.model.ImageAllowedUse; import com.ibm.cloud.is.vpc.v1.model.ImageCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.ImageFile; import com.ibm.cloud.is.vpc.v1.model.ImageFileChecksums; @@ -46,6 +47,7 @@ public class ImageTest { @Test public void testImage() throws Throwable { Image imageModel = new Image(); + assertNull(imageModel.getAllowedUse()); assertNull(imageModel.getCatalogOffering()); assertNull(imageModel.getCreatedAt()); assertNull(imageModel.getCrn()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionTest.java index 96c59c48e9..3fefc85c83 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceCollectionTest.java @@ -28,6 +28,8 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceDisk; import com.ibm.cloud.is.vpc.v1.model.InstanceGPU; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipReferenceInstanceContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReference; import com.ibm.cloud.is.vpc.v1.model.InstanceHealthReason; import com.ibm.cloud.is.vpc.v1.model.InstanceLifecycleReason; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataService; @@ -37,6 +39,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinity; import com.ibm.cloud.is.vpc.v1.model.InstanceStatusReason; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUBurst; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReference; import com.ibm.cloud.is.vpc.v1.model.PageLink; import com.ibm.cloud.is.vpc.v1.model.RegionReference; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupTest.java similarity index 66% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupTest.java index 4867fcbd90..92ef87bac9 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupTest.java @@ -13,7 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionGroupPrototype; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -24,40 +24,40 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup model. + * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup model. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupTest { +public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup() throws Throwable { + public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup() throws Throwable { InstanceGroupManagerScheduledActionGroupPrototype instanceGroupManagerScheduledActionGroupPrototypeModel = new InstanceGroupManagerScheduledActionGroupPrototype.Builder() .membershipCount(Long.valueOf("10")) .build(); assertEquals(instanceGroupManagerScheduledActionGroupPrototypeModel.membershipCount(), Long.valueOf("10")); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.Builder() + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.Builder() .name("my-instance-group-manager-action") .cronSpec("30 */2 * * 1-5") .group(instanceGroupManagerScheduledActionGroupPrototypeModel) .build(); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModel.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModel.cronSpec(), "30 */2 * * 1-5"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModel.group(), instanceGroupManagerScheduledActionGroupPrototypeModel); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModel.name(), "my-instance-group-manager-action"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModel.cronSpec(), "30 */2 * * 1-5"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModel.group(), instanceGroupManagerScheduledActionGroupPrototypeModel); - String json = TestUtilities.serialize(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModel); + String json = TestUtilities.serialize(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModel); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModelNew = TestUtilities.deserialize(json, InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.class); - assertTrue(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModelNew instanceof InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModelNew.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModelNew.cronSpec(), "30 */2 * * 1-5"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupModelNew.group().toString(), instanceGroupManagerScheduledActionGroupPrototypeModel.toString()); + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModelNew = TestUtilities.deserialize(json, InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.class); + assertTrue(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModelNew instanceof InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModelNew.name(), "my-instance-group-manager-action"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModelNew.cronSpec(), "30 */2 * * 1-5"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupModelNew.group().toString(), instanceGroupManagerScheduledActionGroupPrototypeModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroupError() throws Throwable { - new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.Builder().build(); + public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroupError() throws Throwable { + new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithGroup.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerTest.java similarity index 68% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerTest.java index ae9daff1df..b72db48a65 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerTest.java @@ -13,7 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -24,14 +24,14 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager model. + * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager model. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerTest { +public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager() throws Throwable { + public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager() throws Throwable { InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById instanceGroupManagerScheduledActionManagerPrototypeModel = new InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.Builder() .maxMembershipCount(Long.valueOf("10")) .minMembershipCount(Long.valueOf("10")) @@ -41,27 +41,27 @@ public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCro assertEquals(instanceGroupManagerScheduledActionManagerPrototypeModel.minMembershipCount(), Long.valueOf("10")); assertEquals(instanceGroupManagerScheduledActionManagerPrototypeModel.id(), "r006-bd21f31f-8a05-4451-836d-ab0347e91fea"); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.Builder() + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.Builder() .name("my-instance-group-manager-action") .cronSpec("30 */2 * * 1-5") .manager(instanceGroupManagerScheduledActionManagerPrototypeModel) .build(); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModel.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModel.cronSpec(), "30 */2 * * 1-5"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModel.manager(), instanceGroupManagerScheduledActionManagerPrototypeModel); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModel.name(), "my-instance-group-manager-action"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModel.cronSpec(), "30 */2 * * 1-5"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModel.manager(), instanceGroupManagerScheduledActionManagerPrototypeModel); - String json = TestUtilities.serialize(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModel); + String json = TestUtilities.serialize(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModel); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModelNew = TestUtilities.deserialize(json, InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.class); - assertTrue(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModelNew instanceof InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModelNew.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModelNew.cronSpec(), "30 */2 * * 1-5"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerModelNew.manager().toString(), instanceGroupManagerScheduledActionManagerPrototypeModel.toString()); + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModelNew = TestUtilities.deserialize(json, InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.class); + assertTrue(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModelNew instanceof InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModelNew.name(), "my-instance-group-manager-action"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModelNew.cronSpec(), "30 */2 * * 1-5"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerModelNew.manager().toString(), instanceGroupManagerScheduledActionManagerPrototypeModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManagerError() throws Throwable { - new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.Builder().build(); + public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManagerError() throws Throwable { + new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecWithManager.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupTest.java similarity index 66% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupTest.java index 3e74b0e95c..6a8c063ae2 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupTest.java @@ -13,7 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionGroupPrototype; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -25,40 +25,40 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup model. + * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup model. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupTest { +public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup() throws Throwable { + public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup() throws Throwable { InstanceGroupManagerScheduledActionGroupPrototype instanceGroupManagerScheduledActionGroupPrototypeModel = new InstanceGroupManagerScheduledActionGroupPrototype.Builder() .membershipCount(Long.valueOf("10")) .build(); assertEquals(instanceGroupManagerScheduledActionGroupPrototypeModel.membershipCount(), Long.valueOf("10")); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.Builder() + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.Builder() .name("my-instance-group-manager-action") - .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .group(instanceGroupManagerScheduledActionGroupPrototypeModel) + .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .build(); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModel.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModel.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModel.group(), instanceGroupManagerScheduledActionGroupPrototypeModel); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModel.name(), "my-instance-group-manager-action"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModel.group(), instanceGroupManagerScheduledActionGroupPrototypeModel); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModel.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - String json = TestUtilities.serialize(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModel); + String json = TestUtilities.serialize(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModel); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModelNew = TestUtilities.deserialize(json, InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.class); - assertTrue(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModelNew instanceof InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModelNew.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModelNew.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupModelNew.group().toString(), instanceGroupManagerScheduledActionGroupPrototypeModel.toString()); + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModelNew = TestUtilities.deserialize(json, InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.class); + assertTrue(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModelNew instanceof InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModelNew.name(), "my-instance-group-manager-action"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModelNew.group().toString(), instanceGroupManagerScheduledActionGroupPrototypeModel.toString()); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupModelNew.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroupError() throws Throwable { - new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.Builder().build(); + public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroupError() throws Throwable { + new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithGroup.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerTest.java similarity index 68% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerTest.java index 94c8ea0c9c..5af485c2ec 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerTest.java @@ -13,7 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager; import com.ibm.cloud.is.vpc.v1.model.InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -25,14 +25,14 @@ import static org.testng.Assert.*; /** - * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager model. + * Unit test class for the InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager model. */ -public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerTest { +public class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager() throws Throwable { + public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager() throws Throwable { InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById instanceGroupManagerScheduledActionManagerPrototypeModel = new InstanceGroupManagerScheduledActionManagerPrototypeAutoScalePrototypeById.Builder() .maxMembershipCount(Long.valueOf("10")) .minMembershipCount(Long.valueOf("10")) @@ -42,27 +42,27 @@ public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRun assertEquals(instanceGroupManagerScheduledActionManagerPrototypeModel.minMembershipCount(), Long.valueOf("10")); assertEquals(instanceGroupManagerScheduledActionManagerPrototypeModel.id(), "r006-bd21f31f-8a05-4451-836d-ab0347e91fea"); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.Builder() + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModel = new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.Builder() .name("my-instance-group-manager-action") - .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .manager(instanceGroupManagerScheduledActionManagerPrototypeModel) + .runAt(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) .build(); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModel.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModel.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModel.manager(), instanceGroupManagerScheduledActionManagerPrototypeModel); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModel.name(), "my-instance-group-manager-action"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModel.manager(), instanceGroupManagerScheduledActionManagerPrototypeModel); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModel.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - String json = TestUtilities.serialize(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModel); + String json = TestUtilities.serialize(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModel); - InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModelNew = TestUtilities.deserialize(json, InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.class); - assertTrue(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModelNew instanceof InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModelNew.name(), "my-instance-group-manager-action"); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModelNew.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerModelNew.manager().toString(), instanceGroupManagerScheduledActionManagerPrototypeModel.toString()); + InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModelNew = TestUtilities.deserialize(json, InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.class); + assertTrue(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModelNew instanceof InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModelNew.name(), "my-instance-group-manager-action"); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModelNew.manager().toString(), instanceGroupManagerScheduledActionManagerPrototypeModel.toString()); + assertEquals(instanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerModelNew.runAt(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManagerError() throws Throwable { - new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.Builder().build(); + public void testInstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManagerError() throws Throwable { + new InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtWithManager.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPatchTest.java index 63f913d452..40d2c27eba 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPatchTest.java @@ -34,11 +34,11 @@ public class InstanceGroupManagerPolicyPatchTest { public void testInstanceGroupManagerPolicyPatch() throws Throwable { InstanceGroupManagerPolicyPatch instanceGroupManagerPolicyPatchModel = new InstanceGroupManagerPolicyPatch.Builder() .metricType("cpu") - .metricValue(Long.valueOf("26")) + .metricValue(Long.valueOf("0")) .name("my-instance-group-manager-policy") .build(); assertEquals(instanceGroupManagerPolicyPatchModel.metricType(), "cpu"); - assertEquals(instanceGroupManagerPolicyPatchModel.metricValue(), Long.valueOf("26")); + assertEquals(instanceGroupManagerPolicyPatchModel.metricValue(), Long.valueOf("0")); assertEquals(instanceGroupManagerPolicyPatchModel.name(), "my-instance-group-manager-policy"); String json = TestUtilities.serialize(instanceGroupManagerPolicyPatchModel); @@ -46,14 +46,14 @@ public void testInstanceGroupManagerPolicyPatch() throws Throwable { InstanceGroupManagerPolicyPatch instanceGroupManagerPolicyPatchModelNew = TestUtilities.deserialize(json, InstanceGroupManagerPolicyPatch.class); assertTrue(instanceGroupManagerPolicyPatchModelNew instanceof InstanceGroupManagerPolicyPatch); assertEquals(instanceGroupManagerPolicyPatchModelNew.metricType(), "cpu"); - assertEquals(instanceGroupManagerPolicyPatchModelNew.metricValue(), Long.valueOf("26")); + assertEquals(instanceGroupManagerPolicyPatchModelNew.metricValue(), Long.valueOf("0")); assertEquals(instanceGroupManagerPolicyPatchModelNew.name(), "my-instance-group-manager-policy"); } @Test public void testInstanceGroupManagerPolicyPatchAsPatch() throws Throwable { InstanceGroupManagerPolicyPatch instanceGroupManagerPolicyPatchModel = new InstanceGroupManagerPolicyPatch.Builder() .metricType("cpu") - .metricValue(Long.valueOf("26")) + .metricValue(Long.valueOf("0")) .name("my-instance-group-manager-policy") .build(); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeTest.java index 6177071665..273fc11973 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeTest.java @@ -34,12 +34,12 @@ public void testInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPol InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModel = new InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.Builder() .name("my-instance-group-manager-policy") .metricType("cpu") - .metricValue(Long.valueOf("26")) + .metricValue(Long.valueOf("0")) .policyType("target") .build(); assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModel.name(), "my-instance-group-manager-policy"); assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModel.metricType(), "cpu"); - assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModel.metricValue(), Long.valueOf("26")); + assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModel.metricValue(), Long.valueOf("0")); assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModel.policyType(), "target"); String json = TestUtilities.serialize(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModel); @@ -48,7 +48,7 @@ public void testInstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPol assertTrue(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModelNew instanceof InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype); assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModelNew.name(), "my-instance-group-manager-policy"); assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModelNew.metricType(), "cpu"); - assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModelNew.metricValue(), Long.valueOf("26")); + assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModelNew.metricValue(), Long.valueOf("0")); assertEquals(instanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototypeModelNew.policyType(), "target"); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipReferenceInstanceContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipReferenceInstanceContextTest.java new file mode 100644 index 0000000000..f31ded7982 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceGroupMembershipReferenceInstanceContextTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.Deleted; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipReferenceInstanceContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReference; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceGroupMembershipReferenceInstanceContext model. + */ +public class InstanceGroupMembershipReferenceInstanceContextTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceGroupMembershipReferenceInstanceContext() throws Throwable { + InstanceGroupMembershipReferenceInstanceContext instanceGroupMembershipReferenceInstanceContextModel = new InstanceGroupMembershipReferenceInstanceContext(); + assertNull(instanceGroupMembershipReferenceInstanceContextModel.getDeleted()); + assertNull(instanceGroupMembershipReferenceInstanceContextModel.getHref()); + assertNull(instanceGroupMembershipReferenceInstanceContextModel.getId()); + assertNull(instanceGroupMembershipReferenceInstanceContextModel.getInstanceGroup()); + assertNull(instanceGroupMembershipReferenceInstanceContextModel.getName()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchTest.java index 414df87423..1f1e3820c3 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePatchTest.java @@ -19,6 +19,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstancePatchProfileInstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPatch; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPatch; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -74,6 +75,11 @@ public void testInstancePatch() throws Throwable { assertEquals(instanceReservationAffinityPatchModel.policy(), "automatic"); assertEquals(instanceReservationAffinityPatchModel.pool(), java.util.Arrays.asList(reservationIdentityModel)); + InstanceVCPUPatch instanceVcpuPatchModel = new InstanceVCPUPatch.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPatchModel.percentage(), Long.valueOf("100")); + InstancePatch instancePatchModel = new InstancePatch.Builder() .availabilityPolicy(instanceAvailabilityPolicyPatchModel) .confidentialComputeMode("disabled") @@ -84,6 +90,8 @@ public void testInstancePatch() throws Throwable { .profile(instancePatchProfileModel) .reservationAffinity(instanceReservationAffinityPatchModel) .totalVolumeBandwidth(Long.valueOf("500")) + .vcpu(instanceVcpuPatchModel) + .volumeBandwidthQosMode("pooled") .build(); assertEquals(instancePatchModel.availabilityPolicy(), instanceAvailabilityPolicyPatchModel); assertEquals(instancePatchModel.confidentialComputeMode(), "disabled"); @@ -94,6 +102,8 @@ public void testInstancePatch() throws Throwable { assertEquals(instancePatchModel.profile(), instancePatchProfileModel); assertEquals(instancePatchModel.reservationAffinity(), instanceReservationAffinityPatchModel); assertEquals(instancePatchModel.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instancePatchModel.vcpu(), instanceVcpuPatchModel); + assertEquals(instancePatchModel.volumeBandwidthQosMode(), "pooled"); String json = TestUtilities.serialize(instancePatchModel); @@ -108,6 +118,8 @@ public void testInstancePatch() throws Throwable { assertEquals(instancePatchModelNew.profile().toString(), instancePatchProfileModel.toString()); assertEquals(instancePatchModelNew.reservationAffinity().toString(), instanceReservationAffinityPatchModel.toString()); assertEquals(instancePatchModelNew.totalVolumeBandwidth(), Long.valueOf("500")); + assertEquals(instancePatchModelNew.vcpu().toString(), instanceVcpuPatchModel.toString()); + assertEquals(instancePatchModelNew.volumeBandwidthQosMode(), "pooled"); } @Test public void testInstancePatchAsPatch() throws Throwable { @@ -138,6 +150,10 @@ public void testInstancePatchAsPatch() throws Throwable { .pool(java.util.Arrays.asList(reservationIdentityModel)) .build(); + InstanceVCPUPatch instanceVcpuPatchModel = new InstanceVCPUPatch.Builder() + .percentage(Long.valueOf("100")) + .build(); + InstancePatch instancePatchModel = new InstancePatch.Builder() .availabilityPolicy(instanceAvailabilityPolicyPatchModel) .confidentialComputeMode("disabled") @@ -148,6 +164,8 @@ public void testInstancePatchAsPatch() throws Throwable { .profile(instancePatchProfileModel) .reservationAffinity(instanceReservationAffinityPatchModel) .totalVolumeBandwidth(Long.valueOf("500")) + .vcpu(instanceVcpuPatchModel) + .volumeBandwidthQosMode("pooled") .build(); Map mergePatch = instancePatchModel.asPatch(); @@ -161,6 +179,8 @@ public void testInstancePatchAsPatch() throws Throwable { assertTrue(mergePatch.containsKey("profile")); assertTrue(mergePatch.containsKey("reservation_affinity")); assertTrue(mergePatch.containsKey("total_volume_bandwidth")); + assertTrue(mergePatch.containsKey("vcpu")); + assertEquals(mergePatch.get("volume_bandwidth_qos_mode"), "pooled"); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollectionTest.java index 23aba89dea..4c89f361ba 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileCollectionTest.java @@ -36,9 +36,12 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileSupportedConfidentialComputeModes; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileSupportedSecureBootModes; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUArchitecture; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUBurstLimitFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUManufacturerFixed; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUPercentage; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthFixed; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModesEnum; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileTest.java index b1a87d9896..2fa0de3bcf 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileTest.java @@ -35,9 +35,12 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileSupportedConfidentialComputeModes; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileSupportedSecureBootModes; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUArchitecture; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUBurstLimitFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUFixed; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUManufacturerFixed; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUPercentage; import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthFixed; +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModesEnum; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -80,7 +83,10 @@ public void testInstanceProfile() throws Throwable { assertNull(instanceProfileModel.getSupportedClusterNetworkProfiles()); assertNull(instanceProfileModel.getTotalVolumeBandwidth()); assertNull(instanceProfileModel.getVcpuArchitecture()); + assertNull(instanceProfileModel.getVcpuBurstLimit()); assertNull(instanceProfileModel.getVcpuCount()); assertNull(instanceProfileModel.getVcpuManufacturer()); + assertNull(instanceProfileModel.getVcpuPercentage()); + assertNull(instanceProfileModel.getVolumeBandwidthQosModes()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitFixedTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitFixedTest.java new file mode 100644 index 0000000000..d26bea78b8 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitFixedTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUBurstLimitFixed; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceProfileVCPUBurstLimitFixed model. + */ +public class InstanceProfileVCPUBurstLimitFixedTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceProfileVCPUBurstLimitFixed() throws Throwable { + InstanceProfileVCPUBurstLimitFixed instanceProfileVcpuBurstLimitFixedModel = new InstanceProfileVCPUBurstLimitFixed(); + assertNull(instanceProfileVcpuBurstLimitFixedModel.getType()); + assertNull(instanceProfileVcpuBurstLimitFixedModel.getValue()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitTest.java new file mode 100644 index 0000000000..47a32f770b --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUBurstLimitTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUBurstLimit; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceProfileVCPUBurstLimit model. + */ +public class InstanceProfileVCPUBurstLimitTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testInstanceProfileVCPUBurstLimit() throws Throwable { + InstanceProfileVCPUBurstLimit instanceProfileVcpuBurstLimitModel = new InstanceProfileVCPUBurstLimit(); + assertNotNull(instanceProfileVcpuBurstLimitModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUPercentageTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUPercentageTest.java new file mode 100644 index 0000000000..9c065d3ed5 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVCPUPercentageTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVCPUPercentage; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceProfileVCPUPercentage model. + */ +public class InstanceProfileVCPUPercentageTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceProfileVCPUPercentage() throws Throwable { + InstanceProfileVCPUPercentage instanceProfileVcpuPercentageModel = new InstanceProfileVCPUPercentage(); + assertNull(instanceProfileVcpuPercentageModel.getXDefault()); + assertNull(instanceProfileVcpuPercentageModel.getType()); + assertNull(instanceProfileVcpuPercentageModel.getValues()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesDependentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesDependentTest.java new file mode 100644 index 0000000000..1ba5ad2f68 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesDependentTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModesDependent; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceProfileVolumeBandwidthQoSModesDependent model. + */ +public class InstanceProfileVolumeBandwidthQoSModesDependentTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceProfileVolumeBandwidthQoSModesDependent() throws Throwable { + InstanceProfileVolumeBandwidthQoSModesDependent instanceProfileVolumeBandwidthQoSModesDependentModel = new InstanceProfileVolumeBandwidthQoSModesDependent(); + assertNull(instanceProfileVolumeBandwidthQoSModesDependentModel.getType()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesEnumTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesEnumTest.java new file mode 100644 index 0000000000..00a59fcd64 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesEnumTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModesEnum; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceProfileVolumeBandwidthQoSModesEnum model. + */ +public class InstanceProfileVolumeBandwidthQoSModesEnumTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceProfileVolumeBandwidthQoSModesEnum() throws Throwable { + InstanceProfileVolumeBandwidthQoSModesEnum instanceProfileVolumeBandwidthQoSModesEnumModel = new InstanceProfileVolumeBandwidthQoSModesEnum(); + assertNull(instanceProfileVolumeBandwidthQoSModesEnumModel.getXDefault()); + assertNull(instanceProfileVolumeBandwidthQoSModesEnumModel.getType()); + assertNull(instanceProfileVolumeBandwidthQoSModesEnumModel.getValues()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesTest.java new file mode 100644 index 0000000000..4d5e797d23 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceProfileVolumeBandwidthQoSModesTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileVolumeBandwidthQoSModes; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceProfileVolumeBandwidthQoSModes model. + */ +public class InstanceProfileVolumeBandwidthQoSModesTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testInstanceProfileVolumeBandwidthQoSModes() throws Throwable { + InstanceProfileVolumeBandwidthQoSModes instanceProfileVolumeBandwidthQoSModesModel = new InstanceProfileVolumeBandwidthQoSModes(); + assertNotNull(instanceProfileVolumeBandwidthQoSModesModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentTest.java index 489ea46526..1369d90e43 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentTest.java @@ -30,6 +30,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachment; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -39,6 +40,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -152,6 +154,11 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -171,6 +178,15 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -182,6 +198,7 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -191,6 +208,7 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -304,7 +322,9 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .catalogOffering(instanceCatalogOfferingPrototypeModel) @@ -326,7 +346,9 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); @@ -350,6 +372,8 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkAttachmentModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceTest.java index 9655fd386e..1dc233691a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterface; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -150,6 +152,11 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -169,6 +176,15 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -180,6 +196,7 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -189,6 +206,7 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -276,7 +294,9 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .catalogOffering(instanceCatalogOfferingPrototypeModel) @@ -298,7 +318,9 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); @@ -322,6 +344,8 @@ public void testInstancePrototypeInstanceByCatalogOfferingInstanceByCatalogOffer assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instancePrototypeInstanceByCatalogOfferingInstanceByCatalogOfferingInstanceByNetworkInterfaceModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingTest.java index f779a8a2bd..f97fad9a41 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByCatalogOfferingTest.java @@ -30,6 +30,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -39,6 +40,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentTest.java index e29fe7d9b5..bbc96d26be 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachment; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -150,6 +152,11 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -169,6 +176,15 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -180,6 +196,7 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -189,6 +206,7 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -290,7 +308,9 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -312,7 +332,9 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModel.image(), imageIdentityModel); @@ -336,6 +358,8 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkAttachmentModelNew.image().toString(), imageIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceTest.java index 32a6915bb4..f67ccaaf62 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceTest.java @@ -26,6 +26,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterface; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -35,6 +36,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -148,6 +150,11 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -167,6 +174,15 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -178,6 +194,7 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -187,6 +204,7 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -262,7 +280,9 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -284,7 +304,9 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModel.image(), imageIdentityModel); @@ -308,6 +330,8 @@ public void testInstancePrototypeInstanceByImageInstanceByImageInstanceByNetwork assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instancePrototypeInstanceByImageInstanceByImageInstanceByNetworkInterfaceModelNew.image().toString(), imageIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageTest.java index 7946ac8c0a..fcc011f920 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByImageTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByImage; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentTest.java index c9ab2301f7..7bc60da53b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachment; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -150,6 +152,11 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -169,6 +176,15 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -185,6 +201,7 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho assertEquals(snapshotIdentityModel.id(), "r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContextModel = new VolumePrototypeInstanceBySourceSnapshotContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -195,6 +212,7 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -292,7 +310,9 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel) .zone(zoneIdentityModel) @@ -313,7 +333,9 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModel.zone(), zoneIdentityModel); @@ -336,6 +358,8 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.toString()); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkAttachmentModelNew.zone().toString(), zoneIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceTest.java index 9c2aabe2aa..e350481ff5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceTest.java @@ -25,6 +25,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterface; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -35,6 +36,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -148,6 +150,11 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -167,6 +174,15 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -183,6 +199,7 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho assertEquals(snapshotIdentityModel.id(), "r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContextModel = new VolumePrototypeInstanceBySourceSnapshotContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -193,6 +210,7 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -264,7 +282,9 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel) .zone(zoneIdentityModel) @@ -285,7 +305,9 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModel.zone(), zoneIdentityModel); @@ -308,6 +330,8 @@ public void testInstancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapsho assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.toString()); assertEquals(instancePrototypeInstanceBySourceSnapshotInstanceBySourceSnapshotInstanceByNetworkInterfaceModelNew.zone().toString(), zoneIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotTest.java index c4680db170..a100ce5788 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceSnapshotTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplateTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplateTest.java index 9c0fbac408..279b1f5175 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplateTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceBySourceTemplateTest.java @@ -32,6 +32,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceBySourceTemplate; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityById; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -43,6 +44,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -156,6 +158,11 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -175,6 +182,15 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -186,6 +202,7 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -195,6 +212,7 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -340,7 +358,9 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .catalogOffering(instanceCatalogOfferingPrototypeModel) @@ -366,7 +386,9 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { assertEquals(instancePrototypeInstanceBySourceTemplateModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceBySourceTemplateModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceBySourceTemplateModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceBySourceTemplateModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceBySourceTemplateModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instancePrototypeInstanceBySourceTemplateModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); @@ -394,6 +416,8 @@ public void testInstancePrototypeInstanceBySourceTemplate() throws Throwable { assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instancePrototypeInstanceBySourceTemplateModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentTest.java index d21590ce79..5f331a9045 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentTest.java @@ -26,6 +26,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachment; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -147,6 +148,11 @@ public void testInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwo .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -258,7 +264,9 @@ public void testInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwo .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByVolumeContextModel) .zone(zoneIdentityModel) @@ -279,7 +287,9 @@ public void testInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwo assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByVolumeContextModel); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModel.zone(), zoneIdentityModel); @@ -302,6 +312,8 @@ public void testInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwo assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByVolumeContextModel.toString()); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkAttachmentModelNew.zone().toString(), zoneIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceTest.java index 0f4c4393be..d783135249 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceTest.java @@ -24,6 +24,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterface; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -145,6 +146,11 @@ public void testInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwo .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -230,7 +236,9 @@ public void testInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwo .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByVolumeContextModel) .zone(zoneIdentityModel) @@ -251,7 +259,9 @@ public void testInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwo assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.userData(), "testString"); + assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.vpc(), vpcIdentityModel); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByVolumeContextModel); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModel.zone(), zoneIdentityModel); @@ -274,6 +284,8 @@ public void testInstancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetwo assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModelNew.userData(), "testString"); + assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByVolumeContextModel.toString()); assertEquals(instancePrototypeInstanceByVolumeInstanceByVolumeInstanceByNetworkInterfaceModelNew.zone().toString(), zoneIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeTest.java index 8e00939900..9c54a492b5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeInstanceByVolumeTest.java @@ -26,6 +26,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototypeInstanceByVolume; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeTest.java index 21ddedceba..fa3d7df687 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstancePrototypeTest.java @@ -26,6 +26,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstancePrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -35,6 +36,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeByCapacity; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionTest.java index 07c6e44613..a9ea98aa19 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateCollectionTest.java @@ -29,6 +29,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateCollection; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.PageLink; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; @@ -40,6 +41,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentTest.java index bf505abcfa..73d3975f10 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentTest.java @@ -30,6 +30,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachment; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -40,6 +41,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -82,7 +84,9 @@ public void testInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getResourceGroup()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getTotalVolumeBandwidth()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getUserData()); + assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getVcpu()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getVolumeBandwidthQosMode()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getVpc()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getBootVolumeAttachment()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkAttachmentModel.getCatalogOffering()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceTest.java index a777ca6386..1e4ed69542 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterface; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -38,6 +39,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -80,7 +82,9 @@ public void testInstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getResourceGroup()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getTotalVolumeBandwidth()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getUserData()); + assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getVcpu()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getVolumeBandwidthQosMode()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getVpc()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getBootVolumeAttachment()); assertNull(instanceTemplateInstanceByCatalogOfferingInstanceTemplateContextInstanceByCatalogOfferingInstanceTemplateContextInstanceByNetworkInterfaceModel.getCatalogOffering()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextTest.java index 6c2a50c624..25b2a2906e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContextTest.java @@ -30,6 +30,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByCatalogOfferingInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -40,6 +41,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentTest.java index 92781ee5de..70d51d40e6 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachment; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -38,6 +39,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -80,7 +82,9 @@ public void testInstanceTemplateInstanceByImageInstanceTemplateContextInstanceBy assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getResourceGroup()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getTotalVolumeBandwidth()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getUserData()); + assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getVcpu()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getVolumeBandwidthQosMode()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getVpc()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getBootVolumeAttachment()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkAttachmentModel.getImage()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceTest.java index ed7a95b72d..31a201cdeb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceTest.java @@ -26,6 +26,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterface; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -36,6 +37,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -78,7 +80,9 @@ public void testInstanceTemplateInstanceByImageInstanceTemplateContextInstanceBy assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getResourceGroup()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getTotalVolumeBandwidth()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getUserData()); + assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getVcpu()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getVolumeBandwidthQosMode()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getVpc()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getBootVolumeAttachment()); assertNull(instanceTemplateInstanceByImageInstanceTemplateContextInstanceByImageInstanceTemplateContextInstanceByNetworkInterfaceModel.getImage()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextTest.java index fdf26ea749..38032223e9 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceByImageInstanceTemplateContextTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceByImageInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -38,6 +39,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentTest.java index d077e535c9..607b4d316d 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachment; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -40,6 +41,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -82,7 +84,9 @@ public void testInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextI assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getResourceGroup()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getTotalVolumeBandwidth()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getUserData()); + assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getVcpu()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getVolumeBandwidthQosMode()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getVpc()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getBootVolumeAttachment()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkAttachmentModel.getNetworkInterfaces()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceTest.java index 9e609d0ff2..46508a2c17 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterface; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -40,6 +41,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -82,7 +84,9 @@ public void testInstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextI assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getResourceGroup()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getTotalVolumeBandwidth()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getUserData()); + assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getVcpu()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getVolumeAttachments()); + assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getVolumeBandwidthQosMode()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getVpc()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getBootVolumeAttachment()); assertNull(instanceTemplateInstanceBySourceSnapshotInstanceTemplateContextInstanceBySourceSnapshotInstanceTemplateContextInstanceByNetworkInterfaceModel.getNetworkAttachments()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextTest.java index 6b11b14326..bda3f13627 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContextTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateInstanceBySourceSnapshotInstanceTemplateContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -40,6 +41,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentTest.java index 90b64f380c..d943485947 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentTest.java @@ -30,6 +30,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachment; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -39,6 +40,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -152,6 +154,11 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -171,6 +178,15 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -182,6 +198,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -191,6 +208,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -304,7 +322,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .catalogOffering(instanceCatalogOfferingPrototypeModel) @@ -326,7 +346,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); @@ -350,6 +372,8 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkAttachmentModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceTest.java index df45162ba1..7a5c660ff6 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterface; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -150,6 +152,11 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -169,6 +176,15 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -180,6 +196,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -189,6 +206,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -276,7 +294,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .catalogOffering(instanceCatalogOfferingPrototypeModel) @@ -298,7 +318,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); @@ -322,6 +344,8 @@ public void testInstanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstan assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByCatalogOfferingInstanceTemplateByCatalogOfferingInstanceByNetworkInterfaceModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingTest.java index 2c4cd9c6f0..9ba76b3456 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByCatalogOfferingTest.java @@ -30,6 +30,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByCatalogOffering; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -39,6 +40,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentTest.java index 6da0bf9b82..2073b5d994 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachment; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -150,6 +152,11 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -169,6 +176,15 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -180,6 +196,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -189,6 +206,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -290,7 +308,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -312,7 +332,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModel.image(), imageIdentityModel); @@ -336,6 +358,8 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkAttachmentModelNew.image().toString(), imageIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceTest.java index 1d5b728369..f8bad3fc6f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceTest.java @@ -26,6 +26,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterface; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -35,6 +36,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -148,6 +150,11 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -167,6 +174,15 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -178,6 +194,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -187,6 +204,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -262,7 +280,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .image(imageIdentityModel) @@ -284,7 +304,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModel.image(), imageIdentityModel); @@ -308,6 +330,8 @@ public void testInstanceTemplatePrototypeInstanceTemplateByImageInstanceTemplate assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateByImageInstanceTemplateByImageInstanceByNetworkInterfaceModelNew.image().toString(), imageIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageTest.java index 2b8038cb99..5ad0921074 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateByImageTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateByImage; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentTest.java index 4cb9205825..9d51af3325 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachment; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -150,6 +152,11 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -169,6 +176,15 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -185,6 +201,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc assertEquals(snapshotIdentityModel.id(), "r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContextModel = new VolumePrototypeInstanceBySourceSnapshotContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -195,6 +212,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -292,7 +310,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel) .zone(zoneIdentityModel) @@ -313,7 +333,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModel.zone(), zoneIdentityModel); @@ -336,6 +358,8 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkAttachmentModelNew.zone().toString(), zoneIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceTest.java index 5b85fba151..b872136301 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceTest.java @@ -25,6 +25,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterface; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -35,6 +36,7 @@ import com.ibm.cloud.is.vpc.v1.model.SubnetIdentityById; import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -148,6 +150,11 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -167,6 +174,15 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -183,6 +199,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc assertEquals(snapshotIdentityModel.id(), "r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContextModel = new VolumePrototypeInstanceBySourceSnapshotContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -193,6 +210,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -264,7 +282,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel) .zone(zoneIdentityModel) @@ -285,7 +305,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModel.zone(), zoneIdentityModel); @@ -308,6 +330,8 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanc assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceBySourceSnapshotContextModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceSnapshotInstanceTemplateBySourceSnapshotInstanceByNetworkInterfaceModelNew.zone().toString(), zoneIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotTest.java index db908a4835..17fdb287c2 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceSnapshotTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceSnapshot; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplateTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplateTest.java index 180f871a37..3dbe39fc31 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplateTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeInstanceTemplateBySourceTemplateTest.java @@ -32,6 +32,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplateIdentityById; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototypeInstanceTemplateBySourceTemplate; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceIPPrototypeReservedIPPrototypeNetworkInterfaceContext; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfacePrototype; @@ -43,6 +44,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; @@ -156,6 +158,11 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplate() thro .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById volumeAttachmentPrototypeVolumeModel = new VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById.Builder() .id("r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5") .build(); @@ -175,6 +182,15 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplate() thro .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -186,6 +202,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplate() thro assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -195,6 +212,7 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplate() thro .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -340,7 +358,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplate() thro .resourceGroup(resourceGroupIdentityModel) .totalVolumeBandwidth(Long.valueOf("500")) .userData("testString") + .vcpu(instanceVcpuPrototypeModel) .volumeAttachments(java.util.Arrays.asList(volumeAttachmentPrototypeModel)) + .volumeBandwidthQosMode("pooled") .vpc(vpcIdentityModel) .bootVolumeAttachment(volumeAttachmentPrototypeInstanceByImageContextModel) .catalogOffering(instanceCatalogOfferingPrototypeModel) @@ -366,7 +386,9 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplate() thro assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.vcpu(), instanceVcpuPrototypeModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.volumeAttachments(), java.util.Arrays.asList(volumeAttachmentPrototypeModel)); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.vpc(), vpcIdentityModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.bootVolumeAttachment(), volumeAttachmentPrototypeInstanceByImageContextModel); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModel.catalogOffering(), instanceCatalogOfferingPrototypeModel); @@ -394,6 +416,8 @@ public void testInstanceTemplatePrototypeInstanceTemplateBySourceTemplate() thro assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.totalVolumeBandwidth(), Long.valueOf("500")); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.userData(), "testString"); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.vcpu().toString(), instanceVcpuPrototypeModel.toString()); + assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.volumeBandwidthQosMode(), "pooled"); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.vpc().toString(), vpcIdentityModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.bootVolumeAttachment().toString(), volumeAttachmentPrototypeInstanceByImageContextModel.toString()); assertEquals(instanceTemplatePrototypeInstanceTemplateBySourceTemplateModelNew.catalogOffering().toString(), instanceCatalogOfferingPrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeTest.java index d41ab88450..3558fe04c5 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplatePrototypeTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplatePrototype; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -37,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateTest.java index 99b6ccaca0..d159e39d8f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTemplateTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinityPrototype; import com.ibm.cloud.is.vpc.v1.model.InstanceTemplate; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReservationIdentityById; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; @@ -38,6 +39,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfaceIPPrototypeReservedIPPrototypeVirtualNetworkInterfaceIPsContext; import com.ibm.cloud.is.vpc.v1.model.VirtualNetworkInterfacePrimaryIPPrototypeReservedIPPrototypeVirtualNetworkInterfacePrimaryIPContext; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumeIdentityVolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTest.java index a09c45f953..8204daeebd 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceTest.java @@ -27,6 +27,8 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceClusterNetworkAttachmentReference; import com.ibm.cloud.is.vpc.v1.model.InstanceDisk; import com.ibm.cloud.is.vpc.v1.model.InstanceGPU; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupMembershipReferenceInstanceContext; +import com.ibm.cloud.is.vpc.v1.model.InstanceGroupReference; import com.ibm.cloud.is.vpc.v1.model.InstanceHealthReason; import com.ibm.cloud.is.vpc.v1.model.InstanceLifecycleReason; import com.ibm.cloud.is.vpc.v1.model.InstanceMetadataService; @@ -36,6 +38,7 @@ import com.ibm.cloud.is.vpc.v1.model.InstanceReservationAffinity; import com.ibm.cloud.is.vpc.v1.model.InstanceStatusReason; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUBurst; import com.ibm.cloud.is.vpc.v1.model.NetworkInterfaceInstanceContextReference; import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.ReservationReference; @@ -85,6 +88,7 @@ public void testInstance() throws Throwable { assertNull(instanceModel.getHref()); assertNull(instanceModel.getId()); assertNull(instanceModel.getImage()); + assertNull(instanceModel.getInstanceGroupMembership()); assertNull(instanceModel.getLifecycleReasons()); assertNull(instanceModel.getLifecycleState()); assertNull(instanceModel.getMemory()); @@ -108,6 +112,7 @@ public void testInstance() throws Throwable { assertNull(instanceModel.getTotalVolumeBandwidth()); assertNull(instanceModel.getVcpu()); assertNull(instanceModel.getVolumeAttachments()); + assertNull(instanceModel.getVolumeBandwidthQosMode()); assertNull(instanceModel.getVpc()); assertNull(instanceModel.getZone()); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUBurstTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUBurstTest.java new file mode 100644 index 0000000000..4314ed23ad --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUBurstTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUBurst; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceVCPUBurst model. + */ +public class InstanceVCPUBurstTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceVCPUBurst() throws Throwable { + InstanceVCPUBurst instanceVcpuBurstModel = new InstanceVCPUBurst(); + assertNull(instanceVcpuBurstModel.getLimit()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPatchTest.java new file mode 100644 index 0000000000..ad664573ae --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPatchTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceVCPUPatch model. + */ +public class InstanceVCPUPatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceVCPUPatch() throws Throwable { + InstanceVCPUPatch instanceVcpuPatchModel = new InstanceVCPUPatch.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPatchModel.percentage(), Long.valueOf("100")); + + String json = TestUtilities.serialize(instanceVcpuPatchModel); + + InstanceVCPUPatch instanceVcpuPatchModelNew = TestUtilities.deserialize(json, InstanceVCPUPatch.class); + assertTrue(instanceVcpuPatchModelNew instanceof InstanceVCPUPatch); + assertEquals(instanceVcpuPatchModelNew.percentage(), Long.valueOf("100")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testInstanceVCPUPatchError() throws Throwable { + new InstanceVCPUPatch.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPrototypeTest.java new file mode 100644 index 0000000000..afb3d4e6ba --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUPrototypeTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the InstanceVCPUPrototype model. + */ +public class InstanceVCPUPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testInstanceVCPUPrototype() throws Throwable { + InstanceVCPUPrototype instanceVcpuPrototypeModel = new InstanceVCPUPrototype.Builder() + .percentage(Long.valueOf("100")) + .build(); + assertEquals(instanceVcpuPrototypeModel.percentage(), Long.valueOf("100")); + + String json = TestUtilities.serialize(instanceVcpuPrototypeModel); + + InstanceVCPUPrototype instanceVcpuPrototypeModelNew = TestUtilities.deserialize(json, InstanceVCPUPrototype.class); + assertTrue(instanceVcpuPrototypeModelNew instanceof InstanceVCPUPrototype); + assertEquals(instanceVcpuPrototypeModelNew.percentage(), Long.valueOf("100")); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUTest.java index 7d05aa2233..4e20ae4667 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/InstanceVCPUTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.InstanceVCPU; +import com.ibm.cloud.is.vpc.v1.model.InstanceVCPUBurst; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -33,7 +34,9 @@ public class InstanceVCPUTest { public void testInstanceVCPU() throws Throwable { InstanceVCPU instanceVcpuModel = new InstanceVCPU(); assertNull(instanceVcpuModel.getArchitecture()); + assertNull(instanceVcpuModel.getBurst()); assertNull(instanceVcpuModel.getCount()); assertNull(instanceVcpuModel.getManufacturer()); + assertNull(instanceVcpuModel.getPercentage()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayResourceBindingsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayResourceBindingsOptionsTest.java new file mode 100644 index 0000000000..1ec84aec5f --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewayResourceBindingsOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ListEndpointGatewayResourceBindingsOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListEndpointGatewayResourceBindingsOptions model. + */ +public class ListEndpointGatewayResourceBindingsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListEndpointGatewayResourceBindingsOptions() throws Throwable { + ListEndpointGatewayResourceBindingsOptions listEndpointGatewayResourceBindingsOptionsModel = new ListEndpointGatewayResourceBindingsOptions.Builder() + .endpointGatewayId("testString") + .start("testString") + .limit(Long.valueOf("50")) + .build(); + assertEquals(listEndpointGatewayResourceBindingsOptionsModel.endpointGatewayId(), "testString"); + assertEquals(listEndpointGatewayResourceBindingsOptionsModel.start(), "testString"); + assertEquals(listEndpointGatewayResourceBindingsOptionsModel.limit(), Long.valueOf("50")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListEndpointGatewayResourceBindingsOptionsError() throws Throwable { + new ListEndpointGatewayResourceBindingsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptionsTest.java index f7b6c9adcc..306e526d6b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListEndpointGatewaysOptionsTest.java @@ -40,7 +40,7 @@ public void testListEndpointGatewaysOptions() throws Throwable { .vpcId("testString") .vpcCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b") .vpcName("my-vpc") - .allowDnsResolutionBinding(true) + .dnsResolutionBindingMode(java.util.Arrays.asList("disabled")) .build(); assertEquals(listEndpointGatewaysOptionsModel.name(), "my-name"); assertEquals(listEndpointGatewaysOptionsModel.start(), "testString"); @@ -50,6 +50,6 @@ public void testListEndpointGatewaysOptions() throws Throwable { assertEquals(listEndpointGatewaysOptionsModel.vpcId(), "testString"); assertEquals(listEndpointGatewaysOptionsModel.vpcCrn(), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::vpc:r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); assertEquals(listEndpointGatewaysOptionsModel.vpcName(), "my-vpc"); - assertEquals(listEndpointGatewaysOptionsModel.allowDnsResolutionBinding(), Boolean.valueOf(true)); + assertEquals(listEndpointGatewaysOptionsModel.dnsResolutionBindingMode(), java.util.Arrays.asList("disabled")); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImageBareMetalServerProfilesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImageBareMetalServerProfilesOptionsTest.java new file mode 100644 index 0000000000..5c30ba5340 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImageBareMetalServerProfilesOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ListImageBareMetalServerProfilesOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListImageBareMetalServerProfilesOptions model. + */ +public class ListImageBareMetalServerProfilesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListImageBareMetalServerProfilesOptions() throws Throwable { + ListImageBareMetalServerProfilesOptions listImageBareMetalServerProfilesOptionsModel = new ListImageBareMetalServerProfilesOptions.Builder() + .id("testString") + .start("testString") + .limit(Long.valueOf("50")) + .build(); + assertEquals(listImageBareMetalServerProfilesOptionsModel.id(), "testString"); + assertEquals(listImageBareMetalServerProfilesOptionsModel.start(), "testString"); + assertEquals(listImageBareMetalServerProfilesOptionsModel.limit(), Long.valueOf("50")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListImageBareMetalServerProfilesOptionsError() throws Throwable { + new ListImageBareMetalServerProfilesOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImageInstanceProfilesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImageInstanceProfilesOptionsTest.java new file mode 100644 index 0000000000..faed992159 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListImageInstanceProfilesOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ListImageInstanceProfilesOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListImageInstanceProfilesOptions model. + */ +public class ListImageInstanceProfilesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListImageInstanceProfilesOptions() throws Throwable { + ListImageInstanceProfilesOptions listImageInstanceProfilesOptionsModel = new ListImageInstanceProfilesOptions.Builder() + .id("testString") + .start("testString") + .limit(Long.valueOf("50")) + .build(); + assertEquals(listImageInstanceProfilesOptionsModel.id(), "testString"); + assertEquals(listImageInstanceProfilesOptionsModel.start(), "testString"); + assertEquals(listImageInstanceProfilesOptionsModel.limit(), Long.valueOf("50")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListImageInstanceProfilesOptionsError() throws Throwable { + new ListImageInstanceProfilesOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptionsTest.java index fea3db2812..0afe4b86c0 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListInstancesOptionsTest.java @@ -42,6 +42,8 @@ public void testListInstancesOptions() throws Throwable { .dedicatedHostId("testString") .dedicatedHostCrn("crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a") .dedicatedHostName("my-dedicated-host") + .instanceGroupMembershipInstanceGroupId("r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") + .instanceGroupMembershipInstanceGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60") .placementGroupId("testString") .placementGroupCrn("crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871") .placementGroupName("my-placement-group") @@ -63,6 +65,8 @@ public void testListInstancesOptions() throws Throwable { assertEquals(listInstancesOptionsModel.dedicatedHostId(), "testString"); assertEquals(listInstancesOptionsModel.dedicatedHostCrn(), "crn:v1:bluemix:public:is:us-south-1:a/aa2432b1fa4d4ace891e9b80fc104e34::dedicated-host:0717-1e09281b-f177-46fb-baf1-bc152b2e391a"); assertEquals(listInstancesOptionsModel.dedicatedHostName(), "my-dedicated-host"); + assertEquals(listInstancesOptionsModel.instanceGroupMembershipInstanceGroupId(), "r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"); + assertEquals(listInstancesOptionsModel.instanceGroupMembershipInstanceGroupCrn(), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::instance-group:r006-7b3ac170-01f3-43d6-87ec-f0ed11ed3f60"); assertEquals(listInstancesOptionsModel.placementGroupId(), "testString"); assertEquals(listInstancesOptionsModel.placementGroupCrn(), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::placement-group:r006-418fe842-a3e9-47b9-a938-1aa5bd632871"); assertEquals(listInstancesOptionsModel.placementGroupName(), "my-placement-group"); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotInstanceProfilesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotInstanceProfilesOptionsTest.java new file mode 100644 index 0000000000..66bde9e8c4 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListSnapshotInstanceProfilesOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ListSnapshotInstanceProfilesOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListSnapshotInstanceProfilesOptions model. + */ +public class ListSnapshotInstanceProfilesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListSnapshotInstanceProfilesOptions() throws Throwable { + ListSnapshotInstanceProfilesOptions listSnapshotInstanceProfilesOptionsModel = new ListSnapshotInstanceProfilesOptions.Builder() + .id("testString") + .start("testString") + .limit(Long.valueOf("50")) + .build(); + assertEquals(listSnapshotInstanceProfilesOptionsModel.id(), "testString"); + assertEquals(listSnapshotInstanceProfilesOptionsModel.start(), "testString"); + assertEquals(listSnapshotInstanceProfilesOptionsModel.limit(), Long.valueOf("50")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListSnapshotInstanceProfilesOptionsError() throws Throwable { + new ListSnapshotInstanceProfilesOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeInstanceProfilesOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeInstanceProfilesOptionsTest.java new file mode 100644 index 0000000000..cc0359241e --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVolumeInstanceProfilesOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ListVolumeInstanceProfilesOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListVolumeInstanceProfilesOptions model. + */ +public class ListVolumeInstanceProfilesOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListVolumeInstanceProfilesOptions() throws Throwable { + ListVolumeInstanceProfilesOptions listVolumeInstanceProfilesOptionsModel = new ListVolumeInstanceProfilesOptions.Builder() + .id("testString") + .start("testString") + .limit(Long.valueOf("50")) + .build(); + assertEquals(listVolumeInstanceProfilesOptionsModel.id(), "testString"); + assertEquals(listVolumeInstanceProfilesOptionsModel.start(), "testString"); + assertEquals(listVolumeInstanceProfilesOptionsModel.limit(), Long.valueOf("50")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListVolumeInstanceProfilesOptionsError() throws Throwable { + new ListVolumeInstanceProfilesOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayAdvertisedCidrsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayAdvertisedCidrsOptionsTest.java new file mode 100644 index 0000000000..4c3a531462 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayAdvertisedCidrsOptionsTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayAdvertisedCidrsOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListVpnGatewayAdvertisedCidrsOptions model. + */ +public class ListVpnGatewayAdvertisedCidrsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListVpnGatewayAdvertisedCidrsOptions() throws Throwable { + ListVpnGatewayAdvertisedCidrsOptions listVpnGatewayAdvertisedCidrsOptionsModel = new ListVpnGatewayAdvertisedCidrsOptions.Builder() + .vpnGatewayId("testString") + .build(); + assertEquals(listVpnGatewayAdvertisedCidrsOptionsModel.vpnGatewayId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListVpnGatewayAdvertisedCidrsOptionsError() throws Throwable { + new ListVpnGatewayAdvertisedCidrsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayServiceConnectionsOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayServiceConnectionsOptionsTest.java new file mode 100644 index 0000000000..06c7789450 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ListVpnGatewayServiceConnectionsOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ListVpnGatewayServiceConnectionsOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ListVpnGatewayServiceConnectionsOptions model. + */ +public class ListVpnGatewayServiceConnectionsOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testListVpnGatewayServiceConnectionsOptions() throws Throwable { + ListVpnGatewayServiceConnectionsOptions listVpnGatewayServiceConnectionsOptionsModel = new ListVpnGatewayServiceConnectionsOptions.Builder() + .vpnGatewayId("testString") + .start("testString") + .limit(Long.valueOf("50")) + .build(); + assertEquals(listVpnGatewayServiceConnectionsOptionsModel.vpnGatewayId(), "testString"); + assertEquals(listVpnGatewayServiceConnectionsOptionsModel.start(), "testString"); + assertEquals(listVpnGatewayServiceConnectionsOptionsModel.limit(), Long.valueOf("50")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListVpnGatewayServiceConnectionsOptionsError() throws Throwable { + new ListVpnGatewayServiceConnectionsOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetByReservedIpTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetByReservedIpTest.java new file mode 100644 index 0000000000..f1cdda13c6 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetByReservedIpTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.Deleted; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetByReservedIp; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LoadBalancerPoolMemberTargetByReservedIp model. + */ +public class LoadBalancerPoolMemberTargetByReservedIpTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLoadBalancerPoolMemberTargetByReservedIp() throws Throwable { + LoadBalancerPoolMemberTargetByReservedIp loadBalancerPoolMemberTargetByReservedIpModel = new LoadBalancerPoolMemberTargetByReservedIp(); + assertNull(loadBalancerPoolMemberTargetByReservedIpModel.getAddress()); + assertNull(loadBalancerPoolMemberTargetByReservedIpModel.getDeleted()); + assertNull(loadBalancerPoolMemberTargetByReservedIpModel.getHref()); + assertNull(loadBalancerPoolMemberTargetByReservedIpModel.getId()); + assertNull(loadBalancerPoolMemberTargetByReservedIpModel.getName()); + assertNull(loadBalancerPoolMemberTargetByReservedIpModel.getResourceType()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPNotReservedIPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPNotReservedIPTest.java new file mode 100644 index 0000000000..8add557254 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPNotReservedIPTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetIPNotReservedIP; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LoadBalancerPoolMemberTargetIPNotReservedIP model. + */ +public class LoadBalancerPoolMemberTargetIPNotReservedIPTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLoadBalancerPoolMemberTargetIPNotReservedIP() throws Throwable { + LoadBalancerPoolMemberTargetIPNotReservedIP loadBalancerPoolMemberTargetIpNotReservedIpModel = new LoadBalancerPoolMemberTargetIPNotReservedIP(); + assertNull(loadBalancerPoolMemberTargetIpNotReservedIpModel.getAddress()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHrefTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHrefTest.java new file mode 100644 index 0000000000..2653ab8f9d --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHrefTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref model. + */ +public class LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHrefTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref() throws Throwable { + LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHrefModel = new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.Builder() + .href("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + .build(); + assertEquals(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHrefModel.href(), "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); + + String json = TestUtilities.serialize(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHrefModel); + + LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHrefModelNew = TestUtilities.deserialize(json, LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.class); + assertTrue(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHrefModelNew instanceof LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref); + assertEquals(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByHrefModelNew.href(), "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHrefError() throws Throwable { + new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByHref.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByIdTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByIdTest.java new file mode 100644 index 0000000000..1d51c8989e --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByIdTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById model. + */ +public class LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByIdTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById() throws Throwable { + LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByIdModel = new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById.Builder() + .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") + .build(); + assertEquals(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByIdModel.id(), "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); + + String json = TestUtilities.serialize(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByIdModel); + + LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByIdModelNew = TestUtilities.deserialize(json, LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById.class); + assertTrue(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByIdModelNew instanceof LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById); + assertEquals(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityByIdModelNew.id(), "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testLoadBalancerPoolMemberTargetPrototypeReservedIPIdentityByIdError() throws Throwable { + new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityById.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityTest.java new file mode 100644 index 0000000000..449d373dcc --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity model. + */ +public class LoadBalancerPoolMemberTargetPrototypeReservedIPIdentityTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testLoadBalancerPoolMemberTargetPrototypeReservedIPIdentity() throws Throwable { + LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity loadBalancerPoolMemberTargetPrototypeReservedIpIdentityModel = new LoadBalancerPoolMemberTargetPrototypeReservedIPIdentity(); + assertNotNull(loadBalancerPoolMemberTargetPrototypeReservedIpIdentityModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionTest.java index dab135ad25..9b2e3023cb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileCollectionTest.java @@ -24,6 +24,7 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileRouteModeSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSecurityGroupsSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSourceIPSessionPersistenceSupportedFixed; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileTargetableResourceTypes; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.PageLink; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTargetableResourceTypesTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTargetableResourceTypesTest.java new file mode 100644 index 0000000000..9a5d0a784b --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTargetableResourceTypesTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileTargetableResourceTypes; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the LoadBalancerProfileTargetableResourceTypes model. + */ +public class LoadBalancerProfileTargetableResourceTypesTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testLoadBalancerProfileTargetableResourceTypes() throws Throwable { + LoadBalancerProfileTargetableResourceTypes loadBalancerProfileTargetableResourceTypesModel = new LoadBalancerProfileTargetableResourceTypes(); + assertNull(loadBalancerProfileTargetableResourceTypesModel.getType()); + assertNull(loadBalancerProfileTargetableResourceTypesModel.getValues()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTest.java index 7affd50391..197d78e96f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerProfileTest.java @@ -23,6 +23,7 @@ import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileRouteModeSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSecurityGroupsSupportedFixed; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileSourceIPSessionPersistenceSupportedFixed; +import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileTargetableResourceTypes; import com.ibm.cloud.is.vpc.v1.model.LoadBalancerProfileUDPSupportedFixed; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -54,6 +55,7 @@ public void testLoadBalancerProfile() throws Throwable { assertNull(loadBalancerProfileModel.getSecurityGroupsSupported()); assertNull(loadBalancerProfileModel.getSourceIpSessionPersistenceSupported()); assertNull(loadBalancerProfileModel.getTargetableLoadBalancerProfiles()); + assertNull(loadBalancerProfileModel.getTargetableResourceTypes()); assertNull(loadBalancerProfileModel.getUdpSupported()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionTest.java index 394aa11f2a..4c321dcf8f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLCollectionTest.java @@ -16,7 +16,7 @@ import com.ibm.cloud.is.vpc.v1.model.Deleted; import com.ibm.cloud.is.vpc.v1.model.NetworkACL; import com.ibm.cloud.is.vpc.v1.model.NetworkACLCollection; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.PageLink; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRulesTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRulesTest.java index fdcf152ce8..4c9ab2db97 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRulesTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeNetworkACLByRulesTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.NetworkACLPrototypeNetworkACLByRules; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -44,14 +44,14 @@ public void testNetworkACLPrototypeNetworkACLByRules() throws Throwable { .build(); assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Builder() + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeNetworkAclContextModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Builder() .action("allow") .destination("192.168.3.2/32") .direction("inbound") .ipVersion("ipv4") .name("my-network-acl-rule") .source("192.168.3.2/32") - .protocol("all") + .protocol("any") .build(); assertEquals(networkAclRulePrototypeNetworkAclContextModel.action(), "allow"); assertEquals(networkAclRulePrototypeNetworkAclContextModel.destination(), "192.168.3.2/32"); @@ -59,7 +59,7 @@ public void testNetworkACLPrototypeNetworkACLByRules() throws Throwable { assertEquals(networkAclRulePrototypeNetworkAclContextModel.ipVersion(), "ipv4"); assertEquals(networkAclRulePrototypeNetworkAclContextModel.name(), "my-network-acl-rule"); assertEquals(networkAclRulePrototypeNetworkAclContextModel.source(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclContextModel.protocol(), "all"); + assertEquals(networkAclRulePrototypeNetworkAclContextModel.protocol(), "any"); NetworkACLPrototypeNetworkACLByRules networkAclPrototypeNetworkAclByRulesModel = new NetworkACLPrototypeNetworkACLByRules.Builder() .name("my-network-acl") diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeTest.java index c46ae46a18..f668d3063b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLPrototypeTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.NetworkACLPrototype; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPCIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionTest.java index a2e0df1887..dd8cba2799 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleCollectionTest.java @@ -15,7 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.Deleted; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleCollection; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.PageLink; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAllTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAnyTest.java similarity index 60% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAllTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAnyTest.java index 04debc6563..f0f6553388 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAllTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolAnyTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.Deleted; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -25,25 +25,25 @@ import static org.testng.Assert.*; /** - * Unit test class for the NetworkACLRuleItemNetworkACLRuleProtocolAll model. + * Unit test class for the NetworkACLRuleItemNetworkACLRuleProtocolAny model. */ -public class NetworkACLRuleItemNetworkACLRuleProtocolAllTest { +public class NetworkACLRuleItemNetworkACLRuleProtocolAnyTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testNetworkACLRuleItemNetworkACLRuleProtocolAll() throws Throwable { - NetworkACLRuleItemNetworkACLRuleProtocolAll networkAclRuleItemNetworkAclRuleProtocolAllModel = new NetworkACLRuleItemNetworkACLRuleProtocolAll(); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getAction()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getBefore()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getCreatedAt()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getDestination()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getDirection()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getHref()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getId()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getIpVersion()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getName()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getSource()); - assertNull(networkAclRuleItemNetworkAclRuleProtocolAllModel.getProtocol()); + public void testNetworkACLRuleItemNetworkACLRuleProtocolAny() throws Throwable { + NetworkACLRuleItemNetworkACLRuleProtocolAny networkAclRuleItemNetworkAclRuleProtocolAnyModel = new NetworkACLRuleItemNetworkACLRuleProtocolAny(); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getAction()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getBefore()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getCreatedAt()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getDestination()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getDirection()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getHref()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getId()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getIpVersion()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getName()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getSource()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolAnyModel.getProtocol()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDPTest.java new file mode 100644 index 0000000000..ee266d790c --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDPTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.Deleted; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP model. + */ +public class NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDPTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP() throws Throwable { + NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel = new NetworkACLRuleItemNetworkACLRuleProtocolICMPTCPUDP(); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getAction()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getBefore()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getCreatedAt()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getDestination()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getDirection()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getHref()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getId()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getIpVersion()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getName()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getSource()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIcmptcpudpModel.getProtocol()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolIndividualTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolIndividualTest.java new file mode 100644 index 0000000000..783e1bda4f --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleItemNetworkACLRuleProtocolIndividualTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.Deleted; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolIndividual; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRuleItemNetworkACLRuleProtocolIndividual model. + */ +public class NetworkACLRuleItemNetworkACLRuleProtocolIndividualTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRuleItemNetworkACLRuleProtocolIndividual() throws Throwable { + NetworkACLRuleItemNetworkACLRuleProtocolIndividual networkAclRuleItemNetworkAclRuleProtocolIndividualModel = new NetworkACLRuleItemNetworkACLRuleProtocolIndividual(); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getAction()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getBefore()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getCreatedAt()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getDestination()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getDirection()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getHref()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getId()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getIpVersion()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getName()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getSource()); + assertNull(networkAclRuleItemNetworkAclRuleProtocolIndividualModel.getProtocol()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAllTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAnyTest.java similarity index 60% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAllTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAnyTest.java index 5d8d903d82..3bafc0a1c9 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAllTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolAnyTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.Deleted; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -25,25 +25,25 @@ import static org.testng.Assert.*; /** - * Unit test class for the NetworkACLRuleNetworkACLRuleProtocolAll model. + * Unit test class for the NetworkACLRuleNetworkACLRuleProtocolAny model. */ -public class NetworkACLRuleNetworkACLRuleProtocolAllTest { +public class NetworkACLRuleNetworkACLRuleProtocolAnyTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testNetworkACLRuleNetworkACLRuleProtocolAll() throws Throwable { - NetworkACLRuleNetworkACLRuleProtocolAll networkAclRuleNetworkAclRuleProtocolAllModel = new NetworkACLRuleNetworkACLRuleProtocolAll(); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getAction()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getBefore()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getCreatedAt()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getDestination()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getDirection()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getHref()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getId()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getIpVersion()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getName()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getSource()); - assertNull(networkAclRuleNetworkAclRuleProtocolAllModel.getProtocol()); + public void testNetworkACLRuleNetworkACLRuleProtocolAny() throws Throwable { + NetworkACLRuleNetworkACLRuleProtocolAny networkAclRuleNetworkAclRuleProtocolAnyModel = new NetworkACLRuleNetworkACLRuleProtocolAny(); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getAction()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getBefore()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getCreatedAt()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getDestination()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getDirection()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getHref()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getId()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getIpVersion()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getName()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getSource()); + assertNull(networkAclRuleNetworkAclRuleProtocolAnyModel.getProtocol()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDPTest.java new file mode 100644 index 0000000000..90b6551912 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDPTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.Deleted; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP model. + */ +public class NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDPTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP() throws Throwable { + NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel = new NetworkACLRuleNetworkACLRuleProtocolICMPTCPUDP(); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getAction()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getBefore()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getCreatedAt()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getDestination()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getDirection()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getHref()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getId()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getIpVersion()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getName()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getSource()); + assertNull(networkAclRuleNetworkAclRuleProtocolIcmptcpudpModel.getProtocol()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolIndividualTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolIndividualTest.java new file mode 100644 index 0000000000..f26d98dd20 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRuleNetworkACLRuleProtocolIndividualTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.Deleted; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleNetworkACLRuleProtocolIndividual; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRuleNetworkACLRuleProtocolIndividual model. + */ +public class NetworkACLRuleNetworkACLRuleProtocolIndividualTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRuleNetworkACLRuleProtocolIndividual() throws Throwable { + NetworkACLRuleNetworkACLRuleProtocolIndividual networkAclRuleNetworkAclRuleProtocolIndividualModel = new NetworkACLRuleNetworkACLRuleProtocolIndividual(); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getAction()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getBefore()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getCreatedAt()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getDestination()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getDirection()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getHref()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getId()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getIpVersion()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getName()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getSource()); + assertNull(networkAclRuleNetworkAclRuleProtocolIndividualModel.getProtocol()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeTest.java similarity index 64% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeTest.java index 384ab5767c..b847e6a5c6 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeTest.java @@ -13,7 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -23,47 +23,47 @@ import static org.testng.Assert.*; /** - * Unit test class for the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype model. + * Unit test class for the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype model. */ -public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeTest { +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype() throws Throwable { - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Builder() + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype() throws Throwable { + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Builder() .action("allow") .destination("192.168.3.2/32") .direction("inbound") .ipVersion("ipv4") .name("my-network-acl-rule") .source("192.168.3.2/32") - .protocol("all") + .protocol("any") .build(); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.action(), "allow"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.destination(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.direction(), "inbound"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.ipVersion(), "ipv4"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.name(), "my-network-acl-rule"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.source(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel.protocol(), "all"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel.protocol(), "any"); - String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModel); + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModel); - NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.class); - assertTrue(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.action(), "allow"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.destination(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.direction(), "inbound"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.ipVersion(), "ipv4"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.name(), "my-network-acl-rule"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.source(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAllPrototypeModelNew.protocol(), "all"); + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolAnyPrototypeModelNew.protocol(), "any"); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototypeError() throws Throwable { - new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAllPrototype.Builder().build(); + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAnyPrototype.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototypeTest.java new file mode 100644 index 0000000000..33376745d6 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototypeTest.java @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype() throws Throwable { + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype.Builder() + .action("allow") + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("icmp_tcp_udp") + .build(); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel.protocol(), "icmp_tcp_udp"); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModel); + + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.protocol(), "icmp_tcp_udp"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMPTCPUDPPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeTest.java new file mode 100644 index 0000000000..d272608d88 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeTest.java @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype() throws Throwable { + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel = new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.Builder() + .action("allow") + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("ah") + .build(); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel.protocol(), "ah"); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModel); + + NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclContextNetworkAclRuleProtocolIndividualPrototypeModelNew.protocol(), "ah"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolIndividualPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeTest.java deleted file mode 100644 index f6f6c8e077..0000000000 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2023, 2024, 2025. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.cloud.is.vpc.v1.model; - -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype; -import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; -import static org.testng.Assert.*; - -/** - * Unit test class for the NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype model. - */ -public class NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype() throws Throwable { - NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() - .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") - .build(); - assertEquals(networkAclRuleBeforePrototypeModel.id(), "r006-8daca77a-4980-4d33-8f3e-7038797be8f9"); - - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Builder() - .action("allow") - .before(networkAclRuleBeforePrototypeModel) - .destination("192.168.3.2/32") - .direction("inbound") - .ipVersion("ipv4") - .name("my-network-acl-rule") - .source("192.168.3.2/32") - .protocol("all") - .build(); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.action(), "allow"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.before(), networkAclRuleBeforePrototypeModel); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.destination(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.direction(), "inbound"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.ipVersion(), "ipv4"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.name(), "my-network-acl-rule"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.source(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel.protocol(), "all"); - - String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModel); - - NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.class); - assertTrue(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.action(), "allow"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.before().toString(), networkAclRuleBeforePrototypeModel.toString()); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.destination(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.direction(), "inbound"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.ipVersion(), "ipv4"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.name(), "my-network-acl-rule"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.source(), "192.168.3.2/32"); - assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAllPrototypeModelNew.protocol(), "all"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testNetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototypeError() throws Throwable { - new NetworkACLRulePrototypeNetworkACLRuleProtocolAllPrototype.Builder().build(); - } - -} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeTest.java new file mode 100644 index 0000000000..3bc9379a06 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeTest.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype() throws Throwable { + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() + .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); + assertEquals(networkAclRuleBeforePrototypeModel.id(), "r006-8daca77a-4980-4d33-8f3e-7038797be8f9"); + + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("any") + .build(); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel.before(), networkAclRuleBeforePrototypeModel); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel.protocol(), "any"); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModel); + + NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew.before().toString(), networkAclRuleBeforePrototypeModel.toString()); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolAnyPrototypeModelNew.protocol(), "any"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLRuleProtocolAnyPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototypeTest.java new file mode 100644 index 0000000000..5ebfe553e8 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototypeTest.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype() throws Throwable { + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() + .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); + assertEquals(networkAclRuleBeforePrototypeModel.id(), "r006-8daca77a-4980-4d33-8f3e-7038797be8f9"); + + NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("icmp_tcp_udp") + .build(); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel.before(), networkAclRuleBeforePrototypeModel); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel.protocol(), "icmp_tcp_udp"); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModel); + + NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.before().toString(), networkAclRuleBeforePrototypeModel.toString()); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIcmptcpudpPrototypeModelNew.protocol(), "icmp_tcp_udp"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLRuleProtocolICMPTCPUDPPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeTest.java new file mode 100644 index 0000000000..6bbef59e5c --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeTest.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype model. + */ +public class NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype() throws Throwable { + NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById networkAclRuleBeforePrototypeModel = new NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById.Builder() + .id("r006-8daca77a-4980-4d33-8f3e-7038797be8f9") + .build(); + assertEquals(networkAclRuleBeforePrototypeModel.id(), "r006-8daca77a-4980-4d33-8f3e-7038797be8f9"); + + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel = new NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.Builder() + .action("allow") + .before(networkAclRuleBeforePrototypeModel) + .destination("192.168.3.2/32") + .direction("inbound") + .ipVersion("ipv4") + .name("my-network-acl-rule") + .source("192.168.3.2/32") + .protocol("ah") + .build(); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel.before(), networkAclRuleBeforePrototypeModel); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel.protocol(), "ah"); + + String json = TestUtilities.serialize(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModel); + + NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew = TestUtilities.deserialize(json, NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.class); + assertTrue(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew instanceof NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew.action(), "allow"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew.before().toString(), networkAclRuleBeforePrototypeModel.toString()); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew.destination(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew.direction(), "inbound"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew.name(), "my-network-acl-rule"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew.source(), "192.168.3.2/32"); + assertEquals(networkAclRulePrototypeNetworkAclRuleProtocolIndividualPrototypeModelNew.protocol(), "ah"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testNetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototypeError() throws Throwable { + new NetworkACLRulePrototypeNetworkACLRuleProtocolIndividualPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLTest.java index bce90e9a47..4f02b7e92c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/NetworkACLTest.java @@ -15,7 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.Deleted; import com.ibm.cloud.is.vpc.v1.model.NetworkACL; -import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleItemNetworkACLRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.NetworkACLRuleReference; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.SubnetReference; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayAdvertisedCidrOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayAdvertisedCidrOptionsTest.java new file mode 100644 index 0000000000..fb4da313be --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/RemoveVpnGatewayAdvertisedCidrOptionsTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.RemoveVpnGatewayAdvertisedCidrOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the RemoveVpnGatewayAdvertisedCidrOptions model. + */ +public class RemoveVpnGatewayAdvertisedCidrOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testRemoveVpnGatewayAdvertisedCidrOptions() throws Throwable { + RemoveVpnGatewayAdvertisedCidrOptions removeVpnGatewayAdvertisedCidrOptionsModel = new RemoveVpnGatewayAdvertisedCidrOptions.Builder() + .vpnGatewayId("testString") + .cidr("192.168.1.0/24") + .build(); + assertEquals(removeVpnGatewayAdvertisedCidrOptionsModel.vpnGatewayId(), "testString"); + assertEquals(removeVpnGatewayAdvertisedCidrOptionsModel.cidr(), "192.168.1.0/24"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testRemoveVpnGatewayAdvertisedCidrOptionsError() throws Throwable { + new RemoveVpnGatewayAdvertisedCidrOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ReplaceBareMetalServerInitializationOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ReplaceBareMetalServerInitializationOptionsTest.java index 6695d178af..e7f91a3b28 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ReplaceBareMetalServerInitializationOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ReplaceBareMetalServerInitializationOptionsTest.java @@ -13,9 +13,11 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.BareMetalServerInitializationDefaultTrustedProfilePrototype; import com.ibm.cloud.is.vpc.v1.model.ImageIdentityById; import com.ibm.cloud.is.vpc.v1.model.KeyIdentityById; import com.ibm.cloud.is.vpc.v1.model.ReplaceBareMetalServerInitializationOptions; +import com.ibm.cloud.is.vpc.v1.model.TrustedProfileIdentityById; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -43,15 +45,29 @@ public void testReplaceBareMetalServerInitializationOptions() throws Throwable { .build(); assertEquals(keyIdentityModel.id(), "r006-82679077-ac3b-4c10-be16-63e9c21f0f45"); + TrustedProfileIdentityById trustedProfileIdentityModel = new TrustedProfileIdentityById.Builder() + .id("Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5") + .build(); + assertEquals(trustedProfileIdentityModel.id(), "Profile-9fd84246-7df4-4667-94e4-8ecde51d5ac5"); + + BareMetalServerInitializationDefaultTrustedProfilePrototype bareMetalServerInitializationDefaultTrustedProfilePrototypeModel = new BareMetalServerInitializationDefaultTrustedProfilePrototype.Builder() + .autoLink(false) + .target(trustedProfileIdentityModel) + .build(); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.autoLink(), Boolean.valueOf(false)); + assertEquals(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel.target(), trustedProfileIdentityModel); + ReplaceBareMetalServerInitializationOptions replaceBareMetalServerInitializationOptionsModel = new ReplaceBareMetalServerInitializationOptions.Builder() .id("testString") .image(imageIdentityModel) .keys(java.util.Arrays.asList(keyIdentityModel)) + .defaultTrustedProfile(bareMetalServerInitializationDefaultTrustedProfilePrototypeModel) .userData("testString") .build(); assertEquals(replaceBareMetalServerInitializationOptionsModel.id(), "testString"); assertEquals(replaceBareMetalServerInitializationOptionsModel.image(), imageIdentityModel); assertEquals(replaceBareMetalServerInitializationOptionsModel.keys(), java.util.Arrays.asList(keyIdentityModel)); + assertEquals(replaceBareMetalServerInitializationOptionsModel.defaultTrustedProfile(), bareMetalServerInitializationDefaultTrustedProfilePrototypeModel); assertEquals(replaceBareMetalServerInitializationOptionsModel.userData(), "testString"); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatchTest.java index 90730c92a2..07cd1aed19 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePatchTest.java @@ -49,6 +49,7 @@ public void testSecurityGroupRulePatch() throws Throwable { .direction("inbound") .ipVersion("ipv4") .local(securityGroupRuleLocalPatchModel) + .name("my-security-group-rule") .portMax(Long.valueOf("22")) .portMin(Long.valueOf("22")) .remote(securityGroupRuleRemotePatchModel) @@ -58,6 +59,7 @@ public void testSecurityGroupRulePatch() throws Throwable { assertEquals(securityGroupRulePatchModel.direction(), "inbound"); assertEquals(securityGroupRulePatchModel.ipVersion(), "ipv4"); assertEquals(securityGroupRulePatchModel.local(), securityGroupRuleLocalPatchModel); + assertEquals(securityGroupRulePatchModel.name(), "my-security-group-rule"); assertEquals(securityGroupRulePatchModel.portMax(), Long.valueOf("22")); assertEquals(securityGroupRulePatchModel.portMin(), Long.valueOf("22")); assertEquals(securityGroupRulePatchModel.remote(), securityGroupRuleRemotePatchModel); @@ -71,6 +73,7 @@ public void testSecurityGroupRulePatch() throws Throwable { assertEquals(securityGroupRulePatchModelNew.direction(), "inbound"); assertEquals(securityGroupRulePatchModelNew.ipVersion(), "ipv4"); assertEquals(securityGroupRulePatchModelNew.local().toString(), securityGroupRuleLocalPatchModel.toString()); + assertEquals(securityGroupRulePatchModelNew.name(), "my-security-group-rule"); assertEquals(securityGroupRulePatchModelNew.portMax(), Long.valueOf("22")); assertEquals(securityGroupRulePatchModelNew.portMin(), Long.valueOf("22")); assertEquals(securityGroupRulePatchModelNew.remote().toString(), securityGroupRuleRemotePatchModel.toString()); @@ -91,6 +94,7 @@ public void testSecurityGroupRulePatchAsPatch() throws Throwable { .direction("inbound") .ipVersion("ipv4") .local(securityGroupRuleLocalPatchModel) + .name("my-security-group-rule") .portMax(Long.valueOf("22")) .portMin(Long.valueOf("22")) .remote(securityGroupRuleRemotePatchModel) @@ -103,6 +107,7 @@ public void testSecurityGroupRulePatchAsPatch() throws Throwable { assertEquals(mergePatch.get("direction"), "inbound"); assertEquals(mergePatch.get("ip_version"), "ipv4"); assertTrue(mergePatch.containsKey("local")); + assertEquals(mergePatch.get("name"), "my-security-group-rule"); assertTrue(mergePatch.containsKey("port_max")); assertTrue(mergePatch.containsKey("port_min")); assertTrue(mergePatch.containsKey("remote")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAllTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolAnyTest.java similarity index 54% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAllTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolAnyTest.java index 08e89b7e67..d753e8d4ff 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolAllTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolAnyTest.java @@ -14,8 +14,8 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalIP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolAny; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemoteIP; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleSecurityGroupRuleProtocolAll; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -25,21 +25,23 @@ import static org.testng.Assert.*; /** - * Unit test class for the SecurityGroupRuleSecurityGroupRuleProtocolAll model. + * Unit test class for the SecurityGroupRuleProtocolAny model. */ -public class SecurityGroupRuleSecurityGroupRuleProtocolAllTest { +public class SecurityGroupRuleProtocolAnyTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testSecurityGroupRuleSecurityGroupRuleProtocolAll() throws Throwable { - SecurityGroupRuleSecurityGroupRuleProtocolAll securityGroupRuleSecurityGroupRuleProtocolAllModel = new SecurityGroupRuleSecurityGroupRuleProtocolAll(); - assertNull(securityGroupRuleSecurityGroupRuleProtocolAllModel.getDirection()); - assertNull(securityGroupRuleSecurityGroupRuleProtocolAllModel.getHref()); - assertNull(securityGroupRuleSecurityGroupRuleProtocolAllModel.getId()); - assertNull(securityGroupRuleSecurityGroupRuleProtocolAllModel.getIpVersion()); - assertNull(securityGroupRuleSecurityGroupRuleProtocolAllModel.getLocal()); - assertNull(securityGroupRuleSecurityGroupRuleProtocolAllModel.getRemote()); - assertNull(securityGroupRuleSecurityGroupRuleProtocolAllModel.getProtocol()); + public void testSecurityGroupRuleProtocolAny() throws Throwable { + SecurityGroupRuleProtocolAny securityGroupRuleProtocolAnyModel = new SecurityGroupRuleProtocolAny(); + assertNull(securityGroupRuleProtocolAnyModel.getDirection()); + assertNull(securityGroupRuleProtocolAnyModel.getHref()); + assertNull(securityGroupRuleProtocolAnyModel.getId()); + assertNull(securityGroupRuleProtocolAnyModel.getIpVersion()); + assertNull(securityGroupRuleProtocolAnyModel.getLocal()); + assertNull(securityGroupRuleProtocolAnyModel.getName()); + assertNull(securityGroupRuleProtocolAnyModel.getRemote()); + assertNull(securityGroupRuleProtocolAnyModel.getResourceType()); + assertNull(securityGroupRuleProtocolAnyModel.getProtocol()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolICMPTCPUDPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolICMPTCPUDPTest.java new file mode 100644 index 0000000000..0880dafa4c --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolICMPTCPUDPTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalIP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolICMPTCPUDP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemoteIP; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SecurityGroupRuleProtocolICMPTCPUDP model. + */ +public class SecurityGroupRuleProtocolICMPTCPUDPTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSecurityGroupRuleProtocolICMPTCPUDP() throws Throwable { + SecurityGroupRuleProtocolICMPTCPUDP securityGroupRuleProtocolIcmptcpudpModel = new SecurityGroupRuleProtocolICMPTCPUDP(); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getDirection()); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getHref()); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getId()); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getIpVersion()); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getLocal()); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getName()); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getRemote()); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getResourceType()); + assertNull(securityGroupRuleProtocolIcmptcpudpModel.getProtocol()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolIndividualTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolIndividualTest.java new file mode 100644 index 0000000000..41ea734a6d --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleProtocolIndividualTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalIP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleProtocolIndividual; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemoteIP; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SecurityGroupRuleProtocolIndividual model. + */ +public class SecurityGroupRuleProtocolIndividualTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSecurityGroupRuleProtocolIndividual() throws Throwable { + SecurityGroupRuleProtocolIndividual securityGroupRuleProtocolIndividualModel = new SecurityGroupRuleProtocolIndividual(); + assertNull(securityGroupRuleProtocolIndividualModel.getDirection()); + assertNull(securityGroupRuleProtocolIndividualModel.getHref()); + assertNull(securityGroupRuleProtocolIndividualModel.getId()); + assertNull(securityGroupRuleProtocolIndividualModel.getIpVersion()); + assertNull(securityGroupRuleProtocolIndividualModel.getLocal()); + assertNull(securityGroupRuleProtocolIndividualModel.getName()); + assertNull(securityGroupRuleProtocolIndividualModel.getRemote()); + assertNull(securityGroupRuleProtocolIndividualModel.getResourceType()); + assertNull(securityGroupRuleProtocolIndividualModel.getProtocol()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeTest.java similarity index 63% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeTest.java index c9c1b9eb4b..826ec65932 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeTest.java @@ -14,7 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeIP; -import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype; import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeIP; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -25,14 +25,14 @@ import static org.testng.Assert.*; /** - * Unit test class for the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll model. + * Unit test class for the SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype model. */ -public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAllTest { +public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll() throws Throwable { + public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype() throws Throwable { SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() .address("192.168.3.4") .build(); @@ -43,33 +43,36 @@ public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolAll() throws .build(); assertEquals(securityGroupRuleRemotePrototypeModel.address(), "192.168.3.4"); - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeSecurityGroupRuleProtocolAllModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder() + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Builder() .direction("inbound") .ipVersion("ipv4") .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") .remote(securityGroupRuleRemotePrototypeModel) - .protocol("all") + .protocol("any") .build(); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModel.direction(), "inbound"); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModel.ipVersion(), "ipv4"); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModel.local(), securityGroupRuleLocalPrototypeModel); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModel.remote(), securityGroupRuleRemotePrototypeModel); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModel.protocol(), "all"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModel.direction(), "inbound"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModel.ipVersion(), "ipv4"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModel.local(), securityGroupRuleLocalPrototypeModel); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModel.name(), "my-rule-1"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModel.remote(), securityGroupRuleRemotePrototypeModel); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModel.protocol(), "any"); - String json = TestUtilities.serialize(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModel); + String json = TestUtilities.serialize(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModel); - SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll securityGroupRulePrototypeSecurityGroupRuleProtocolAllModelNew = TestUtilities.deserialize(json, SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.class); - assertTrue(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModelNew instanceof SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModelNew.direction(), "inbound"); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModelNew.ipVersion(), "ipv4"); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModelNew.local().toString(), securityGroupRuleLocalPrototypeModel.toString()); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModelNew.remote().toString(), securityGroupRuleRemotePrototypeModel.toString()); - assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAllModelNew.protocol(), "all"); + SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModelNew = TestUtilities.deserialize(json, SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.class); + assertTrue(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModelNew instanceof SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModelNew.direction(), "inbound"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModelNew.local().toString(), securityGroupRuleLocalPrototypeModel.toString()); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModelNew.name(), "my-rule-1"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModelNew.remote().toString(), securityGroupRuleRemotePrototypeModel.toString()); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeModelNew.protocol(), "any"); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolAllError() throws Throwable { - new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAll.Builder().build(); + public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototypeError() throws Throwable { + new SecurityGroupRulePrototypeSecurityGroupRuleProtocolAnyPrototype.Builder().build(); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototypeTest.java new file mode 100644 index 0000000000..c432408fb0 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototypeTest.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeIP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeIP; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype model. + */ +public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype() throws Throwable { + SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() + .address("192.168.3.4") + .build(); + assertEquals(securityGroupRuleLocalPrototypeModel.address(), "192.168.3.4"); + + SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() + .address("192.168.3.4") + .build(); + assertEquals(securityGroupRuleRemotePrototypeModel.address(), "192.168.3.4"); + + SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype.Builder() + .direction("inbound") + .ipVersion("ipv4") + .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") + .remote(securityGroupRuleRemotePrototypeModel) + .protocol("icmp_tcp_udp") + .build(); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModel.direction(), "inbound"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModel.ipVersion(), "ipv4"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModel.local(), securityGroupRuleLocalPrototypeModel); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModel.name(), "my-rule-1"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModel.remote(), securityGroupRuleRemotePrototypeModel); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModel.protocol(), "icmp_tcp_udp"); + + String json = TestUtilities.serialize(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModel); + + SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModelNew = TestUtilities.deserialize(json, SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype.class); + assertTrue(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModelNew instanceof SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModelNew.direction(), "inbound"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModelNew.local().toString(), securityGroupRuleLocalPrototypeModel.toString()); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModelNew.name(), "my-rule-1"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModelNew.remote().toString(), securityGroupRuleRemotePrototypeModel.toString()); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmptcpudpPrototypeModelNew.protocol(), "icmp_tcp_udp"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototypeError() throws Throwable { + new SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTCPUDPPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTest.java index 598fa32827..9c8be3ad35 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPTest.java @@ -47,6 +47,7 @@ public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP() throws .direction("inbound") .ipVersion("ipv4") .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") .remote(securityGroupRuleRemotePrototypeModel) .code(Long.valueOf("0")) .protocol("icmp") @@ -55,6 +56,7 @@ public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP() throws assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModel.direction(), "inbound"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModel.ipVersion(), "ipv4"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModel.local(), securityGroupRuleLocalPrototypeModel); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModel.name(), "my-rule-1"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModel.remote(), securityGroupRuleRemotePrototypeModel); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModel.code(), Long.valueOf("0")); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModel.protocol(), "icmp"); @@ -67,6 +69,7 @@ public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP() throws assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModelNew.direction(), "inbound"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModelNew.ipVersion(), "ipv4"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModelNew.local().toString(), securityGroupRuleLocalPrototypeModel.toString()); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModelNew.name(), "my-rule-1"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModelNew.remote().toString(), securityGroupRuleRemotePrototypeModel.toString()); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModelNew.code(), Long.valueOf("0")); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIcmpModelNew.protocol(), "icmp"); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeTest.java new file mode 100644 index 0000000000..fbff92e978 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeTest.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleLocalPrototypeIP; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype; +import com.ibm.cloud.is.vpc.v1.model.SecurityGroupRuleRemotePrototypeIP; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype model. + */ +public class SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype() throws Throwable { + SecurityGroupRuleLocalPrototypeIP securityGroupRuleLocalPrototypeModel = new SecurityGroupRuleLocalPrototypeIP.Builder() + .address("192.168.3.4") + .build(); + assertEquals(securityGroupRuleLocalPrototypeModel.address(), "192.168.3.4"); + + SecurityGroupRuleRemotePrototypeIP securityGroupRuleRemotePrototypeModel = new SecurityGroupRuleRemotePrototypeIP.Builder() + .address("192.168.3.4") + .build(); + assertEquals(securityGroupRuleRemotePrototypeModel.address(), "192.168.3.4"); + + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModel = new SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.Builder() + .direction("inbound") + .ipVersion("ipv4") + .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") + .remote(securityGroupRuleRemotePrototypeModel) + .protocol("ah") + .build(); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModel.direction(), "inbound"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModel.ipVersion(), "ipv4"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModel.local(), securityGroupRuleLocalPrototypeModel); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModel.name(), "my-rule-1"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModel.remote(), securityGroupRuleRemotePrototypeModel); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModel.protocol(), "ah"); + + String json = TestUtilities.serialize(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModel); + + SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModelNew = TestUtilities.deserialize(json, SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.class); + assertTrue(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModelNew instanceof SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModelNew.direction(), "inbound"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModelNew.ipVersion(), "ipv4"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModelNew.local().toString(), securityGroupRuleLocalPrototypeModel.toString()); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModelNew.name(), "my-rule-1"); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModelNew.remote().toString(), securityGroupRuleRemotePrototypeModel.toString()); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeModelNew.protocol(), "ah"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototypeError() throws Throwable { + new SecurityGroupRulePrototypeSecurityGroupRuleProtocolIndividualPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDPTest.java index cd5f350a12..51eb9b014b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDPTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDPTest.java @@ -47,6 +47,7 @@ public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP() thro .direction("inbound") .ipVersion("ipv4") .local(securityGroupRuleLocalPrototypeModel) + .name("my-rule-1") .remote(securityGroupRuleRemotePrototypeModel) .portMax(Long.valueOf("22")) .portMin(Long.valueOf("22")) @@ -55,6 +56,7 @@ public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP() thro assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModel.direction(), "inbound"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModel.ipVersion(), "ipv4"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModel.local(), securityGroupRuleLocalPrototypeModel); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModel.name(), "my-rule-1"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModel.remote(), securityGroupRuleRemotePrototypeModel); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModel.portMax(), Long.valueOf("22")); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModel.portMin(), Long.valueOf("22")); @@ -67,6 +69,7 @@ public void testSecurityGroupRulePrototypeSecurityGroupRuleProtocolTCPUDP() thro assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModelNew.direction(), "inbound"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModelNew.ipVersion(), "ipv4"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModelNew.local().toString(), securityGroupRuleLocalPrototypeModel.toString()); + assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModelNew.name(), "my-rule-1"); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModelNew.remote().toString(), securityGroupRuleRemotePrototypeModel.toString()); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModelNew.portMax(), Long.valueOf("22")); assertEquals(securityGroupRulePrototypeSecurityGroupRuleProtocolTcpudpModelNew.portMin(), Long.valueOf("22")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMPTest.java index 7e57e80205..79a13e877f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMPTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolICMPTest.java @@ -39,7 +39,9 @@ public void testSecurityGroupRuleSecurityGroupRuleProtocolICMP() throws Throwabl assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getId()); assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getIpVersion()); assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getLocal()); + assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getName()); assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getRemote()); + assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getResourceType()); assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getCode()); assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getProtocol()); assertNull(securityGroupRuleSecurityGroupRuleProtocolIcmpModel.getType()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDPTest.java index 1819fdad24..4ffa0a4fe7 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDPTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SecurityGroupRuleSecurityGroupRuleProtocolTCPUDPTest.java @@ -39,7 +39,9 @@ public void testSecurityGroupRuleSecurityGroupRuleProtocolTCPUDP() throws Throwa assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getId()); assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getIpVersion()); assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getLocal()); + assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getName()); assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getRemote()); + assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getResourceType()); assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getPortMax()); assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getPortMin()); assertNull(securityGroupRuleSecurityGroupRuleProtocolTcpudpModel.getProtocol()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTest.java index 02a3db4a34..8b903f42bd 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupTest.java @@ -94,10 +94,12 @@ public void testShareMountTargetPrototypeShareMountTargetByAccessControlModeSecu assertEquals(shareMountTargetVirtualNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) .build(); + assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModel.virtualNetworkInterface(), shareMountTargetVirtualNetworkInterfacePrototypeModel); @@ -106,6 +108,7 @@ public void testShareMountTargetPrototypeShareMountTargetByAccessControlModeSecu ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModelNew = TestUtilities.deserialize(json, ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.class); assertTrue(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModelNew instanceof ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup); + assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModelNew.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModelNew.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModelNew.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroupModelNew.virtualNetworkInterface().toString(), shareMountTargetVirtualNetworkInterfacePrototypeModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTest.java index 5050f7d64e..ae52d176e2 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPCTest.java @@ -38,10 +38,12 @@ public void testShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC( assertEquals(vpcIdentityModel.id(), "r006-4727d842-f94f-4a2d-824a-9bc9b02c523b"); ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .vpc(vpcIdentityModel) .build(); + assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModel.vpc(), vpcIdentityModel); @@ -50,6 +52,7 @@ public void testShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC( ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModelNew = TestUtilities.deserialize(json, ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC.class); assertTrue(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModelNew instanceof ShareMountTargetPrototypeShareMountTargetByAccessControlModeVPC); + assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModelNew.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModelNew.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModelNew.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeShareMountTargetByAccessControlModeVpcModelNew.vpc().toString(), vpcIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetTest.java index 28e6ccb168..b0acb65d0a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareMountTargetTest.java @@ -38,6 +38,7 @@ public class ShareMountTargetTest { public void testShareMountTarget() throws Throwable { ShareMountTarget shareMountTargetModel = new ShareMountTarget(); assertNull(shareMountTargetModel.getAccessControlMode()); + assertNull(shareMountTargetModel.getAccessProtocol()); assertNull(shareMountTargetModel.getCreatedAt()); assertNull(shareMountTargetModel.getHref()); assertNull(shareMountTargetModel.getId()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePatchTest.java index c5f8c09816..85937603f1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePatchTest.java @@ -40,7 +40,9 @@ public void testSharePatch() throws Throwable { SharePatch sharePatchModel = new SharePatch.Builder() .accessControlMode("security_group") - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) + .bandwidth(Long.valueOf("1")) .iops(Long.valueOf("100")) .name("my-share") .profile(shareProfileIdentityModel) @@ -49,7 +51,9 @@ public void testSharePatch() throws Throwable { .userTags(java.util.Arrays.asList("testString")) .build(); assertEquals(sharePatchModel.accessControlMode(), "security_group"); - assertEquals(sharePatchModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePatchModel.allowedAccessProtocols(), java.util.Arrays.asList("nfs4")); + assertEquals(sharePatchModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); + assertEquals(sharePatchModel.bandwidth(), Long.valueOf("1")); assertEquals(sharePatchModel.iops(), Long.valueOf("100")); assertEquals(sharePatchModel.name(), "my-share"); assertEquals(sharePatchModel.profile(), shareProfileIdentityModel); @@ -62,6 +66,7 @@ public void testSharePatch() throws Throwable { SharePatch sharePatchModelNew = TestUtilities.deserialize(json, SharePatch.class); assertTrue(sharePatchModelNew instanceof SharePatch); assertEquals(sharePatchModelNew.accessControlMode(), "security_group"); + assertEquals(sharePatchModelNew.bandwidth(), Long.valueOf("1")); assertEquals(sharePatchModelNew.iops(), Long.valueOf("100")); assertEquals(sharePatchModelNew.name(), "my-share"); assertEquals(sharePatchModelNew.profile().toString(), shareProfileIdentityModel.toString()); @@ -76,7 +81,9 @@ public void testSharePatchAsPatch() throws Throwable { SharePatch sharePatchModel = new SharePatch.Builder() .accessControlMode("security_group") - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) + .bandwidth(Long.valueOf("1")) .iops(Long.valueOf("100")) .name("my-share") .profile(shareProfileIdentityModel) @@ -88,7 +95,9 @@ public void testSharePatchAsPatch() throws Throwable { Map mergePatch = sharePatchModel.asPatch(); assertEquals(mergePatch.get("access_control_mode"), "security_group"); + assertTrue(mergePatch.containsKey("allowed_access_protocols")); assertTrue(mergePatch.containsKey("allowed_transit_encryption_modes")); + assertTrue(mergePatch.containsKey("bandwidth")); assertTrue(mergePatch.containsKey("iops")); assertEquals(mergePatch.get("name"), "my-share"); assertTrue(mergePatch.containsKey("profile")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsSubsetTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsSubsetTest.java new file mode 100644 index 0000000000..78e9d5c15c --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsSubsetTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedAccessProtocolsSubset; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileAllowedAccessProtocolsSubset model. + */ +public class ShareProfileAllowedAccessProtocolsSubsetTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileAllowedAccessProtocolsSubset() throws Throwable { + ShareProfileAllowedAccessProtocolsSubset shareProfileAllowedAccessProtocolsSubsetModel = new ShareProfileAllowedAccessProtocolsSubset(); + assertNull(shareProfileAllowedAccessProtocolsSubsetModel.getXDefault()); + assertNull(shareProfileAllowedAccessProtocolsSubsetModel.getType()); + assertNull(shareProfileAllowedAccessProtocolsSubsetModel.getValues()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsTest.java new file mode 100644 index 0000000000..38f23ae1ac --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedAccessProtocolsTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedAccessProtocols; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileAllowedAccessProtocols model. + */ +public class ShareProfileAllowedAccessProtocolsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testShareProfileAllowedAccessProtocols() throws Throwable { + ShareProfileAllowedAccessProtocols shareProfileAllowedAccessProtocolsModel = new ShareProfileAllowedAccessProtocols(); + assertNotNull(shareProfileAllowedAccessProtocolsModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesSubsetTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesSubsetTest.java new file mode 100644 index 0000000000..ad27d9d5f0 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesSubsetTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedTransitEncryptionModesSubset; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileAllowedTransitEncryptionModesSubset model. + */ +public class ShareProfileAllowedTransitEncryptionModesSubsetTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileAllowedTransitEncryptionModesSubset() throws Throwable { + ShareProfileAllowedTransitEncryptionModesSubset shareProfileAllowedTransitEncryptionModesSubsetModel = new ShareProfileAllowedTransitEncryptionModesSubset(); + assertNull(shareProfileAllowedTransitEncryptionModesSubsetModel.getXDefault()); + assertNull(shareProfileAllowedTransitEncryptionModesSubsetModel.getType()); + assertNull(shareProfileAllowedTransitEncryptionModesSubsetModel.getValues()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesTest.java new file mode 100644 index 0000000000..150629feb4 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAllowedTransitEncryptionModesTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedTransitEncryptionModes; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileAllowedTransitEncryptionModes model. + */ +public class ShareProfileAllowedTransitEncryptionModesTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testShareProfileAllowedTransitEncryptionModes() throws Throwable { + ShareProfileAllowedTransitEncryptionModes shareProfileAllowedTransitEncryptionModesModel = new ShareProfileAllowedTransitEncryptionModes(); + assertNotNull(shareProfileAllowedTransitEncryptionModesModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesEnumTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesEnumTest.java new file mode 100644 index 0000000000..830ee7958a --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesEnumTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModesEnum; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileAvailabilityModesEnum model. + */ +public class ShareProfileAvailabilityModesEnumTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileAvailabilityModesEnum() throws Throwable { + ShareProfileAvailabilityModesEnum shareProfileAvailabilityModesEnumModel = new ShareProfileAvailabilityModesEnum(); + assertNull(shareProfileAvailabilityModesEnumModel.getXDefault()); + assertNull(shareProfileAvailabilityModesEnumModel.getType()); + assertNull(shareProfileAvailabilityModesEnumModel.getValues()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesFixedTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesFixedTest.java new file mode 100644 index 0000000000..200f6c0517 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesFixedTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModesFixed; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileAvailabilityModesFixed model. + */ +public class ShareProfileAvailabilityModesFixedTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileAvailabilityModesFixed() throws Throwable { + ShareProfileAvailabilityModesFixed shareProfileAvailabilityModesFixedModel = new ShareProfileAvailabilityModesFixed(); + assertNull(shareProfileAvailabilityModesFixedModel.getType()); + assertNull(shareProfileAvailabilityModesFixedModel.getValue()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesTest.java new file mode 100644 index 0000000000..35c2b9e19d --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileAvailabilityModesTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModes; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileAvailabilityModes model. + */ +public class ShareProfileAvailabilityModesTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testShareProfileAvailabilityModes() throws Throwable { + ShareProfileAvailabilityModes shareProfileAvailabilityModesModel = new ShareProfileAvailabilityModes(); + assertNotNull(shareProfileAvailabilityModesModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentRangeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentRangeTest.java new file mode 100644 index 0000000000..5274b4ee49 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentRangeTest.java @@ -0,0 +1,40 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthDependentRange; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileBandwidthDependentRange model. + */ +public class ShareProfileBandwidthDependentRangeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileBandwidthDependentRange() throws Throwable { + ShareProfileBandwidthDependentRange shareProfileBandwidthDependentRangeModel = new ShareProfileBandwidthDependentRange(); + assertNull(shareProfileBandwidthDependentRangeModel.getMax()); + assertNull(shareProfileBandwidthDependentRangeModel.getMin()); + assertNull(shareProfileBandwidthDependentRangeModel.getStep()); + assertNull(shareProfileBandwidthDependentRangeModel.getType()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentTest.java similarity index 72% rename from modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPTest.java rename to modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentTest.java index d71eb596d8..7d12781570 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/LoadBalancerPoolMemberTargetIPTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthDependentTest.java @@ -13,7 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; -import com.ibm.cloud.is.vpc.v1.model.LoadBalancerPoolMemberTargetIP; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthDependent; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -23,15 +23,15 @@ import static org.testng.Assert.*; /** - * Unit test class for the LoadBalancerPoolMemberTargetIP model. + * Unit test class for the ShareProfileBandwidthDependent model. */ -public class LoadBalancerPoolMemberTargetIPTest { +public class ShareProfileBandwidthDependentTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testLoadBalancerPoolMemberTargetIP() throws Throwable { - LoadBalancerPoolMemberTargetIP loadBalancerPoolMemberTargetIpModel = new LoadBalancerPoolMemberTargetIP(); - assertNull(loadBalancerPoolMemberTargetIpModel.getAddress()); + public void testShareProfileBandwidthDependent() throws Throwable { + ShareProfileBandwidthDependent shareProfileBandwidthDependentModel = new ShareProfileBandwidthDependent(); + assertNull(shareProfileBandwidthDependentModel.getType()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthEnumTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthEnumTest.java new file mode 100644 index 0000000000..910ef4cd7b --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthEnumTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthEnum; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileBandwidthEnum model. + */ +public class ShareProfileBandwidthEnumTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileBandwidthEnum() throws Throwable { + ShareProfileBandwidthEnum shareProfileBandwidthEnumModel = new ShareProfileBandwidthEnum(); + assertNull(shareProfileBandwidthEnumModel.getXDefault()); + assertNull(shareProfileBandwidthEnumModel.getType()); + assertNull(shareProfileBandwidthEnumModel.getValues()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthFixedTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthFixedTest.java new file mode 100644 index 0000000000..5769271699 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthFixedTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthFixed; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileBandwidthFixed model. + */ +public class ShareProfileBandwidthFixedTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileBandwidthFixed() throws Throwable { + ShareProfileBandwidthFixed shareProfileBandwidthFixedModel = new ShareProfileBandwidthFixed(); + assertNull(shareProfileBandwidthFixedModel.getType()); + assertNull(shareProfileBandwidthFixedModel.getValue()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthRangeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthRangeTest.java new file mode 100644 index 0000000000..7cd75eb552 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthRangeTest.java @@ -0,0 +1,42 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthRange; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileBandwidthRange model. + */ +public class ShareProfileBandwidthRangeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileBandwidthRange() throws Throwable { + ShareProfileBandwidthRange shareProfileBandwidthRangeModel = new ShareProfileBandwidthRange(); + assertNull(shareProfileBandwidthRangeModel.getXDefault()); + assertNull(shareProfileBandwidthRangeModel.getMax()); + assertNull(shareProfileBandwidthRangeModel.getMin()); + assertNull(shareProfileBandwidthRangeModel.getStep()); + assertNull(shareProfileBandwidthRangeModel.getType()); + assertNull(shareProfileBandwidthRangeModel.getValue()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthTest.java new file mode 100644 index 0000000000..f12eb33a82 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileBandwidthTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidth; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileBandwidth model. + */ +public class ShareProfileBandwidthTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testShareProfileBandwidth() throws Throwable { + ShareProfileBandwidth shareProfileBandwidthModel = new ShareProfileBandwidth(); + assertNotNull(shareProfileBandwidthModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileCollectionTest.java index 667fc019b3..857a4b453f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileCollectionTest.java @@ -15,9 +15,14 @@ import com.ibm.cloud.is.vpc.v1.model.PageLink; import com.ibm.cloud.is.vpc.v1.model.ShareProfile; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedAccessProtocolsSubset; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedTransitEncryptionModesSubset; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModesFixed; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthRange; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCapacityRange; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCollection; import com.ibm.cloud.is.vpc.v1.model.ShareProfileIOPSRange; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileStorageGenerationFixed; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationFixedTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationFixedTest.java new file mode 100644 index 0000000000..b0ab033f52 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationFixedTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileStorageGenerationFixed; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileStorageGenerationFixed model. + */ +public class ShareProfileStorageGenerationFixedTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testShareProfileStorageGenerationFixed() throws Throwable { + ShareProfileStorageGenerationFixed shareProfileStorageGenerationFixedModel = new ShareProfileStorageGenerationFixed(); + assertNull(shareProfileStorageGenerationFixedModel.getType()); + assertNull(shareProfileStorageGenerationFixedModel.getValue()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationTest.java new file mode 100644 index 0000000000..49868f3ada --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileStorageGenerationTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.ShareProfileStorageGeneration; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the ShareProfileStorageGeneration model. + */ +public class ShareProfileStorageGenerationTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testShareProfileStorageGeneration() throws Throwable { + ShareProfileStorageGeneration shareProfileStorageGenerationModel = new ShareProfileStorageGeneration(); + assertNotNull(shareProfileStorageGenerationModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileTest.java index 04b636e88a..3a14674e41 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareProfileTest.java @@ -14,8 +14,13 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.ShareProfile; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedAccessProtocolsSubset; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAllowedTransitEncryptionModesSubset; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileAvailabilityModesFixed; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileBandwidthRange; import com.ibm.cloud.is.vpc.v1.model.ShareProfileCapacityRange; import com.ibm.cloud.is.vpc.v1.model.ShareProfileIOPSRange; +import com.ibm.cloud.is.vpc.v1.model.ShareProfileStorageGenerationFixed; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -34,11 +39,16 @@ public class ShareProfileTest { @Test public void testShareProfile() throws Throwable { ShareProfile shareProfileModel = new ShareProfile(); + assertNull(shareProfileModel.getAllowedAccessProtocols()); + assertNull(shareProfileModel.getAllowedTransitEncryptionModes()); + assertNull(shareProfileModel.getAvailabilityModes()); + assertNull(shareProfileModel.getBandwidth()); assertNull(shareProfileModel.getCapacity()); assertNull(shareProfileModel.getFamily()); assertNull(shareProfileModel.getHref()); assertNull(shareProfileModel.getIops()); assertNull(shareProfileModel.getName()); assertNull(shareProfileModel.getResourceType()); + assertNull(shareProfileModel.getStorageGeneration()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareByOriginShareTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareByOriginShareTest.java index f511248bb3..f6f80ac252 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareByOriginShareTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareByOriginShareTest.java @@ -99,10 +99,12 @@ public void testSharePrototypeShareByOriginShare() throws Throwable { assertEquals(shareMountTargetVirtualNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) .build(); + assertEquals(shareMountTargetPrototypeModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeModel.virtualNetworkInterface(), shareMountTargetVirtualNetworkInterfacePrototypeModel); @@ -118,7 +120,7 @@ public void testSharePrototypeShareByOriginShare() throws Throwable { assertEquals(zoneIdentityModel.name(), "us-south-1"); SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .iops(Long.valueOf("100")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") @@ -128,7 +130,7 @@ public void testSharePrototypeShareByOriginShare() throws Throwable { .userTags(java.util.Arrays.asList()) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareContextModel.iops(), Long.valueOf("100")); assertEquals(sharePrototypeShareContextModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareContextModel.name(), "my-share"); @@ -144,19 +146,21 @@ public void testSharePrototypeShareByOriginShare() throws Throwable { assertEquals(shareIdentityModel.id(), "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58"); SharePrototypeShareByOriginShare sharePrototypeShareByOriginShareModel = new SharePrototypeShareByOriginShare.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") .replicaShare(sharePrototypeShareContextModel) .userTags(java.util.Arrays.asList()) .originShare(shareIdentityModel) + .resourceGroup(resourceGroupIdentityModel) .build(); - assertEquals(sharePrototypeShareByOriginShareModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareByOriginShareModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareByOriginShareModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareByOriginShareModel.name(), "my-share"); assertEquals(sharePrototypeShareByOriginShareModel.replicaShare(), sharePrototypeShareContextModel); assertEquals(sharePrototypeShareByOriginShareModel.userTags(), java.util.Arrays.asList()); assertEquals(sharePrototypeShareByOriginShareModel.originShare(), shareIdentityModel); + assertEquals(sharePrototypeShareByOriginShareModel.resourceGroup(), resourceGroupIdentityModel); String json = TestUtilities.serialize(sharePrototypeShareByOriginShareModel); @@ -165,6 +169,7 @@ public void testSharePrototypeShareByOriginShare() throws Throwable { assertEquals(sharePrototypeShareByOriginShareModelNew.name(), "my-share"); assertEquals(sharePrototypeShareByOriginShareModelNew.replicaShare().toString(), sharePrototypeShareContextModel.toString()); assertEquals(sharePrototypeShareByOriginShareModelNew.originShare().toString(), shareIdentityModel.toString()); + assertEquals(sharePrototypeShareByOriginShareModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySizeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySizeTest.java index 92f74fb63b..7e92e25769 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySizeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySizeTest.java @@ -100,10 +100,12 @@ public void testSharePrototypeShareBySize() throws Throwable { assertEquals(shareMountTargetVirtualNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) .build(); + assertEquals(shareMountTargetPrototypeModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeModel.virtualNetworkInterface(), shareMountTargetVirtualNetworkInterfacePrototypeModel); @@ -119,7 +121,7 @@ public void testSharePrototypeShareBySize() throws Throwable { assertEquals(zoneIdentityModel.name(), "us-south-1"); SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .iops(Long.valueOf("100")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") @@ -129,7 +131,7 @@ public void testSharePrototypeShareBySize() throws Throwable { .userTags(java.util.Arrays.asList()) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareContextModel.iops(), Long.valueOf("100")); assertEquals(sharePrototypeShareContextModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareContextModel.name(), "my-share"); @@ -152,12 +154,14 @@ public void testSharePrototypeShareBySize() throws Throwable { assertEquals(shareInitialOwnerModel.uid(), Long.valueOf("50")); SharePrototypeShareBySize sharePrototypeShareBySizeModel = new SharePrototypeShareBySize.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") .replicaShare(sharePrototypeShareContextModel) .userTags(java.util.Arrays.asList()) .accessControlMode("security_group") + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .bandwidth(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .initialOwner(shareInitialOwnerModel) .iops(Long.valueOf("100")) @@ -166,12 +170,14 @@ public void testSharePrototypeShareBySize() throws Throwable { .size(Long.valueOf("200")) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeShareBySizeModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareBySizeModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareBySizeModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareBySizeModel.name(), "my-share"); assertEquals(sharePrototypeShareBySizeModel.replicaShare(), sharePrototypeShareContextModel); assertEquals(sharePrototypeShareBySizeModel.userTags(), java.util.Arrays.asList()); assertEquals(sharePrototypeShareBySizeModel.accessControlMode(), "security_group"); + assertEquals(sharePrototypeShareBySizeModel.allowedAccessProtocols(), java.util.Arrays.asList("nfs4")); + assertEquals(sharePrototypeShareBySizeModel.bandwidth(), Long.valueOf("100")); assertEquals(sharePrototypeShareBySizeModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(sharePrototypeShareBySizeModel.initialOwner(), shareInitialOwnerModel); assertEquals(sharePrototypeShareBySizeModel.iops(), Long.valueOf("100")); @@ -187,6 +193,7 @@ public void testSharePrototypeShareBySize() throws Throwable { assertEquals(sharePrototypeShareBySizeModelNew.name(), "my-share"); assertEquals(sharePrototypeShareBySizeModelNew.replicaShare().toString(), sharePrototypeShareContextModel.toString()); assertEquals(sharePrototypeShareBySizeModelNew.accessControlMode(), "security_group"); + assertEquals(sharePrototypeShareBySizeModelNew.bandwidth(), Long.valueOf("100")); assertEquals(sharePrototypeShareBySizeModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); assertEquals(sharePrototypeShareBySizeModelNew.initialOwner().toString(), shareInitialOwnerModel.toString()); assertEquals(sharePrototypeShareBySizeModelNew.iops(), Long.valueOf("100")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceShareTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceShareTest.java index e5a415a614..1bc85a5396 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceShareTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceShareTest.java @@ -100,10 +100,12 @@ public void testSharePrototypeShareBySourceShare() throws Throwable { assertEquals(shareMountTargetVirtualNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) .build(); + assertEquals(shareMountTargetPrototypeModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeModel.virtualNetworkInterface(), shareMountTargetVirtualNetworkInterfacePrototypeModel); @@ -119,7 +121,7 @@ public void testSharePrototypeShareBySourceShare() throws Throwable { assertEquals(zoneIdentityModel.name(), "us-south-1"); SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .iops(Long.valueOf("100")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") @@ -129,7 +131,7 @@ public void testSharePrototypeShareBySourceShare() throws Throwable { .userTags(java.util.Arrays.asList()) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareContextModel.iops(), Long.valueOf("100")); assertEquals(sharePrototypeShareContextModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareContextModel.name(), "my-share"); @@ -150,7 +152,7 @@ public void testSharePrototypeShareBySourceShare() throws Throwable { assertEquals(shareIdentityModel.id(), "r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58"); SharePrototypeShareBySourceShare sharePrototypeShareBySourceShareModel = new SharePrototypeShareBySourceShare.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") .replicaShare(sharePrototypeShareContextModel) @@ -163,7 +165,7 @@ public void testSharePrototypeShareBySourceShare() throws Throwable { .sourceShare(shareIdentityModel) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeShareBySourceShareModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareBySourceShareModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareBySourceShareModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareBySourceShareModel.name(), "my-share"); assertEquals(sharePrototypeShareBySourceShareModel.replicaShare(), sharePrototypeShareContextModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceSnapshotTest.java index aeb0c52979..cdd1d51451 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareBySourceSnapshotTest.java @@ -101,10 +101,12 @@ public void testSharePrototypeShareBySourceSnapshot() throws Throwable { assertEquals(shareMountTargetVirtualNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) .build(); + assertEquals(shareMountTargetPrototypeModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeModel.virtualNetworkInterface(), shareMountTargetVirtualNetworkInterfacePrototypeModel); @@ -120,7 +122,7 @@ public void testSharePrototypeShareBySourceSnapshot() throws Throwable { assertEquals(zoneIdentityModel.name(), "us-south-1"); SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .iops(Long.valueOf("100")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") @@ -130,7 +132,7 @@ public void testSharePrototypeShareBySourceSnapshot() throws Throwable { .userTags(java.util.Arrays.asList()) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareContextModel.iops(), Long.valueOf("100")); assertEquals(sharePrototypeShareContextModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareContextModel.name(), "my-share"); @@ -158,11 +160,13 @@ public void testSharePrototypeShareBySourceSnapshot() throws Throwable { assertEquals(shareSourceSnapshotPrototypeModel.id(), "r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4"); SharePrototypeShareBySourceSnapshot sharePrototypeShareBySourceSnapshotModel = new SharePrototypeShareBySourceSnapshot.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") .replicaShare(sharePrototypeShareContextModel) .userTags(java.util.Arrays.asList()) + .allowedAccessProtocols(java.util.Arrays.asList("nfs4")) + .bandwidth(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .initialOwner(shareInitialOwnerModel) .iops(Long.valueOf("100")) @@ -171,11 +175,13 @@ public void testSharePrototypeShareBySourceSnapshot() throws Throwable { .size(Long.valueOf("200")) .sourceSnapshot(shareSourceSnapshotPrototypeModel) .build(); - assertEquals(sharePrototypeShareBySourceSnapshotModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareBySourceSnapshotModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareBySourceSnapshotModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareBySourceSnapshotModel.name(), "my-share"); assertEquals(sharePrototypeShareBySourceSnapshotModel.replicaShare(), sharePrototypeShareContextModel); assertEquals(sharePrototypeShareBySourceSnapshotModel.userTags(), java.util.Arrays.asList()); + assertEquals(sharePrototypeShareBySourceSnapshotModel.allowedAccessProtocols(), java.util.Arrays.asList("nfs4")); + assertEquals(sharePrototypeShareBySourceSnapshotModel.bandwidth(), Long.valueOf("100")); assertEquals(sharePrototypeShareBySourceSnapshotModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(sharePrototypeShareBySourceSnapshotModel.initialOwner(), shareInitialOwnerModel); assertEquals(sharePrototypeShareBySourceSnapshotModel.iops(), Long.valueOf("100")); @@ -190,6 +196,7 @@ public void testSharePrototypeShareBySourceSnapshot() throws Throwable { assertTrue(sharePrototypeShareBySourceSnapshotModelNew instanceof SharePrototypeShareBySourceSnapshot); assertEquals(sharePrototypeShareBySourceSnapshotModelNew.name(), "my-share"); assertEquals(sharePrototypeShareBySourceSnapshotModelNew.replicaShare().toString(), sharePrototypeShareContextModel.toString()); + assertEquals(sharePrototypeShareBySourceSnapshotModelNew.bandwidth(), Long.valueOf("100")); assertEquals(sharePrototypeShareBySourceSnapshotModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); assertEquals(sharePrototypeShareBySourceSnapshotModelNew.initialOwner().toString(), shareInitialOwnerModel.toString()); assertEquals(sharePrototypeShareBySourceSnapshotModelNew.iops(), Long.valueOf("100")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareContextTest.java index 872f85b0d7..2253c21f7a 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SharePrototypeShareContextTest.java @@ -97,10 +97,12 @@ public void testSharePrototypeShareContext() throws Throwable { assertEquals(shareMountTargetVirtualNetworkInterfacePrototypeModel.subnet(), subnetIdentityModel); ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup shareMountTargetPrototypeModel = new ShareMountTargetPrototypeShareMountTargetByAccessControlModeSecurityGroup.Builder() + .accessProtocol("nfs4") .name("my-share-mount-target") .transitEncryption("none") .virtualNetworkInterface(shareMountTargetVirtualNetworkInterfacePrototypeModel) .build(); + assertEquals(shareMountTargetPrototypeModel.accessProtocol(), "nfs4"); assertEquals(shareMountTargetPrototypeModel.name(), "my-share-mount-target"); assertEquals(shareMountTargetPrototypeModel.transitEncryption(), "none"); assertEquals(shareMountTargetPrototypeModel.virtualNetworkInterface(), shareMountTargetVirtualNetworkInterfacePrototypeModel); @@ -116,7 +118,7 @@ public void testSharePrototypeShareContext() throws Throwable { assertEquals(zoneIdentityModel.name(), "us-south-1"); SharePrototypeShareContext sharePrototypeShareContextModel = new SharePrototypeShareContext.Builder() - .allowedTransitEncryptionModes(java.util.Arrays.asList("none")) + .allowedTransitEncryptionModes(java.util.Arrays.asList("ipsec")) .iops(Long.valueOf("100")) .mountTargets(java.util.Arrays.asList(shareMountTargetPrototypeModel)) .name("my-share") @@ -126,7 +128,7 @@ public void testSharePrototypeShareContext() throws Throwable { .userTags(java.util.Arrays.asList()) .zone(zoneIdentityModel) .build(); - assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("none")); + assertEquals(sharePrototypeShareContextModel.allowedTransitEncryptionModes(), java.util.Arrays.asList("ipsec")); assertEquals(sharePrototypeShareContextModel.iops(), Long.valueOf("100")); assertEquals(sharePrototypeShareContextModel.mountTargets(), java.util.Arrays.asList(shareMountTargetPrototypeModel)); assertEquals(sharePrototypeShareContextModel.name(), "my-share"); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshotPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshotPatchTest.java index ada2f1bfca..bd00d3c224 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshotPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareSnapshotPatchTest.java @@ -33,23 +33,28 @@ public class ShareSnapshotPatchTest { @Test public void testShareSnapshotPatch() throws Throwable { ShareSnapshotPatch shareSnapshotPatchModel = new ShareSnapshotPatch.Builder() + .name("my-share-snapshot") .userTags(java.util.Arrays.asList("testString")) .build(); + assertEquals(shareSnapshotPatchModel.name(), "my-share-snapshot"); assertEquals(shareSnapshotPatchModel.userTags(), java.util.Arrays.asList("testString")); String json = TestUtilities.serialize(shareSnapshotPatchModel); ShareSnapshotPatch shareSnapshotPatchModelNew = TestUtilities.deserialize(json, ShareSnapshotPatch.class); assertTrue(shareSnapshotPatchModelNew instanceof ShareSnapshotPatch); + assertEquals(shareSnapshotPatchModelNew.name(), "my-share-snapshot"); } @Test public void testShareSnapshotPatchAsPatch() throws Throwable { ShareSnapshotPatch shareSnapshotPatchModel = new ShareSnapshotPatch.Builder() + .name("my-share-snapshot") .userTags(java.util.Arrays.asList("testString")) .build(); Map mergePatch = shareSnapshotPatchModel.asPatch(); + assertEquals(mergePatch.get("name"), "my-share-snapshot"); assertTrue(mergePatch.containsKey("user_tags")); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareTest.java index 2d3ff04f04..2ba9b8da71 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/ShareTest.java @@ -54,7 +54,10 @@ public void testShare() throws Throwable { assertNull(shareModel.getAccessControlMode()); assertNull(shareModel.getAccessorBindingRole()); assertNull(shareModel.getAccessorBindings()); + assertNull(shareModel.getAllowedAccessProtocols()); assertNull(shareModel.getAllowedTransitEncryptionModes()); + assertNull(shareModel.getAvailabilityMode()); + assertNull(shareModel.getBandwidth()); assertNull(shareModel.getCreatedAt()); assertNull(shareModel.getCrn()); assertNull(shareModel.getEncryption()); @@ -83,6 +86,7 @@ public void testShare() throws Throwable { assertNull(shareModel.getSnapshotSize()); assertNull(shareModel.getSourceShare()); assertNull(shareModel.getSourceSnapshot()); + assertNull(shareModel.getStorageGeneration()); assertNull(shareModel.getUserTags()); assertNull(shareModel.getZone()); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePatchTest.java new file mode 100644 index 0000000000..6f98854eae --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePatchTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SnapshotAllowedUsePatch model. + */ +public class SnapshotAllowedUsePatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSnapshotAllowedUsePatch() throws Throwable { + SnapshotAllowedUsePatch snapshotAllowedUsePatchModel = new SnapshotAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(snapshotAllowedUsePatchModel.apiVersion(), "2024-06-23"); + assertEquals(snapshotAllowedUsePatchModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(snapshotAllowedUsePatchModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + + String json = TestUtilities.serialize(snapshotAllowedUsePatchModel); + + SnapshotAllowedUsePatch snapshotAllowedUsePatchModelNew = TestUtilities.deserialize(json, SnapshotAllowedUsePatch.class); + assertTrue(snapshotAllowedUsePatchModelNew instanceof SnapshotAllowedUsePatch); + assertEquals(snapshotAllowedUsePatchModelNew.apiVersion(), "2024-06-23"); + assertEquals(snapshotAllowedUsePatchModelNew.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(snapshotAllowedUsePatchModelNew.instance(), "gpu.count > 0 && enable_secure_boot == true"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePrototypeTest.java new file mode 100644 index 0000000000..957328e3d8 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUsePrototypeTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SnapshotAllowedUsePrototype model. + */ +public class SnapshotAllowedUsePrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSnapshotAllowedUsePrototype() throws Throwable { + SnapshotAllowedUsePrototype snapshotAllowedUsePrototypeModel = new SnapshotAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(snapshotAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(snapshotAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(snapshotAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + + String json = TestUtilities.serialize(snapshotAllowedUsePrototypeModel); + + SnapshotAllowedUsePrototype snapshotAllowedUsePrototypeModelNew = TestUtilities.deserialize(json, SnapshotAllowedUsePrototype.class); + assertTrue(snapshotAllowedUsePrototypeModelNew instanceof SnapshotAllowedUsePrototype); + assertEquals(snapshotAllowedUsePrototypeModelNew.apiVersion(), "2024-06-23"); + assertEquals(snapshotAllowedUsePrototypeModelNew.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(snapshotAllowedUsePrototypeModelNew.instance(), "gpu.count > 0 && enable_secure_boot == true"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUseTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUseTest.java new file mode 100644 index 0000000000..85ba5a966f --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotAllowedUseTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUse; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SnapshotAllowedUse model. + */ +public class SnapshotAllowedUseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSnapshotAllowedUse() throws Throwable { + SnapshotAllowedUse snapshotAllowedUseModel = new SnapshotAllowedUse(); + assertNull(snapshotAllowedUseModel.getApiVersion()); + assertNull(snapshotAllowedUseModel.getBareMetalServer()); + assertNull(snapshotAllowedUseModel.getInstance()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionTest.java index 1545dd48ed..e599e4d43f 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotCollectionTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.Snapshot; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUse; import com.ibm.cloud.is.vpc.v1.model.SnapshotCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.SnapshotClone; import com.ibm.cloud.is.vpc.v1.model.SnapshotCollection; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfileCollectionTest.java new file mode 100644 index 0000000000..d77fd0f764 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotInstanceProfileCollectionTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileReference; +import com.ibm.cloud.is.vpc.v1.model.PageLink; +import com.ibm.cloud.is.vpc.v1.model.SnapshotInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the SnapshotInstanceProfileCollection model. + */ +public class SnapshotInstanceProfileCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSnapshotInstanceProfileCollection() throws Throwable { + SnapshotInstanceProfileCollection snapshotInstanceProfileCollectionModel = new SnapshotInstanceProfileCollection(); + assertNull(snapshotInstanceProfileCollectionModel.getFirst()); + assertNull(snapshotInstanceProfileCollectionModel.getInstanceProfiles()); + assertNull(snapshotInstanceProfileCollectionModel.getLimit()); + assertNull(snapshotInstanceProfileCollectionModel.getNext()); + assertNull(snapshotInstanceProfileCollectionModel.getTotalCount()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatchTest.java index 8bf1445499..e1bef04b91 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPatchTest.java @@ -13,6 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePatch; import com.ibm.cloud.is.vpc.v1.model.SnapshotPatch; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -32,10 +33,21 @@ public class SnapshotPatchTest { @Test public void testSnapshotPatch() throws Throwable { + SnapshotAllowedUsePatch snapshotAllowedUsePatchModel = new SnapshotAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(snapshotAllowedUsePatchModel.apiVersion(), "2024-06-23"); + assertEquals(snapshotAllowedUsePatchModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(snapshotAllowedUsePatchModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() + .allowedUse(snapshotAllowedUsePatchModel) .name("my-snapshot") .userTags(java.util.Arrays.asList("testString")) .build(); + assertEquals(snapshotPatchModel.allowedUse(), snapshotAllowedUsePatchModel); assertEquals(snapshotPatchModel.name(), "my-snapshot"); assertEquals(snapshotPatchModel.userTags(), java.util.Arrays.asList("testString")); @@ -43,17 +55,26 @@ public void testSnapshotPatch() throws Throwable { SnapshotPatch snapshotPatchModelNew = TestUtilities.deserialize(json, SnapshotPatch.class); assertTrue(snapshotPatchModelNew instanceof SnapshotPatch); + assertEquals(snapshotPatchModelNew.allowedUse().toString(), snapshotAllowedUsePatchModel.toString()); assertEquals(snapshotPatchModelNew.name(), "my-snapshot"); } @Test public void testSnapshotPatchAsPatch() throws Throwable { + SnapshotAllowedUsePatch snapshotAllowedUsePatchModel = new SnapshotAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + SnapshotPatch snapshotPatchModel = new SnapshotPatch.Builder() + .allowedUse(snapshotAllowedUsePatchModel) .name("my-snapshot") .userTags(java.util.Arrays.asList("testString")) .build(); Map mergePatch = snapshotPatchModel.asPatch(); + assertTrue(mergePatch.containsKey("allowed_use")); assertEquals(mergePatch.get("name"), "my-snapshot"); assertTrue(mergePatch.containsKey("user_tags")); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshotTest.java index 19c1042a2f..f1120e73c1 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceSnapshotTest.java @@ -15,6 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotClonePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceSnapshot; @@ -36,6 +37,15 @@ public class SnapshotPrototypeSnapshotBySourceSnapshotTest { @Test public void testSnapshotPrototypeSnapshotBySourceSnapshot() throws Throwable { + SnapshotAllowedUsePrototype snapshotAllowedUsePrototypeModel = new SnapshotAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(snapshotAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(snapshotAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(snapshotAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); @@ -62,6 +72,7 @@ public void testSnapshotPrototypeSnapshotBySourceSnapshot() throws Throwable { assertEquals(snapshotIdentityByCrnModel.crn(), "crn:v1:bluemix:public:is:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34::snapshot:r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); SnapshotPrototypeSnapshotBySourceSnapshot snapshotPrototypeSnapshotBySourceSnapshotModel = new SnapshotPrototypeSnapshotBySourceSnapshot.Builder() + .allowedUse(snapshotAllowedUsePrototypeModel) .clones(java.util.Arrays.asList(snapshotClonePrototypeModel)) .name("my-snapshot") .resourceGroup(resourceGroupIdentityModel) @@ -69,6 +80,7 @@ public void testSnapshotPrototypeSnapshotBySourceSnapshot() throws Throwable { .encryptionKey(encryptionKeyIdentityModel) .sourceSnapshot(snapshotIdentityByCrnModel) .build(); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.allowedUse(), snapshotAllowedUsePrototypeModel); assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.clones(), java.util.Arrays.asList(snapshotClonePrototypeModel)); assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.name(), "my-snapshot"); assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); @@ -80,6 +92,7 @@ public void testSnapshotPrototypeSnapshotBySourceSnapshot() throws Throwable { SnapshotPrototypeSnapshotBySourceSnapshot snapshotPrototypeSnapshotBySourceSnapshotModelNew = TestUtilities.deserialize(json, SnapshotPrototypeSnapshotBySourceSnapshot.class); assertTrue(snapshotPrototypeSnapshotBySourceSnapshotModelNew instanceof SnapshotPrototypeSnapshotBySourceSnapshot); + assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModelNew.allowedUse().toString(), snapshotAllowedUsePrototypeModel.toString()); assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModelNew.name(), "my-snapshot"); assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(snapshotPrototypeSnapshotBySourceSnapshotModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolumeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolumeTest.java index 044b35929a..b73df7ea85 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolumeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeSnapshotBySourceVolumeTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotClonePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototypeSnapshotBySourceVolume; import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityById; @@ -35,6 +36,15 @@ public class SnapshotPrototypeSnapshotBySourceVolumeTest { @Test public void testSnapshotPrototypeSnapshotBySourceVolume() throws Throwable { + SnapshotAllowedUsePrototype snapshotAllowedUsePrototypeModel = new SnapshotAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(snapshotAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(snapshotAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(snapshotAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + ZoneIdentityByName zoneIdentityModel = new ZoneIdentityByName.Builder() .name("us-south-1") .build(); @@ -56,12 +66,14 @@ public void testSnapshotPrototypeSnapshotBySourceVolume() throws Throwable { assertEquals(volumeIdentityModel.id(), "r006-1a6b7274-678d-4dfb-8981-c71dd9d4daa5"); SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeSnapshotBySourceVolumeModel = new SnapshotPrototypeSnapshotBySourceVolume.Builder() + .allowedUse(snapshotAllowedUsePrototypeModel) .clones(java.util.Arrays.asList(snapshotClonePrototypeModel)) .name("my-snapshot") .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .sourceVolume(volumeIdentityModel) .build(); + assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.allowedUse(), snapshotAllowedUsePrototypeModel); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.clones(), java.util.Arrays.asList(snapshotClonePrototypeModel)); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.name(), "my-snapshot"); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModel.resourceGroup(), resourceGroupIdentityModel); @@ -72,6 +84,7 @@ public void testSnapshotPrototypeSnapshotBySourceVolume() throws Throwable { SnapshotPrototypeSnapshotBySourceVolume snapshotPrototypeSnapshotBySourceVolumeModelNew = TestUtilities.deserialize(json, SnapshotPrototypeSnapshotBySourceVolume.class); assertTrue(snapshotPrototypeSnapshotBySourceVolumeModelNew instanceof SnapshotPrototypeSnapshotBySourceVolume); + assertEquals(snapshotPrototypeSnapshotBySourceVolumeModelNew.allowedUse().toString(), snapshotAllowedUsePrototypeModel.toString()); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModelNew.name(), "my-snapshot"); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(snapshotPrototypeSnapshotBySourceVolumeModelNew.sourceVolume().toString(), volumeIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeTest.java index f43c64dba5..6f931e4dbd 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotPrototypeTest.java @@ -14,6 +14,7 @@ package com.ibm.cloud.is.vpc.v1.model; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotClonePrototype; import com.ibm.cloud.is.vpc.v1.model.SnapshotPrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeIdentityById; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotTest.java index 174abc0167..5818c217cb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/SnapshotTest.java @@ -26,6 +26,7 @@ import com.ibm.cloud.is.vpc.v1.model.RegionReference; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupReference; import com.ibm.cloud.is.vpc.v1.model.Snapshot; +import com.ibm.cloud.is.vpc.v1.model.SnapshotAllowedUse; import com.ibm.cloud.is.vpc.v1.model.SnapshotCatalogOffering; import com.ibm.cloud.is.vpc.v1.model.SnapshotClone; import com.ibm.cloud.is.vpc.v1.model.SnapshotConsistencyGroupReference; @@ -54,6 +55,7 @@ public class SnapshotTest { @Test public void testSnapshot() throws Throwable { Snapshot snapshotModel = new Snapshot(); + assertNull(snapshotModel.getAllowedUse()); assertNull(snapshotModel.getBackupPolicyPlan()); assertNull(snapshotModel.isBootable()); assertNull(snapshotModel.getCapturedAt()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayResourceBindingOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayResourceBindingOptionsTest.java new file mode 100644 index 0000000000..70b363cb60 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateEndpointGatewayResourceBindingOptionsTest.java @@ -0,0 +1,49 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.UpdateEndpointGatewayResourceBindingOptions; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the UpdateEndpointGatewayResourceBindingOptions model. + */ +public class UpdateEndpointGatewayResourceBindingOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateEndpointGatewayResourceBindingOptions() throws Throwable { + UpdateEndpointGatewayResourceBindingOptions updateEndpointGatewayResourceBindingOptionsModel = new UpdateEndpointGatewayResourceBindingOptions.Builder() + .endpointGatewayId("testString") + .id("testString") + .endpointGatewayResourceBindingPatch(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(updateEndpointGatewayResourceBindingOptionsModel.endpointGatewayId(), "testString"); + assertEquals(updateEndpointGatewayResourceBindingOptionsModel.id(), "testString"); + assertEquals(updateEndpointGatewayResourceBindingOptionsModel.endpointGatewayResourceBindingPatch(), java.util.Collections.singletonMap("anyKey", "anyValue")); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateEndpointGatewayResourceBindingOptionsError() throws Throwable { + new UpdateEndpointGatewayResourceBindingOptions.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVirtualNetworkInterfaceOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVirtualNetworkInterfaceOptionsTest.java index 11ff4642fe..4a8f68d3b6 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVirtualNetworkInterfaceOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVirtualNetworkInterfaceOptionsTest.java @@ -34,9 +34,11 @@ public void testUpdateVirtualNetworkInterfaceOptions() throws Throwable { UpdateVirtualNetworkInterfaceOptions updateVirtualNetworkInterfaceOptionsModel = new UpdateVirtualNetworkInterfaceOptions.Builder() .id("testString") .virtualNetworkInterfacePatch(java.util.Collections.singletonMap("anyKey", "anyValue")) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); assertEquals(updateVirtualNetworkInterfaceOptionsModel.id(), "testString"); assertEquals(updateVirtualNetworkInterfaceOptionsModel.virtualNetworkInterfacePatch(), java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(updateVirtualNetworkInterfaceOptionsModel.ifMatch(), "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\""); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptionsTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptionsTest.java index 4f27e50504..22be87fc7c 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptionsTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/UpdateVpnGatewayConnectionOptionsTest.java @@ -35,10 +35,12 @@ public void testUpdateVpnGatewayConnectionOptions() throws Throwable { .vpnGatewayId("testString") .id("testString") .vpnGatewayConnectionPatch(java.util.Collections.singletonMap("anyKey", "anyValue")) + .ifMatch("W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\"") .build(); assertEquals(updateVpnGatewayConnectionOptionsModel.vpnGatewayId(), "testString"); assertEquals(updateVpnGatewayConnectionOptionsModel.id(), "testString"); assertEquals(updateVpnGatewayConnectionOptionsModel.vpnGatewayConnectionPatch(), java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(updateVpnGatewayConnectionOptionsModel.ifMatch(), "W/\"96d225c4-56bd-43d9-98fc-d7148e5c5028\""); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayAdvertisedCIDRCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayAdvertisedCIDRCollectionTest.java new file mode 100644 index 0000000000..fd510679fd --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayAdvertisedCIDRCollectionTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayAdvertisedCIDRCollection; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayAdvertisedCIDRCollection model. + */ +public class VPNGatewayAdvertisedCIDRCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayAdvertisedCIDRCollection() throws Throwable { + VPNGatewayAdvertisedCIDRCollection vpnGatewayAdvertisedCidrCollectionModel = new VPNGatewayAdvertisedCIDRCollection(); + assertNull(vpnGatewayAdvertisedCidrCollectionModel.getAdvertisedCidrs()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionTest.java index 66c22ae167..e3f0116f0d 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayCollectionTest.java @@ -27,7 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.VPNGatewayMember; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayMemberHealthReason; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayMemberLifecycleReason; -import com.ibm.cloud.is.vpc.v1.model.VPNGatewayPolicyMode; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayRouteMode; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import com.ibm.cloud.sdk.core.util.DateUtils; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalPrototypeTest.java new file mode 100644 index 0000000000..f9cff1bb21 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalPrototypeTest.java @@ -0,0 +1,52 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeLocalPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModeLocalPrototype model. + */ +public class VPNGatewayConnectionDynamicRouteModeLocalPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionDynamicRouteModeLocalPrototype() throws Throwable { + VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN vpnGatewayConnectionIkeIdentityPrototypeModel = new VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN.Builder() + .type("fqdn") + .value("my-service.example.com") + .build(); + assertEquals(vpnGatewayConnectionIkeIdentityPrototypeModel.type(), "fqdn"); + assertEquals(vpnGatewayConnectionIkeIdentityPrototypeModel.value(), "my-service.example.com"); + + VPNGatewayConnectionDynamicRouteModeLocalPrototype vpnGatewayConnectionDynamicRouteModeLocalPrototypeModel = new VPNGatewayConnectionDynamicRouteModeLocalPrototype.Builder() + .ikeIdentities(java.util.Arrays.asList(vpnGatewayConnectionIkeIdentityPrototypeModel)) + .build(); + assertEquals(vpnGatewayConnectionDynamicRouteModeLocalPrototypeModel.ikeIdentities(), java.util.Arrays.asList(vpnGatewayConnectionIkeIdentityPrototypeModel)); + + String json = TestUtilities.serialize(vpnGatewayConnectionDynamicRouteModeLocalPrototypeModel); + + VPNGatewayConnectionDynamicRouteModeLocalPrototype vpnGatewayConnectionDynamicRouteModeLocalPrototypeModelNew = TestUtilities.deserialize(json, VPNGatewayConnectionDynamicRouteModeLocalPrototype.class); + assertTrue(vpnGatewayConnectionDynamicRouteModeLocalPrototypeModelNew instanceof VPNGatewayConnectionDynamicRouteModeLocalPrototype); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalTest.java new file mode 100644 index 0000000000..cc8327bc6e --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeLocalTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeLocal; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModeLocal model. + */ +public class VPNGatewayConnectionDynamicRouteModeLocalTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionDynamicRouteModeLocal() throws Throwable { + VPNGatewayConnectionDynamicRouteModeLocal vpnGatewayConnectionDynamicRouteModeLocalModel = new VPNGatewayConnectionDynamicRouteModeLocal(); + assertNull(vpnGatewayConnectionDynamicRouteModeLocalModel.getIkeIdentities()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeTest.java new file mode 100644 index 0000000000..ef1d7d5275 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModePeerPrototype model. + */ +public class VPNGatewayConnectionDynamicRouteModePeerPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testVPNGatewayConnectionDynamicRouteModePeerPrototype() throws Throwable { + VPNGatewayConnectionDynamicRouteModePeerPrototype vpnGatewayConnectionDynamicRouteModePeerPrototypeModel = new VPNGatewayConnectionDynamicRouteModePeerPrototype(); + assertNotNull(vpnGatewayConnectionDynamicRouteModePeerPrototypeModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddressTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddressTest.java new file mode 100644 index 0000000000..8911cd13c1 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddressTest.java @@ -0,0 +1,65 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress model. + */ +public class VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddressTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress() throws Throwable { + VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN vpnGatewayConnectionIkeIdentityPrototypeModel = new VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN.Builder() + .type("fqdn") + .value("my-service.example.com") + .build(); + assertEquals(vpnGatewayConnectionIkeIdentityPrototypeModel.type(), "fqdn"); + assertEquals(vpnGatewayConnectionIkeIdentityPrototypeModel.value(), "my-service.example.com"); + + VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModel = new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.Builder() + .asn(Long.valueOf("26")) + .ikeIdentity(vpnGatewayConnectionIkeIdentityPrototypeModel) + .address("192.0.2.5") + .build(); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModel.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModel.ikeIdentity(), vpnGatewayConnectionIkeIdentityPrototypeModel); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModel.address(), "192.0.2.5"); + + String json = TestUtilities.serialize(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModel); + + VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModelNew = TestUtilities.deserialize(json, VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.class); + assertTrue(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModelNew instanceof VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModelNew.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModelNew.ikeIdentity().toString(), vpnGatewayConnectionIkeIdentityPrototypeModel.toString()); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByAddressModelNew.address(), "192.0.2.5"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddressError() throws Throwable { + new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDNTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDNTest.java new file mode 100644 index 0000000000..0f1b80660a --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDNTest.java @@ -0,0 +1,65 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN model. + */ +public class VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDNTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN() throws Throwable { + VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN vpnGatewayConnectionIkeIdentityPrototypeModel = new VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN.Builder() + .type("fqdn") + .value("my-service.example.com") + .build(); + assertEquals(vpnGatewayConnectionIkeIdentityPrototypeModel.type(), "fqdn"); + assertEquals(vpnGatewayConnectionIkeIdentityPrototypeModel.value(), "my-service.example.com"); + + VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModel = new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN.Builder() + .asn(Long.valueOf("26")) + .ikeIdentity(vpnGatewayConnectionIkeIdentityPrototypeModel) + .fqdn("my-service.example.com") + .build(); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModel.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModel.ikeIdentity(), vpnGatewayConnectionIkeIdentityPrototypeModel); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModel.fqdn(), "my-service.example.com"); + + String json = TestUtilities.serialize(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModel); + + VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModelNew = TestUtilities.deserialize(json, VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN.class); + assertTrue(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModelNew instanceof VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModelNew.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModelNew.ikeIdentity().toString(), vpnGatewayConnectionIkeIdentityPrototypeModel.toString()); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeVpnGatewayConnectionPeerByFqdnModelNew.fqdn(), "my-service.example.com"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testVPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDNError() throws Throwable { + new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByFQDN.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerTest.java new file mode 100644 index 0000000000..fabe7da1e4 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeer; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModePeer model. + */ +public class VPNGatewayConnectionDynamicRouteModePeerTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testVPNGatewayConnectionDynamicRouteModePeer() throws Throwable { + VPNGatewayConnectionDynamicRouteModePeer vpnGatewayConnectionDynamicRouteModePeerModel = new VPNGatewayConnectionDynamicRouteModePeer(); + assertNotNull(vpnGatewayConnectionDynamicRouteModePeerModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddressTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddressTest.java new file mode 100644 index 0000000000..da6e7ca73b --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddressTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress model. + */ +public class VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddressTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress() throws Throwable { + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByAddressModel = new VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress(); + assertNull(vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByAddressModel.getAsn()); + assertNull(vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByAddressModel.getIkeIdentity()); + assertNull(vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByAddressModel.getType()); + assertNull(vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByAddressModel.getAddress()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDNTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDNTest.java new file mode 100644 index 0000000000..d5fe2e243b --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDNTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN model. + */ +public class VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDNTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN() throws Throwable { + VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByFqdnModel = new VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByFQDN(); + assertNull(vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByFqdnModel.getAsn()); + assertNull(vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByFqdnModel.getIkeIdentity()); + assertNull(vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByFqdnModel.getType()); + assertNull(vpnGatewayConnectionDynamicRouteModePeerVpnGatewayConnectionPeerByFqdnModel.getFqdn()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeTunnelTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeTunnelTest.java new file mode 100644 index 0000000000..f3feb0ab57 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionDynamicRouteModeTunnelTest.java @@ -0,0 +1,44 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.IP; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeTunnel; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnelStatusReason; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionDynamicRouteModeTunnel model. + */ +public class VPNGatewayConnectionDynamicRouteModeTunnelTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionDynamicRouteModeTunnel() throws Throwable { + VPNGatewayConnectionDynamicRouteModeTunnel vpnGatewayConnectionDynamicRouteModeTunnelModel = new VPNGatewayConnectionDynamicRouteModeTunnel(); + assertNull(vpnGatewayConnectionDynamicRouteModeTunnelModel.getNeighborIp()); + assertNull(vpnGatewayConnectionDynamicRouteModeTunnelModel.getProtocolState()); + assertNull(vpnGatewayConnectionDynamicRouteModeTunnelModel.getPublicIp()); + assertNull(vpnGatewayConnectionDynamicRouteModeTunnelModel.getStatus()); + assertNull(vpnGatewayConnectionDynamicRouteModeTunnelModel.getStatusReasons()); + assertNull(vpnGatewayConnectionDynamicRouteModeTunnelModel.getTunnelInterfaceIp()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatchTest.java index 0e08655d90..2900d3e057 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPatchTest.java @@ -13,11 +13,13 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.IP; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPDPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPatch; import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPolicyModePeerPatchVPNGatewayConnectionPeerAddressPatch; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnel; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; import java.io.InputStream; @@ -60,6 +62,18 @@ public void testVPNGatewayConnectionPatch() throws Throwable { .build(); assertEquals(vpnGatewayConnectionPeerPatchModel.address(), "192.0.2.5"); + IP ipModel = new IP.Builder() + .address("169.254.0.2") + .build(); + assertEquals(ipModel.address(), "169.254.0.2"); + + VPNGatewayConnectionTunnel vpnGatewayConnectionTunnelModel = new VPNGatewayConnectionTunnel.Builder() + .neighborIp(ipModel) + .tunnelInterfaceIp(ipModel) + .build(); + assertEquals(vpnGatewayConnectionTunnelModel.neighborIp(), ipModel); + assertEquals(vpnGatewayConnectionTunnelModel.tunnelInterfaceIp(), ipModel); + VPNGatewayConnectionPatch vpnGatewayConnectionPatchModel = new VPNGatewayConnectionPatch.Builder() .adminStateUp(true) .deadPeerDetection(vpnGatewayConnectionDpdPatchModel) @@ -70,6 +84,8 @@ public void testVPNGatewayConnectionPatch() throws Throwable { .name("my-vpn-gateway-connection") .peer(vpnGatewayConnectionPeerPatchModel) .psk("lkj14b1oi0alcniejkso") + .routingProtocol("bgp") + .tunnels(java.util.Arrays.asList(vpnGatewayConnectionTunnelModel)) .build(); assertEquals(vpnGatewayConnectionPatchModel.adminStateUp(), Boolean.valueOf(true)); assertEquals(vpnGatewayConnectionPatchModel.deadPeerDetection(), vpnGatewayConnectionDpdPatchModel); @@ -80,6 +96,8 @@ public void testVPNGatewayConnectionPatch() throws Throwable { assertEquals(vpnGatewayConnectionPatchModel.name(), "my-vpn-gateway-connection"); assertEquals(vpnGatewayConnectionPatchModel.peer(), vpnGatewayConnectionPeerPatchModel); assertEquals(vpnGatewayConnectionPatchModel.psk(), "lkj14b1oi0alcniejkso"); + assertEquals(vpnGatewayConnectionPatchModel.routingProtocol(), "bgp"); + assertEquals(vpnGatewayConnectionPatchModel.tunnels(), java.util.Arrays.asList(vpnGatewayConnectionTunnelModel)); String json = TestUtilities.serialize(vpnGatewayConnectionPatchModel); @@ -94,6 +112,7 @@ public void testVPNGatewayConnectionPatch() throws Throwable { assertEquals(vpnGatewayConnectionPatchModelNew.name(), "my-vpn-gateway-connection"); assertEquals(vpnGatewayConnectionPatchModelNew.peer().toString(), vpnGatewayConnectionPeerPatchModel.toString()); assertEquals(vpnGatewayConnectionPatchModelNew.psk(), "lkj14b1oi0alcniejkso"); + assertEquals(vpnGatewayConnectionPatchModelNew.routingProtocol(), "bgp"); } @Test public void testVPNGatewayConnectionPatchAsPatch() throws Throwable { @@ -115,6 +134,15 @@ public void testVPNGatewayConnectionPatchAsPatch() throws Throwable { .address("192.0.2.5") .build(); + IP ipModel = new IP.Builder() + .address("169.254.0.2") + .build(); + + VPNGatewayConnectionTunnel vpnGatewayConnectionTunnelModel = new VPNGatewayConnectionTunnel.Builder() + .neighborIp(ipModel) + .tunnelInterfaceIp(ipModel) + .build(); + VPNGatewayConnectionPatch vpnGatewayConnectionPatchModel = new VPNGatewayConnectionPatch.Builder() .adminStateUp(true) .deadPeerDetection(vpnGatewayConnectionDpdPatchModel) @@ -125,6 +153,8 @@ public void testVPNGatewayConnectionPatchAsPatch() throws Throwable { .name("my-vpn-gateway-connection") .peer(vpnGatewayConnectionPeerPatchModel) .psk("lkj14b1oi0alcniejkso") + .routingProtocol("bgp") + .tunnels(java.util.Arrays.asList(vpnGatewayConnectionTunnelModel)) .build(); Map mergePatch = vpnGatewayConnectionPatchModel.asPatch(); @@ -138,6 +168,8 @@ public void testVPNGatewayConnectionPatchAsPatch() throws Throwable { assertEquals(mergePatch.get("name"), "my-vpn-gateway-connection"); assertTrue(mergePatch.containsKey("peer")); assertEquals(mergePatch.get("psk"), "lkj14b1oi0alcniejkso"); + assertEquals(mergePatch.get("routing_protocol"), "bgp"); + assertTrue(mergePatch.containsKey("tunnels")); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchTest.java new file mode 100644 index 0000000000..83741893d1 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch model. + */ +public class VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch() throws Throwable { + VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchModel = new VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatch(); + assertNotNull(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatchTest.java new file mode 100644 index 0000000000..c0e5adbbb8 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatchTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch model. + */ +public class VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch() throws Throwable { + VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatchModel = new VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.Builder() + .asn(Long.valueOf("26")) + .address("192.0.2.5") + .build(); + assertEquals(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatchModel.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatchModel.address(), "192.0.2.5"); + + String json = TestUtilities.serialize(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatchModel); + + VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatchModelNew = TestUtilities.deserialize(json, VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch.class); + assertTrue(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatchModelNew instanceof VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerAddressPatch); + assertEquals(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatchModelNew.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerAddressPatchModelNew.address(), "192.0.2.5"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatchTest.java new file mode 100644 index 0000000000..ca0ab3ef68 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatchTest.java @@ -0,0 +1,48 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch model. + */ +public class VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch() throws Throwable { + VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatchModel = new VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch.Builder() + .asn(Long.valueOf("26")) + .fqdn("my-service.example.com") + .build(); + assertEquals(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatchModel.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatchModel.fqdn(), "my-service.example.com"); + + String json = TestUtilities.serialize(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatchModel); + + VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatchModelNew = TestUtilities.deserialize(json, VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch.class); + assertTrue(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatchModelNew instanceof VPNGatewayConnectionPeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionDynamicRouteModePeerPatchVPNGatewayConnectionPeerFQDNPatch); + assertEquals(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatchModelNew.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionPeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionDynamicRouteModePeerPatchVpnGatewayConnectionPeerFqdnPatchModelNew.fqdn(), "my-service.example.com"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeTest.java new file mode 100644 index 0000000000..49c9300508 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeTest.java @@ -0,0 +1,143 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.IP; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPDPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeLocalPrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnelPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype model. + */ +public class VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype() throws Throwable { + VPNGatewayConnectionDPDPrototype vpnGatewayConnectionDpdPrototypeModel = new VPNGatewayConnectionDPDPrototype.Builder() + .action("restart") + .interval(Long.valueOf("30")) + .timeout(Long.valueOf("120")) + .build(); + assertEquals(vpnGatewayConnectionDpdPrototypeModel.action(), "restart"); + assertEquals(vpnGatewayConnectionDpdPrototypeModel.interval(), Long.valueOf("30")); + assertEquals(vpnGatewayConnectionDpdPrototypeModel.timeout(), Long.valueOf("120")); + + VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById vpnGatewayConnectionIkePolicyPrototypeModel = new VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById.Builder() + .id("r006-e98f46a3-1e4e-4195-b4e5-b8155192689d") + .build(); + assertEquals(vpnGatewayConnectionIkePolicyPrototypeModel.id(), "r006-e98f46a3-1e4e-4195-b4e5-b8155192689d"); + + VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById vpnGatewayConnectionIPsecPolicyPrototypeModel = new VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById.Builder() + .id("r006-51eae621-dbbc-4c47-b623-b57a43c19876") + .build(); + assertEquals(vpnGatewayConnectionIPsecPolicyPrototypeModel.id(), "r006-51eae621-dbbc-4c47-b623-b57a43c19876"); + + VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN vpnGatewayConnectionIkeIdentityPrototypeModel = new VPNGatewayConnectionIKEIdentityPrototypeVPNGatewayConnectionIKEIdentityFQDN.Builder() + .type("fqdn") + .value("my-service.example.com") + .build(); + assertEquals(vpnGatewayConnectionIkeIdentityPrototypeModel.type(), "fqdn"); + assertEquals(vpnGatewayConnectionIkeIdentityPrototypeModel.value(), "my-service.example.com"); + + VPNGatewayConnectionDynamicRouteModeLocalPrototype vpnGatewayConnectionDynamicRouteModeLocalPrototypeModel = new VPNGatewayConnectionDynamicRouteModeLocalPrototype.Builder() + .ikeIdentities(java.util.Arrays.asList(vpnGatewayConnectionIkeIdentityPrototypeModel)) + .build(); + assertEquals(vpnGatewayConnectionDynamicRouteModeLocalPrototypeModel.ikeIdentities(), java.util.Arrays.asList(vpnGatewayConnectionIkeIdentityPrototypeModel)); + + VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress vpnGatewayConnectionDynamicRouteModePeerPrototypeModel = new VPNGatewayConnectionDynamicRouteModePeerPrototypeVPNGatewayConnectionPeerByAddress.Builder() + .asn(Long.valueOf("26")) + .ikeIdentity(vpnGatewayConnectionIkeIdentityPrototypeModel) + .address("192.0.2.5") + .build(); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeModel.asn(), Long.valueOf("26")); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeModel.ikeIdentity(), vpnGatewayConnectionIkeIdentityPrototypeModel); + assertEquals(vpnGatewayConnectionDynamicRouteModePeerPrototypeModel.address(), "192.0.2.5"); + + IP ipModel = new IP.Builder() + .address("169.254.0.2") + .build(); + assertEquals(ipModel.address(), "169.254.0.2"); + + VPNGatewayConnectionTunnelPrototype vpnGatewayConnectionTunnelPrototypeModel = new VPNGatewayConnectionTunnelPrototype.Builder() + .neighborIp(ipModel) + .tunnelInterfaceIp(ipModel) + .build(); + assertEquals(vpnGatewayConnectionTunnelPrototypeModel.neighborIp(), ipModel); + assertEquals(vpnGatewayConnectionTunnelPrototypeModel.tunnelInterfaceIp(), ipModel); + + VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel = new VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.Builder() + .adminStateUp(true) + .deadPeerDetection(vpnGatewayConnectionDpdPrototypeModel) + .establishMode("bidirectional") + .ikePolicy(vpnGatewayConnectionIkePolicyPrototypeModel) + .ipsecPolicy(vpnGatewayConnectionIPsecPolicyPrototypeModel) + .name("my-vpn-gateway-connection") + .psk("lkj14b1oi0alcniejkso") + .distributeTraffic(false) + .local(vpnGatewayConnectionDynamicRouteModeLocalPrototypeModel) + .peer(vpnGatewayConnectionDynamicRouteModePeerPrototypeModel) + .routingProtocol("bgp") + .tunnels(java.util.Arrays.asList(vpnGatewayConnectionTunnelPrototypeModel)) + .build(); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.adminStateUp(), Boolean.valueOf(true)); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.deadPeerDetection(), vpnGatewayConnectionDpdPrototypeModel); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.establishMode(), "bidirectional"); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.ikePolicy(), vpnGatewayConnectionIkePolicyPrototypeModel); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.ipsecPolicy(), vpnGatewayConnectionIPsecPolicyPrototypeModel); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.name(), "my-vpn-gateway-connection"); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.psk(), "lkj14b1oi0alcniejkso"); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.distributeTraffic(), Boolean.valueOf(false)); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.local(), vpnGatewayConnectionDynamicRouteModeLocalPrototypeModel); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.peer(), vpnGatewayConnectionDynamicRouteModePeerPrototypeModel); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.routingProtocol(), "bgp"); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel.tunnels(), java.util.Arrays.asList(vpnGatewayConnectionTunnelPrototypeModel)); + + String json = TestUtilities.serialize(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModel); + + VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew = TestUtilities.deserialize(json, VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.class); + assertTrue(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew instanceof VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.adminStateUp(), Boolean.valueOf(true)); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.deadPeerDetection().toString(), vpnGatewayConnectionDpdPrototypeModel.toString()); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.establishMode(), "bidirectional"); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.ikePolicy().toString(), vpnGatewayConnectionIkePolicyPrototypeModel.toString()); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.ipsecPolicy().toString(), vpnGatewayConnectionIPsecPolicyPrototypeModel.toString()); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.name(), "my-vpn-gateway-connection"); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.psk(), "lkj14b1oi0alcniejkso"); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.distributeTraffic(), Boolean.valueOf(false)); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.local().toString(), vpnGatewayConnectionDynamicRouteModeLocalPrototypeModel.toString()); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.peer().toString(), vpnGatewayConnectionDynamicRouteModePeerPrototypeModel.toString()); + assertEquals(vpnGatewayConnectionPrototypeVpnGatewayConnectionDynamicRouteModePrototypeModelNew.routingProtocol(), "bgp"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testVPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototypeError() throws Throwable { + new VPNGatewayConnectionPrototypeVPNGatewayConnectionDynamicRouteModePrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeTest.java new file mode 100644 index 0000000000..683a49c052 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeTest.java @@ -0,0 +1,67 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.Deleted; +import com.ibm.cloud.is.vpc.v1.model.IKEPolicyReference; +import com.ibm.cloud.is.vpc.v1.model.IP; +import com.ibm.cloud.is.vpc.v1.model.IPsecPolicyReference; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDPD; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeLocal; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModePeerVPNGatewayConnectionPeerByAddress; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionDynamicRouteModeTunnel; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionIKEIdentityVPNGatewayConnectionIKEIdentityFQDN; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionStatusReason; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnelStatusReason; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode model. + */ +public class VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteModeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode() throws Throwable { + VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel = new VPNGatewayConnectionRouteModeVPNGatewayConnectionDynamicRouteMode(); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.isAdminStateUp()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getAuthenticationMode()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getCreatedAt()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getDeadPeerDetection()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getEstablishMode()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getHref()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getId()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getIkePolicy()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getIpsecPolicy()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getMode()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getName()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getPsk()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getResourceType()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getStatus()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getStatusReasons()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.isDistributeTraffic()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getLocal()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getPeer()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getRoutingProtocol()); + assertNull(vpnGatewayConnectionRouteModeVpnGatewayConnectionDynamicRouteModeModel.getTunnels()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelPrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelPrototypeTest.java new file mode 100644 index 0000000000..7b91e17b89 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelPrototypeTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.IP; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnelPrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionTunnelPrototype model. + */ +public class VPNGatewayConnectionTunnelPrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionTunnelPrototype() throws Throwable { + IP ipModel = new IP.Builder() + .address("169.254.0.2") + .build(); + assertEquals(ipModel.address(), "169.254.0.2"); + + VPNGatewayConnectionTunnelPrototype vpnGatewayConnectionTunnelPrototypeModel = new VPNGatewayConnectionTunnelPrototype.Builder() + .neighborIp(ipModel) + .tunnelInterfaceIp(ipModel) + .build(); + assertEquals(vpnGatewayConnectionTunnelPrototypeModel.neighborIp(), ipModel); + assertEquals(vpnGatewayConnectionTunnelPrototypeModel.tunnelInterfaceIp(), ipModel); + + String json = TestUtilities.serialize(vpnGatewayConnectionTunnelPrototypeModel); + + VPNGatewayConnectionTunnelPrototype vpnGatewayConnectionTunnelPrototypeModelNew = TestUtilities.deserialize(json, VPNGatewayConnectionTunnelPrototype.class); + assertTrue(vpnGatewayConnectionTunnelPrototypeModelNew instanceof VPNGatewayConnectionTunnelPrototype); + assertEquals(vpnGatewayConnectionTunnelPrototypeModelNew.neighborIp().toString(), ipModel.toString()); + assertEquals(vpnGatewayConnectionTunnelPrototypeModelNew.tunnelInterfaceIp().toString(), ipModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testVPNGatewayConnectionTunnelPrototypeError() throws Throwable { + new VPNGatewayConnectionTunnelPrototype.Builder().build(); + } + +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelTest.java new file mode 100644 index 0000000000..fca934e980 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayConnectionTunnelTest.java @@ -0,0 +1,54 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.IP; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayConnectionTunnel; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayConnectionTunnel model. + */ +public class VPNGatewayConnectionTunnelTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayConnectionTunnel() throws Throwable { + IP ipModel = new IP.Builder() + .address("169.254.0.2") + .build(); + assertEquals(ipModel.address(), "169.254.0.2"); + + VPNGatewayConnectionTunnel vpnGatewayConnectionTunnelModel = new VPNGatewayConnectionTunnel.Builder() + .neighborIp(ipModel) + .tunnelInterfaceIp(ipModel) + .build(); + assertEquals(vpnGatewayConnectionTunnelModel.neighborIp(), ipModel); + assertEquals(vpnGatewayConnectionTunnelModel.tunnelInterfaceIp(), ipModel); + + String json = TestUtilities.serialize(vpnGatewayConnectionTunnelModel); + + VPNGatewayConnectionTunnel vpnGatewayConnectionTunnelModelNew = TestUtilities.deserialize(json, VPNGatewayConnectionTunnel.class); + assertTrue(vpnGatewayConnectionTunnelModelNew instanceof VPNGatewayConnectionTunnel); + assertEquals(vpnGatewayConnectionTunnelModelNew.neighborIp().toString(), ipModel.toString()); + assertEquals(vpnGatewayConnectionTunnelModelNew.tunnelInterfaceIp().toString(), ipModel.toString()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatchTest.java index 5d14374c5e..df0d438531 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPatchTest.java @@ -33,24 +33,29 @@ public class VPNGatewayPatchTest { @Test public void testVPNGatewayPatch() throws Throwable { VPNGatewayPatch vpnGatewayPatchModel = new VPNGatewayPatch.Builder() + .localAsn(Long.valueOf("64520")) .name("my-vpn-gateway") .build(); + assertEquals(vpnGatewayPatchModel.localAsn(), Long.valueOf("64520")); assertEquals(vpnGatewayPatchModel.name(), "my-vpn-gateway"); String json = TestUtilities.serialize(vpnGatewayPatchModel); VPNGatewayPatch vpnGatewayPatchModelNew = TestUtilities.deserialize(json, VPNGatewayPatch.class); assertTrue(vpnGatewayPatchModelNew instanceof VPNGatewayPatch); + assertEquals(vpnGatewayPatchModelNew.localAsn(), Long.valueOf("64520")); assertEquals(vpnGatewayPatchModelNew.name(), "my-vpn-gateway"); } @Test public void testVPNGatewayPatchAsPatch() throws Throwable { VPNGatewayPatch vpnGatewayPatchModel = new VPNGatewayPatch.Builder() + .localAsn(Long.valueOf("64520")) .name("my-vpn-gateway") .build(); Map mergePatch = vpnGatewayPatchModel.asPatch(); + assertTrue(mergePatch.containsKey("local_asn")); assertEquals(mergePatch.get("name"), "my-vpn-gateway"); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototypeTest.java index 01a4ade68a..e253b1bb5b 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototypeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayPrototypeVPNGatewayRouteModePrototypeTest.java @@ -47,11 +47,15 @@ public void testVPNGatewayPrototypeVPNGatewayRouteModePrototype() throws Throwab .name("my-vpn-gateway") .resourceGroup(resourceGroupIdentityModel) .subnet(subnetIdentityModel) + .advertisedCidrs(java.util.Arrays.asList("192.168.3.0/24")) + .localAsn(Long.valueOf("64520")) .mode("route") .build(); assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModel.name(), "my-vpn-gateway"); assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModel.subnet(), subnetIdentityModel); + assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModel.advertisedCidrs(), java.util.Arrays.asList("192.168.3.0/24")); + assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModel.localAsn(), Long.valueOf("64520")); assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModel.mode(), "route"); String json = TestUtilities.serialize(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModel); @@ -61,6 +65,7 @@ public void testVPNGatewayPrototypeVPNGatewayRouteModePrototype() throws Throwab assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModelNew.name(), "my-vpn-gateway"); assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModelNew.subnet().toString(), subnetIdentityModel.toString()); + assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModelNew.localAsn(), Long.valueOf("64520")); assertEquals(vpnGatewayPrototypeVpnGatewayRouteModePrototypeModelNew.mode(), "route"); } diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteModeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteModeTest.java index 3f03401c2d..5c8fbcebfb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteModeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayRouteModeTest.java @@ -59,6 +59,8 @@ public void testVPNGatewayRouteMode() throws Throwable { assertNull(vpnGatewayRouteModeModel.getResourceType()); assertNull(vpnGatewayRouteModeModel.getSubnet()); assertNull(vpnGatewayRouteModeModel.getVpc()); + assertNull(vpnGatewayRouteModeModel.getAdvertisedCidrs()); + assertNull(vpnGatewayRouteModeModel.getLocalAsn()); assertNull(vpnGatewayRouteModeModel.getMode()); } } \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCollectionTest.java new file mode 100644 index 0000000000..8670fe60b6 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCollectionTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.PageLink; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCollection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCreatorTransitGatewayReference; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionStatusReason; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.cloud.sdk.core.util.DateUtils; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayServiceConnectionCollection model. + */ +public class VPNGatewayServiceConnectionCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayServiceConnectionCollection() throws Throwable { + VPNGatewayServiceConnectionCollection vpnGatewayServiceConnectionCollectionModel = new VPNGatewayServiceConnectionCollection(); + assertNull(vpnGatewayServiceConnectionCollectionModel.getFirst()); + assertNull(vpnGatewayServiceConnectionCollectionModel.getLimit()); + assertNull(vpnGatewayServiceConnectionCollectionModel.getNext()); + assertNull(vpnGatewayServiceConnectionCollectionModel.getServiceConnections()); + assertNull(vpnGatewayServiceConnectionCollectionModel.getTotalCount()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTest.java new file mode 100644 index 0000000000..5ec0ae1661 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCreator; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayServiceConnectionCreator model. + */ +public class VPNGatewayServiceConnectionCreatorTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testVPNGatewayServiceConnectionCreator() throws Throwable { + VPNGatewayServiceConnectionCreator vpnGatewayServiceConnectionCreatorModel = new VPNGatewayServiceConnectionCreator(); + assertNotNull(vpnGatewayServiceConnectionCreatorModel); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTransitGatewayReferenceTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTransitGatewayReferenceTest.java new file mode 100644 index 0000000000..50083216f5 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionCreatorTransitGatewayReferenceTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCreatorTransitGatewayReference; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayServiceConnectionCreatorTransitGatewayReference model. + */ +public class VPNGatewayServiceConnectionCreatorTransitGatewayReferenceTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayServiceConnectionCreatorTransitGatewayReference() throws Throwable { + VPNGatewayServiceConnectionCreatorTransitGatewayReference vpnGatewayServiceConnectionCreatorTransitGatewayReferenceModel = new VPNGatewayServiceConnectionCreatorTransitGatewayReference(); + assertNull(vpnGatewayServiceConnectionCreatorTransitGatewayReferenceModel.getCrn()); + assertNull(vpnGatewayServiceConnectionCreatorTransitGatewayReferenceModel.getId()); + assertNull(vpnGatewayServiceConnectionCreatorTransitGatewayReferenceModel.getResourceType()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionLifecycleReasonTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionLifecycleReasonTest.java new file mode 100644 index 0000000000..6d13bc5e21 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionLifecycleReasonTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionLifecycleReason; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayServiceConnectionLifecycleReason model. + */ +public class VPNGatewayServiceConnectionLifecycleReasonTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayServiceConnectionLifecycleReason() throws Throwable { + VPNGatewayServiceConnectionLifecycleReason vpnGatewayServiceConnectionLifecycleReasonModel = new VPNGatewayServiceConnectionLifecycleReason(); + assertNull(vpnGatewayServiceConnectionLifecycleReasonModel.getCode()); + assertNull(vpnGatewayServiceConnectionLifecycleReasonModel.getMessage()); + assertNull(vpnGatewayServiceConnectionLifecycleReasonModel.getMoreInfo()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionStatusReasonTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionStatusReasonTest.java new file mode 100644 index 0000000000..97a0b7181e --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionStatusReasonTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionStatusReason; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayServiceConnectionStatusReason model. + */ +public class VPNGatewayServiceConnectionStatusReasonTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayServiceConnectionStatusReason() throws Throwable { + VPNGatewayServiceConnectionStatusReason vpnGatewayServiceConnectionStatusReasonModel = new VPNGatewayServiceConnectionStatusReason(); + assertNull(vpnGatewayServiceConnectionStatusReasonModel.getCode()); + assertNull(vpnGatewayServiceConnectionStatusReasonModel.getMessage()); + assertNull(vpnGatewayServiceConnectionStatusReasonModel.getMoreInfo()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionTest.java new file mode 100644 index 0000000000..d5c1b10c36 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VPNGatewayServiceConnectionTest.java @@ -0,0 +1,46 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnection; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionCreatorTransitGatewayReference; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionLifecycleReason; +import com.ibm.cloud.is.vpc.v1.model.VPNGatewayServiceConnectionStatusReason; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VPNGatewayServiceConnection model. + */ +public class VPNGatewayServiceConnectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVPNGatewayServiceConnection() throws Throwable { + VPNGatewayServiceConnection vpnGatewayServiceConnectionModel = new VPNGatewayServiceConnection(); + assertNull(vpnGatewayServiceConnectionModel.getCreatedAt()); + assertNull(vpnGatewayServiceConnectionModel.getCreator()); + assertNull(vpnGatewayServiceConnectionModel.getId()); + assertNull(vpnGatewayServiceConnectionModel.getLifecycleReasons()); + assertNull(vpnGatewayServiceConnectionModel.getLifecycleState()); + assertNull(vpnGatewayServiceConnectionModel.getStatus()); + assertNull(vpnGatewayServiceConnectionModel.getStatusReasons()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHrefTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHrefTest.java index d4b56388f6..2bf1202008 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHrefTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHrefTest.java @@ -34,13 +34,13 @@ public void testVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetwo VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByHrefModel = new VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref.Builder() .href("https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") .build(); - assertEquals(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByHrefModel.href(), "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); + assertEquals(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByHrefModel.href, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); String json = TestUtilities.serialize(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByHrefModel); VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByHrefModelNew = TestUtilities.deserialize(json, VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref.class); assertTrue(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByHrefModelNew instanceof VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByHref); - assertEquals(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByHrefModelNew.href(), "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); + assertEquals(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByHrefModelNew.href, "https://us-south.iaas.cloud.ibm.com/v1/subnets/0717-bea6a632-5e13-42a4-b4b8-31dc877abfe4/reserved_ips/0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByIdTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByIdTest.java index d6381e7908..cc8683cb10 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByIdTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextByIdTest.java @@ -34,13 +34,13 @@ public void testVirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetwo VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByIdModel = new VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.Builder() .id("0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb") .build(); - assertEquals(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByIdModel.id(), "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); + assertEquals(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByIdModel.id, "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); String json = TestUtilities.serialize(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByIdModel); VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByIdModelNew = TestUtilities.deserialize(json, VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById.class); assertTrue(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByIdModelNew instanceof VirtualNetworkInterfaceIPPrototypeReservedIPIdentityVirtualNetworkInterfaceIPsContextById); - assertEquals(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByIdModelNew.id(), "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); + assertEquals(virtualNetworkInterfaceIpPrototypeReservedIpIdentityVirtualNetworkInterfaceIPsContextByIdModelNew.id, "0717-6d353a0f-aeb1-4ae1-832e-1110d10981bb"); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePatchTest.java new file mode 100644 index 0000000000..6e5d031ebc --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePatchTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePatch; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VolumeAllowedUsePatch model. + */ +public class VolumeAllowedUsePatchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVolumeAllowedUsePatch() throws Throwable { + VolumeAllowedUsePatch volumeAllowedUsePatchModel = new VolumeAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePatchModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePatchModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePatchModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + + String json = TestUtilities.serialize(volumeAllowedUsePatchModel); + + VolumeAllowedUsePatch volumeAllowedUsePatchModelNew = TestUtilities.deserialize(json, VolumeAllowedUsePatch.class); + assertTrue(volumeAllowedUsePatchModelNew instanceof VolumeAllowedUsePatch); + assertEquals(volumeAllowedUsePatchModelNew.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePatchModelNew.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePatchModelNew.instance(), "gpu.count > 0 && enable_secure_boot == true"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePrototypeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePrototypeTest.java new file mode 100644 index 0000000000..3f7bd87221 --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUsePrototypeTest.java @@ -0,0 +1,51 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VolumeAllowedUsePrototype model. + */ +public class VolumeAllowedUsePrototypeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVolumeAllowedUsePrototype() throws Throwable { + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + + String json = TestUtilities.serialize(volumeAllowedUsePrototypeModel); + + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModelNew = TestUtilities.deserialize(json, VolumeAllowedUsePrototype.class); + assertTrue(volumeAllowedUsePrototypeModelNew instanceof VolumeAllowedUsePrototype); + assertEquals(volumeAllowedUsePrototypeModelNew.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModelNew.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModelNew.instance(), "gpu.count > 0 && enable_secure_boot == true"); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUseTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUseTest.java new file mode 100644 index 0000000000..dda6eac0ec --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAllowedUseTest.java @@ -0,0 +1,39 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUse; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VolumeAllowedUse model. + */ +public class VolumeAllowedUseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVolumeAllowedUse() throws Throwable { + VolumeAllowedUse volumeAllowedUseModel = new VolumeAllowedUse(); + assertNull(volumeAllowedUseModel.getApiVersion()); + assertNull(volumeAllowedUseModel.getBareMetalServer()); + assertNull(volumeAllowedUseModel.getInstance()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContextTest.java index b1baa115fb..89403f1394 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceByImageContextTest.java @@ -15,6 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceByImageContext; @@ -35,6 +36,15 @@ public class VolumeAttachmentPrototypeInstanceByImageContextTest { @Test public void testVolumeAttachmentPrototypeInstanceByImageContext() throws Throwable { + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -51,6 +61,7 @@ public void testVolumeAttachmentPrototypeInstanceByImageContext() throws Throwab assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -60,6 +71,7 @@ public void testVolumeAttachmentPrototypeInstanceByImageContext() throws Throwab .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest.java index 499f15cb02..e5d30de947 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest.java @@ -16,6 +16,7 @@ import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceBySourceSnapshotContext; @@ -36,6 +37,15 @@ public class VolumeAttachmentPrototypeInstanceBySourceSnapshotContextTest { @Test public void testVolumeAttachmentPrototypeInstanceBySourceSnapshotContext() throws Throwable { + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -57,6 +67,7 @@ public void testVolumeAttachmentPrototypeInstanceBySourceSnapshotContext() throw assertEquals(snapshotIdentityModel.id(), "r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContextModel = new VolumePrototypeInstanceBySourceSnapshotContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -67,6 +78,7 @@ public void testVolumeAttachmentPrototypeInstanceBySourceSnapshotContext() throw .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java index 45baacf4de..d75dc1a980 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotTest.java @@ -16,6 +16,7 @@ import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -45,6 +46,15 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol .build(); assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -62,6 +72,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol .profile(volumeProfileIdentityModel) .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) + .allowedUse(volumeAllowedUsePrototypeModel) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .sourceSnapshot(snapshotIdentityModel) @@ -72,6 +83,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.profile(), volumeProfileIdentityModel); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.userTags(), java.util.Arrays.asList()); + assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModel.sourceSnapshot(), snapshotIdentityModel); @@ -85,6 +97,7 @@ public void testVolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVol assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.name(), "my-volume"); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.profile().toString(), volumeProfileIdentityModel.toString()); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); + assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.allowedUse().toString(), volumeAllowedUsePrototypeModel.toString()); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.capacity(), Long.valueOf("100")); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); assertEquals(volumeAttachmentPrototypeVolumeVolumePrototypeInstanceContextVolumePrototypeInstanceContextVolumeBySourceSnapshotModelNew.sourceSnapshot().toString(), snapshotIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionTest.java index 301614bbac..7086e05904 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeCollectionTest.java @@ -28,6 +28,7 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; import com.ibm.cloud.is.vpc.v1.model.Volume; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUse; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentDevice; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentReferenceVolumeContext; import com.ibm.cloud.is.vpc.v1.model.VolumeCatalogOffering; diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfileCollectionTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfileCollectionTest.java new file mode 100644 index 0000000000..f039451dda --- /dev/null +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeInstanceProfileCollectionTest.java @@ -0,0 +1,43 @@ +/* + * (C) Copyright IBM Corp. 2023, 2024, 2025. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.cloud.is.vpc.v1.model; + +import com.ibm.cloud.is.vpc.v1.model.InstanceProfileReference; +import com.ibm.cloud.is.vpc.v1.model.PageLink; +import com.ibm.cloud.is.vpc.v1.model.VolumeInstanceProfileCollection; +import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Unit test class for the VolumeInstanceProfileCollection model. + */ +public class VolumeInstanceProfileCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testVolumeInstanceProfileCollection() throws Throwable { + VolumeInstanceProfileCollection volumeInstanceProfileCollectionModel = new VolumeInstanceProfileCollection(); + assertNull(volumeInstanceProfileCollectionModel.getFirst()); + assertNull(volumeInstanceProfileCollectionModel.getInstanceProfiles()); + assertNull(volumeInstanceProfileCollectionModel.getLimit()); + assertNull(volumeInstanceProfileCollectionModel.getNext()); + assertNull(volumeInstanceProfileCollectionModel.getTotalCount()); + } +} \ No newline at end of file diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePatchTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePatchTest.java index d09c3b03f8..1e589ba3eb 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePatchTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePatchTest.java @@ -13,6 +13,7 @@ package com.ibm.cloud.is.vpc.v1.model; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePatch; import com.ibm.cloud.is.vpc.v1.model.VolumePatch; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -33,12 +34,22 @@ public class VolumePatchTest { @Test public void testVolumePatch() throws Throwable { + VolumeAllowedUsePatch volumeAllowedUsePatchModel = new VolumeAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePatchModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePatchModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePatchModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() .name("general-purpose") .build(); assertEquals(volumeProfileIdentityModel.name(), "general-purpose"); VolumePatch volumePatchModel = new VolumePatch.Builder() + .allowedUse(volumeAllowedUsePatchModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .iops(Long.valueOf("10000")) @@ -46,6 +57,7 @@ public void testVolumePatch() throws Throwable { .profile(volumeProfileIdentityModel) .userTags(java.util.Arrays.asList("testString")) .build(); + assertEquals(volumePatchModel.allowedUse(), volumeAllowedUsePatchModel); assertEquals(volumePatchModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePatchModel.capacity(), Long.valueOf("100")); assertEquals(volumePatchModel.iops(), Long.valueOf("10000")); @@ -57,6 +69,7 @@ public void testVolumePatch() throws Throwable { VolumePatch volumePatchModelNew = TestUtilities.deserialize(json, VolumePatch.class); assertTrue(volumePatchModelNew instanceof VolumePatch); + assertEquals(volumePatchModelNew.allowedUse().toString(), volumeAllowedUsePatchModel.toString()); assertEquals(volumePatchModelNew.bandwidth(), Long.valueOf("1000")); assertEquals(volumePatchModelNew.capacity(), Long.valueOf("100")); assertEquals(volumePatchModelNew.iops(), Long.valueOf("10000")); @@ -65,11 +78,18 @@ public void testVolumePatch() throws Throwable { } @Test public void testVolumePatchAsPatch() throws Throwable { + VolumeAllowedUsePatch volumeAllowedUsePatchModel = new VolumeAllowedUsePatch.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + VolumeProfileIdentityByName volumeProfileIdentityModel = new VolumeProfileIdentityByName.Builder() .name("general-purpose") .build(); VolumePatch volumePatchModel = new VolumePatch.Builder() + .allowedUse(volumeAllowedUsePatchModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .iops(Long.valueOf("10000")) @@ -80,6 +100,7 @@ public void testVolumePatchAsPatch() throws Throwable { Map mergePatch = volumePatchModel.asPatch(); + assertTrue(mergePatch.containsKey("allowed_use")); assertTrue(mergePatch.containsKey("bandwidth")); assertTrue(mergePatch.containsKey("capacity")); assertTrue(mergePatch.containsKey("iops")); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContextTest.java index 21d6fc127b..86be99434e 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceByImageContextTest.java @@ -15,6 +15,7 @@ import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceByImageContext; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -34,6 +35,15 @@ public class VolumePrototypeInstanceByImageContextTest { @Test public void testVolumePrototypeInstanceByImageContext() throws Throwable { + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -50,6 +60,7 @@ public void testVolumePrototypeInstanceByImageContext() throws Throwable { assertEquals(resourceGroupIdentityModel.id(), "fee82deba12e4c0fb69c3b09d1f12345"); VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModel = new VolumePrototypeInstanceByImageContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -59,6 +70,7 @@ public void testVolumePrototypeInstanceByImageContext() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceByImageContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceByImageContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -72,6 +84,7 @@ public void testVolumePrototypeInstanceByImageContext() throws Throwable { VolumePrototypeInstanceByImageContext volumePrototypeInstanceByImageContextModelNew = TestUtilities.deserialize(json, VolumePrototypeInstanceByImageContext.class); assertTrue(volumePrototypeInstanceByImageContextModelNew instanceof VolumePrototypeInstanceByImageContext); + assertEquals(volumePrototypeInstanceByImageContextModelNew.allowedUse().toString(), volumeAllowedUsePrototypeModel.toString()); assertEquals(volumePrototypeInstanceByImageContextModelNew.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceByImageContextModelNew.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceByImageContextModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContextTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContextTest.java index 1a0295c1d9..503a6c9bd8 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContextTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeInstanceBySourceSnapshotContextTest.java @@ -16,6 +16,7 @@ import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeInstanceBySourceSnapshotContext; import com.ibm.cloud.is.vpc.v1.utils.TestUtilities; @@ -35,6 +36,15 @@ public class VolumePrototypeInstanceBySourceSnapshotContextTest { @Test public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwable { + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -56,6 +66,7 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl assertEquals(snapshotIdentityModel.id(), "r006-f6bfa329-0e36-433f-a3bb-0df632e79263"); VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContextModel = new VolumePrototypeInstanceBySourceSnapshotContext.Builder() + .allowedUse(volumeAllowedUsePrototypeModel) .bandwidth(Long.valueOf("1000")) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) @@ -66,6 +77,7 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl .sourceSnapshot(snapshotIdentityModel) .userTags(java.util.Arrays.asList()) .build(); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModel.encryptionKey(), encryptionKeyIdentityModel); @@ -80,6 +92,7 @@ public void testVolumePrototypeInstanceBySourceSnapshotContext() throws Throwabl VolumePrototypeInstanceBySourceSnapshotContext volumePrototypeInstanceBySourceSnapshotContextModelNew = TestUtilities.deserialize(json, VolumePrototypeInstanceBySourceSnapshotContext.class); assertTrue(volumePrototypeInstanceBySourceSnapshotContextModelNew instanceof VolumePrototypeInstanceBySourceSnapshotContext); + assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.allowedUse().toString(), volumeAllowedUsePrototypeModel.toString()); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.bandwidth(), Long.valueOf("1000")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeInstanceBySourceSnapshotContextModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshotTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshotTest.java index c7d4816615..db21f60acf 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshotTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumePrototypeVolumeBySourceSnapshotTest.java @@ -16,6 +16,7 @@ import com.ibm.cloud.is.vpc.v1.model.EncryptionKeyIdentityByCRN; import com.ibm.cloud.is.vpc.v1.model.ResourceGroupIdentityById; import com.ibm.cloud.is.vpc.v1.model.SnapshotIdentityById; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUsePrototype; import com.ibm.cloud.is.vpc.v1.model.VolumeProfileIdentityByName; import com.ibm.cloud.is.vpc.v1.model.VolumePrototypeVolumeBySourceSnapshot; import com.ibm.cloud.is.vpc.v1.model.ZoneIdentityByName; @@ -51,6 +52,15 @@ public void testVolumePrototypeVolumeBySourceSnapshot() throws Throwable { .build(); assertEquals(zoneIdentityModel.name(), "us-south-1"); + VolumeAllowedUsePrototype volumeAllowedUsePrototypeModel = new VolumeAllowedUsePrototype.Builder() + .apiVersion("2024-06-23") + .bareMetalServer("enable_secure_boot == true") + .instance("gpu.count > 0 && enable_secure_boot == true") + .build(); + assertEquals(volumeAllowedUsePrototypeModel.apiVersion(), "2024-06-23"); + assertEquals(volumeAllowedUsePrototypeModel.bareMetalServer(), "enable_secure_boot == true"); + assertEquals(volumeAllowedUsePrototypeModel.instance(), "gpu.count > 0 && enable_secure_boot == true"); + EncryptionKeyIdentityByCRN encryptionKeyIdentityModel = new EncryptionKeyIdentityByCRN.Builder() .crn("crn:v1:bluemix:public:kms:us-south:a/aa2432b1fa4d4ace891e9b80fc104e34:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179") .build(); @@ -69,6 +79,7 @@ public void testVolumePrototypeVolumeBySourceSnapshot() throws Throwable { .resourceGroup(resourceGroupIdentityModel) .userTags(java.util.Arrays.asList()) .zone(zoneIdentityModel) + .allowedUse(volumeAllowedUsePrototypeModel) .capacity(Long.valueOf("100")) .encryptionKey(encryptionKeyIdentityModel) .sourceSnapshot(snapshotIdentityModel) @@ -80,6 +91,7 @@ public void testVolumePrototypeVolumeBySourceSnapshot() throws Throwable { assertEquals(volumePrototypeVolumeBySourceSnapshotModel.resourceGroup(), resourceGroupIdentityModel); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.userTags(), java.util.Arrays.asList()); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.zone(), zoneIdentityModel); + assertEquals(volumePrototypeVolumeBySourceSnapshotModel.allowedUse(), volumeAllowedUsePrototypeModel); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.encryptionKey(), encryptionKeyIdentityModel); assertEquals(volumePrototypeVolumeBySourceSnapshotModel.sourceSnapshot(), snapshotIdentityModel); @@ -94,6 +106,7 @@ public void testVolumePrototypeVolumeBySourceSnapshot() throws Throwable { assertEquals(volumePrototypeVolumeBySourceSnapshotModelNew.profile().toString(), volumeProfileIdentityModel.toString()); assertEquals(volumePrototypeVolumeBySourceSnapshotModelNew.resourceGroup().toString(), resourceGroupIdentityModel.toString()); assertEquals(volumePrototypeVolumeBySourceSnapshotModelNew.zone().toString(), zoneIdentityModel.toString()); + assertEquals(volumePrototypeVolumeBySourceSnapshotModelNew.allowedUse().toString(), volumeAllowedUsePrototypeModel.toString()); assertEquals(volumePrototypeVolumeBySourceSnapshotModelNew.capacity(), Long.valueOf("100")); assertEquals(volumePrototypeVolumeBySourceSnapshotModelNew.encryptionKey().toString(), encryptionKeyIdentityModel.toString()); assertEquals(volumePrototypeVolumeBySourceSnapshotModelNew.sourceSnapshot().toString(), snapshotIdentityModel.toString()); diff --git a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeTest.java b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeTest.java index 188f4009fc..68cb8cba36 100644 --- a/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeTest.java +++ b/modules/vpc/src/test/java/com/ibm/cloud/is/vpc/v1/model/VolumeTest.java @@ -27,6 +27,7 @@ import com.ibm.cloud.is.vpc.v1.model.SnapshotReference; import com.ibm.cloud.is.vpc.v1.model.SnapshotRemote; import com.ibm.cloud.is.vpc.v1.model.Volume; +import com.ibm.cloud.is.vpc.v1.model.VolumeAllowedUse; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentDevice; import com.ibm.cloud.is.vpc.v1.model.VolumeAttachmentReferenceVolumeContext; import com.ibm.cloud.is.vpc.v1.model.VolumeCatalogOffering; @@ -55,6 +56,7 @@ public void testVolume() throws Throwable { assertNull(volumeModel.isActive()); assertNull(volumeModel.getAdjustableCapacityStates()); assertNull(volumeModel.getAdjustableIopsStates()); + assertNull(volumeModel.getAllowedUse()); assertNull(volumeModel.getAttachmentState()); assertNull(volumeModel.getBandwidth()); assertNull(volumeModel.isBusy());